Skip to content

Commit f68211a

Browse files
authored
Merge pull request #82 from pysat/rc_v0.0.6
Rc v0.0.6
2 parents 5b2e757 + 4d9d40c commit f68211a

3 files changed

Lines changed: 28 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ Change Log
33
All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](https://semver.org/).
55

6+
[0.0.6] - 2022-07-08
7+
--------------------
8+
* Updated `sw_f107` to reflect changes in the `historic` data file format
9+
610
[0.0.5] - 2022-06-10
711
--------------------
812
* Updated the docstrings to conform to pysat standards

pysatSpaceWeather/instruments/sw_f107.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,26 @@ def load(fnames, tag='', inst_id=''):
205205
meta.labels.fill_val: np.nan,
206206
meta.labels.min_val: 0,
207207
meta.labels.max_val: 400}
208+
elif tag == 'historic':
209+
210+
# LASP updated file format in June, 2022. Minimize impact downstream by
211+
# continuing use of `f107` as primary data product.
212+
if 'f107_adjusted' in data.columns:
213+
data['f107'] = data['f107_adjusted']
214+
215+
# Add metadata
216+
meta['f107_observed'] = meta['f107']
217+
raw_str = 'Raw F10.7 cm radio flux in Solar Flux Units (SFU)'
218+
meta['f107_observed'] = {meta.labels.desc: raw_str}
219+
220+
meta['f107_adjusted'] = meta['f107_observed']
221+
norm_str = ''.join(['F10.7 cm radio flux in Solar Flux Units (SFU)',
222+
' normalized to 1-AU'])
223+
meta['f107_adjusted'] = {meta.labels.desc: norm_str}
224+
225+
meta['f107'] = {
226+
meta.labels.desc: meta['f107_adjusted', meta.labels.desc]}
227+
208228
elif tag == 'daily' or tag == 'prelim':
209229
meta['ssn'] = {meta.labels.units: '',
210230
meta.labels.name: 'Sunspot Number',
@@ -473,8 +493,9 @@ def download(date_array, tag, inst_id, data_path, update_files=False):
473493
data.index = times
474494

475495
# Replace fill value with NaNs
476-
idx, = np.where(data['f107'] == -99999.0)
477-
data.iloc[idx, :] = np.nan
496+
for var in data.columns:
497+
idx, = np.where(data[var] == -99999.0)
498+
data.iloc[idx, :] = np.nan
478499

479500
# Create a local CSV file
480501
data.to_csv(data_file, header=True)

pysatSpaceWeather/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.5
1+
0.0.6

0 commit comments

Comments
 (0)