You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem seems to come from the vdf_projection function, which is taking the square root of shifted energy bins. When the bins are smaller than the spacecraft potential, they are shifted to negative numbers and the np.sqrt() function is returning nan. The pcolormesh function can't accept nans as bin coordinates, which causes an error in plot_projection.py.
To fix this, I suggest np.sqrt(..., dtype=np.csingle) or np.emath.sqrt(...) on line 348 of vdf_projection.py.
Doing this gives 0 for the "negative" velocity bins, which I believe to be your intention based on the np.real() function on line 349. However, it might not be the perfect solution as it stretches the innermost bin to the center of the polar plot.
If you need an example timestep, use 1475257837.6974614 a.k.a ['2016-09-30T17:50:37.697'].
Running on pyrfu version 2.4.12 but with dependencies installed for 2.4.11 (see my other issue).
Hope this helps.
The text was updated successfully, but these errors were encountered:
Same issue experienced - as suggested above, np.sqrt(..., dtype=np.csingle) does fix the issue but stretches the innermost bin to the centre - example below. Have not yet found a better solution to this, and not sure if any other solution would make sense.
The problem seems to come from the
vdf_projection
function, which is taking the square root of shifted energy bins. When the bins are smaller than the spacecraft potential, they are shifted to negative numbers and thenp.sqrt()
function is returningnan
. Thepcolormesh
function can't acceptnan
s as bin coordinates, which causes an error inplot_projection.py
.To fix this, I suggest
np.sqrt(..., dtype=np.csingle)
ornp.emath.sqrt(...)
on line 348 ofvdf_projection.py
.Doing this gives 0 for the "negative" velocity bins, which I believe to be your intention based on the
np.real()
function on line 349. However, it might not be the perfect solution as it stretches the innermost bin to the center of the polar plot.If you need an example timestep, use
1475257837.6974614
a.k.a['2016-09-30T17:50:37.697']
.Running on pyrfu version 2.4.12 but with dependencies installed for 2.4.11 (see my other issue).
Hope this helps.
The text was updated successfully, but these errors were encountered: