Skip to content

Jonas cutthrough timeseries script#224

Merged
alhom merged 15 commits intofmihpc:masterfrom
JonasSuni:jonas_scripts
Jul 15, 2025
Merged

Jonas cutthrough timeseries script#224
alhom merged 15 commits intofmihpc:masterfrom
JonasSuni:jonas_scripts

Conversation

@JonasSuni
Copy link
Copy Markdown
Contributor

Usable and tested script for making cutthrough timeseries (aka. time-elongation maps aka. keograms) with Vlasiator data.

Copy link
Copy Markdown
Contributor

@kostahoraites kostahoraites left a comment

Choose a reason for hiding this comment

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

this function could be simplified at little cost by converting many of the positional arguments into keyword arguments. This would follow the approach taken in other analysator plotting routines, like plot_colormap3d()

some suggested defaults:
bulkpath='./'
bulkprefix='bulk'
outputname='cutthrough_timeseries.png',
outputdir='./',
intpol=False,
filt=0,
op=None,
cmap='plasma',

@JonasSuni
Copy link
Copy Markdown
Contributor Author

I changed the command line argument handling to use argparse instead of sys.argv, so now there are proper defaults and optional arguments.

@JonasSuni
Copy link
Copy Markdown
Contributor Author

This has been tested by the way.

fnr0: First file number to plot
fnr1: Last file number to plot
dr: Distance between cut-through sample points (km)
pointfile: File containing a list of coordinates, in Re
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

how many? Which ordering of X,Y,Z and points?
What are the default values?

@markusbattarbee
Copy link
Copy Markdown
Contributor

I'm sorry but a "cut through" function implies some cut along spatial space. This now takes a list of points (From a file!?! What do we do, live in the dark ages?) and plonks those values in the plot array, but the "spatial" axis isn't a proper axis as it's just a list of points.

Having a starting point and an end point and doing a cut between those two positions (using one of the existing cut through functions) would be much preferred.

@JonasSuni
Copy link
Copy Markdown
Contributor Author

I have to respectfully disagree with some of these points (no pun intended).

Reading in the list of coordinates from a file is easier in this case when the script is intended to be run directly from the command line.

And continuing with that line of reasoning, this script is intended as an auxiliary tool only that can be run as is.

As for using an arbitrary list of points instead of a cut, this functionality is useful for cases where you want to e.g. plot along a field line or some other non-analytic curve. However, I can change the name of the script and the functions to reflect that this is not a "straight cut".

If I was integrating a function directly into Analysator (like a plot_cutthrough function or something), then I would certainly use the existing cut through functions and implement the straight cut through first. Do let me know if you think that is what I should be doing instead.

@JonasSuni
Copy link
Copy Markdown
Contributor Author

Ok I will write a more generic function that takes reasonable non-file input when I have time. (Battarbee & Suni, private communication, 2024)

@alhom
Copy link
Copy Markdown
Member

alhom commented Aug 28, 2024

Quick notes:

  • Do what Markus says
  • use this
    def cut_through_curve(vlsvReader, curve):
  • def main() is great, and that can handle calling the function from the command line, while making the plotting function available for importing via pyplots

This is to be done between now and Jonas' defense.

@JonasSuni
Copy link
Copy Markdown
Contributor Author

python cutthrough_timeseries.py -var proton/vg_rho -fnr 800 900 -bulkpath /wrk-vakka/group/spacephysics/vlasiator/2D/AIC/bulk/ -bulkprefix bulk -outputname test.png -outputdir ./ -cmap batlow -point 80e6 0 0 120e6 0 0

now generates the following image:

test

@alhom alhom merged commit f271f92 into fmihpc:master Jul 15, 2025
30 checks passed
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.

4 participants