pysat / pysatSpaceWeather

pysat support for space weather indices and data sets
BSD 3-Clause "New" or "Revised" License
7 stars 5 forks source link

Dst update #57

Closed rstoneback closed 3 years ago

rstoneback commented 3 years ago

Description

Addresses #56

Fixed multi-day data loading issue. Also improved efficiency when loading multiple days, plus, I added metadata.

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

start_date = dt.datetime(2001, 1, 1)
end_date = dt.datetime(2001, 12, 31)
dst = pysat.Instrument('sw', 'dst')
dst.load(date=start_date, end_date=end_date)
dst['dst'].plot(title=dst.meta['dst', dst.meta.labels.name], 
                ylabel=dst.meta['dst', dst.meta.labels.units])

image

Test Configuration

Checklist:

If this is a release PR, replace the first item of the above checklist with the release checklist on the pysat wiki: https://github.com/pysat/pysat/wiki/Checklist-for-Release

aburrell commented 3 years ago

I made some changes to partially address #59

rstoneback commented 3 years ago

I just made changes instead of requesting them. Tell me what you think @rstoneback

Fair enough. Good catch on the missing return. Adding a 'noaa' tag certainly makes it easy to extend to other data sources in the future. My only hesitation is it makes instantiating slightly harder but it does also make code written today more robust against future changes. Works for me.

rstoneback commented 3 years ago

I have a draft pull over at pysatTutorials. My initial thinking was it could be good to have demos of the various pysatSpaceWeather instruments over there. Here is a simple example for Dst, https://github.com/pysat/pysatTutorials/pull/4

Then I wondered how many we want to maintain, plus what is the balance against examples in the documentation. Topics for a telecom perhaps and outside this pull. Still, leaving this note here given the specific connection to dst. It is the reason I found the bug.