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

PSP SPC load changes #867

Merged
merged 4 commits into from
May 27, 2024
Merged

Conversation

benjamin-short
Copy link
Contributor

Change secure load routines to retrieve files with both 'spp_spc_' and 'psp_spc_' prefixes. Returns tplot variables with the 'psp_spc_' prefix.

tweaked the secure load routines so that pyspedas will load files with both the "spp" and "psp" prefix.
Updates tplot names to have the proper 'psp_spc_' prefix after previous update
Only change the prefixes if spc is used.
Trying to solve a specific issue where one needs to pull data from both public and non-public data all at once. This would be a case where one is working on statistical studies which encompass the whole mission.

It would be easier on the end user to have the code download either from the secure server without having to manually code in the release date of SPC data.

This is an SPC specific issue because they choose to swap from spp to psp in public releases of data.

My previous solution was a halfhearted solution using the prefix=*_spc_ wildcard. But when paired with the last_version keyword, would prefer to download the spp prefix (which may have versions = v25.cdf) rather than the psp prefix which is generally the latest version. (which typically have versions = v00.cdf or v01.cdf, thus confusing the last_version keyword)

This solution checks each alternative starting with the psp prefix unless last_version=False, in which case it defaults to the previous prefix=*_spc_ solution.

I checked this code using:

trange = ['2024-03-20','2024-03-25'], all unreleased data

trange = ['2020-05-20','2020-05-25'], all released data but with unreleased versions present on the server.

trange=['2023-10-30','2023-11-02'], released data t0, secure data tf.

Through solving this issue, I also discovered that download was no longer throwing exceptions if there are no links which match the remote_names and so was not making use of the try/except blocks found in the psp load routine.

Fixed this by checking the length of the files variable, and if it was zero, I manually threw an exception, reactivating the try/except blocks.
@jameswilburlewis jameswilburlewis merged commit 40cd3d7 into spedas:master May 27, 2024
2 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.

2 participants