Skip to content

plot_projection() is unable to plot VDFs where energy bins are equivalent to less than the spacecraft potential #16

Description

@harryclewis

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions