Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jonas cutthrough timeseries script #224

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

JonasSuni
Copy link
Contributor

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

Copy link
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
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
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
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
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
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
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
Contributor

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.

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