pysat / pysatSpaceWeather

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

Kp maintenance #99

Closed aburrell closed 1 year ago

aburrell commented 1 year ago

Description

Addresses #89 by adding new tags for the updated GFZ Kp data products. The prior tag ('') has been deprecated and scheduled for removal.

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Updated unit tests. Also:

import datetime as dt
import pysat
import pysatSpaceWeather as pysat_sw

# Initialize the two new Instrument combos
kp_def = pysat.Instrument('sw', 'kp', tag='def')
kp_now = pysat.Instrument('sw', 'kp', tag='now')

# Get the data
kp_def.download(start=dt.datetime(2022, 1, 1))
kp_now.download(start=dt.datetime(2022, 1, 1))

# Load the data
kp_def.load(date=dt.datetime(2022, 1, 1), use_header=True)
kp_now.load(date=dt.datetime(2022, 1, 1), use_header=True)

# Check out the new references and acknowledgements
print(kp_def.acknowledgements, kp_now.references)

This yeilds:

CC BY 4.0, The Kp index was introduced by Bartels (1949) and is produced by Geomagnetic Observatory Niemegk, GFZ German Research Centre for Geosciences.  Please cite the references in the 'references' attribute Matzka, J., Bronkalla, O., Tornow, K., Elger, K. and Stolle, C., 2021. Geomagnetic Kp index. V. 1.0. GFZ Data Services, doi:10.5880/Kp.0001
Matzka, J., Stolle, C., Yamazaki, Y., Bronkalla, O. and Morschhauser, A., 2021. The geomagnetic Kp index and derived indices of geomagnetic activity. Space Weather,doi:10.1029/2020SW002641

Now, show the nowcast and definitive indices can differ kp_def['Kp'] == kp_now['Kp']:

2022-01-01 00:00:00     True
2022-01-01 03:00:00     True
2022-01-01 06:00:00    False
2022-01-01 09:00:00     True
2022-01-01 12:00:00     True
2022-01-01 15:00:00     True
2022-01-01 18:00:00     True
2022-01-01 21:00:00    False
Name: Kp, dtype: bool

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