Skip to content

Splitting plot functions away from calculations/themis_observation.py #448

Open
lassejsc wants to merge 7 commits intofmihpc:masterfrom
lassejsc:themis_fix
Open

Splitting plot functions away from calculations/themis_observation.py #448
lassejsc wants to merge 7 commits intofmihpc:masterfrom
lassejsc:themis_fix

Conversation

@lassejsc
Copy link
Copy Markdown
Contributor

@lassejsc lassejsc commented Mar 12, 2026

Added also some functionality to plot to file with outputfile and whether to draw with draw and nooverwrite. Added ncontours kwarg for phaespace_contour allowing to set the level of contours to plot and additionally via this also fixed the colorbar ticks and formatting. (Not sure why the font changes with the format but maybe someone else can fiddle with it)

Example plots given by

file="/turso/group/spacephysics/analysator/CI/analysator-test-data/vlasiator/2D/BED/bulk/bulk.0002000.vlsv"
f=pt.vlsvfile.VlsvReader(file) 
cid=1
pt.plot.themis_plot_phasespace_contour(f,cid,draw=False)
pt.plot.themis_plot_phasespace_helistyle(f,cid,draw=False)
pt.plot.themis_plot_detector(f,cid,draw=False,detector_axis=np.array([0,0,1]))

phasespace_contour
123tes

phasespace_helistyle
themis_plot_phasespace_helistyle
detector
themis_plot_detector

@alhom
Copy link
Copy Markdown
Member

alhom commented Mar 20, 2026

Please check plotting functionality, add an example plot here and an example plotting call to the functions.

@lassejsc lassejsc marked this pull request as draft March 20, 2026 14:32
cmapuse=pt.plot.get_cmap("Blues")

cax = ax.pcolormesh(xi,yi,vi.T, norm=matplotlib.colors.LogNorm(vmin=vmin,vmax=vmax), vmin=vmin, vmax=vmax, cmap=cmapuse, shading='flat')
cax = ax.pcolormesh(xi,yi,vi.T, norm=matplotlib.colors.LogNorm(vmin=vmin,vmax=vmax), cmap=cmapuse)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note the change here, shading flat complained about the input shapes for this function and vmin,vmax complained about already being in the norm input, this made it plot with least amount of effort.

@lassejsc lassejsc marked this pull request as ready for review March 23, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants