Open harryclewis opened 7 months ago
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.