spedas / pyspedas

Python-based Space Physics Environment Data Analysis Software
https://pyspedas.readthedocs.io/
MIT License
147 stars 58 forks source link

Basic PyTplot examples need to be added to the Exploring the Heliosphere notebook #352

Closed ericthewizard closed 10 months ago

ericthewizard commented 1 year ago

Davin suggested we add some examples of get_data and store_data to our Exploring the Heliosphere with Python notebook:

https://github.com/spedas/pyspedas_examples/blob/master/pyspedas_examples/notebooks/Exploring_the_Heliosphere_with_Python.ipynb

Considering the purpose of this notebook is to showcase the power of PySPEDAS and PyTplot alongside SunPy, there are probably a bunch of other examples we can add.

ericthewizard commented 1 year ago

Also - I recently added the wrappers: pytplot.get (for pytplot.get_data) and pytplot.store (pytplot.store_data), since the "_data"'s in the names are relics from IDL (required in IDL due to the single namespace issue). We should probably start using these instead of get_data and store_data in our examples. The big differences are:

  1. pytplot.get_data returns the times as an array of floats (to preserve backwards compatibilty), while pytplot.get returns the datetime64 objects. This makes pytplot.get the faster option, since it doesn't have to convert the datetime64 objects to an array of floats
  2. pytplot.store_data accepts metadata dict using the keyword attrs_dict or something like that; I renamed this to metadata in pytplot.store

Otherwise they're essentially the same.

jameswilburlewis commented 10 months ago

I would like to keep that particular notebook at a higher, more analytic level -- we have several other repos for more beginner-oriented tutorial notebooks demonstrating the nuts and bolts of the lower level tools.