Unintuitive varnames functionality for loading data #968
Labels
cdflib
Issues involving the cdflib package
Documentation
Examples, notebooks, installation guides, webinars, etc
onboarding
Issues pertaining to helping new pyspedas or new python users up the learning curve
This may be a bit of an abstract issue but I feel it is worth putting here. One thing I've noticed is the rather unintuitive definition and use of the varnames keyword when loading data. When loading any data using pyspedas the varnames keyword ultimately gets passed to cdf_to_tplot.py where it loads only the varnames matching those names included in the cdf file. The confusion arises in the distinction between the variables included in the cdf and the secondary variables generated internally from pyspedas (i.e. spin averaged, omnidirectional and other type of post processing).
On the user side, the functioning of the varnames keyword requires some knowledge of what variables are available natively from the cdf file and what is generated internally within pyspedas. In my mind this is counterintuitive as to the prime usefulness of pyspedas, as in normal use (no passing of varnames) and in the documentation there is no distinction between the native cdf variables and the secondary variables generated internally by pyspedas. They are all loaded as tplot variables and treated as the same and someone is not normally required to know what variables are generated internally from pyspedas.
For example of where this might be an issue, say someone gives a name of a spin averaged value to a load function implying that they only want to load that one tplot variable (pyspedas runs much fasted when limiting the loaded variables, especially for longer time windows). When that varname is passed to cdf_to_tplot.py because it does not exist in the cdf and therefore no tplot variable is returned.
Perhaps this keyword could be clarified in the documentation to make its use more clear to readers. Also, In my mind a useful addition would be to include the ability for users to use varnames to load a pyspedas created tplot variable. Although that does require quite a hefty change to the functioning of the keyword.
The text was updated successfully, but these errors were encountered: