fmihpc / analysator

Python based package for analyzing vlsv files produced by Vlasiator
GNU General Public License v2.0
5 stars 32 forks source link

Add plot_vdfdiff to plot_vdf.py #227

Open ursg opened 3 months ago

ursg commented 3 months ago

This is mostly a copy-and-paste duplication of most of the plot_vdf code, except that it opens two files (or vlsvreader objects), can take two separate lists of cellids and then pairwise iterates through them, extracting the velocity spaces, histogrammizing them and then taking the diff of the extracted histograms.

This avoids all trouble with identifying missing blocks. Also, I suppose it has potential science applications to diff VDFs from different cells or times in their individual plasma frames.

The colour bar is linear instead of logarithmic, and centered around zero by default.

Here's an example plot from a pitch angle diffusion simulation, comparing timestep 0 and timestep 2: plot_vdf_proton_cellid_1_t0_xy

markusbattarbee commented 3 weeks ago

A useful tool but bloats plot_vdf horrendously. I would suggest either, preferably, adding the diff funcitonality to the existing script, or alternatively splitting this to a different file altogether. (And then pending a proper re-organization of analysator scripts to a more modular approach)