Skip to content

Commit f3aa4ab

Browse files
authored
Merge pull request #161 from landsito/gold
Added new tags into SES14-GOLD
2 parents 7ccc4bf + 7d91e23 commit f3aa4ab

File tree

2 files changed

+46
-5
lines changed

2 files changed

+46
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
1313
* DMSP SSUSI EDR-Aurora data
1414
* IGS GPS (TEC and ROTI)
1515
* TIMED GUVI
16+
* SES-14 GOLD -- tdisk, tlimb and o2den data products added
17+
* TIMED GUVI
1618
* Add TIMED GUVI platform to support L1C intensity datasets.
1719
* Type of sensor source handled by inst_id with options of
1820
spectrograph, imaging

pysatNASA/instruments/ses14_gold.py

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
'gold'
1212
tag
1313
'nmax'
14+
'tlimb'
15+
'tdisk'
16+
'o2den'
1417
1518
Warnings
1619
--------
@@ -50,15 +53,18 @@
5053

5154
platform = 'ses14'
5255
name = 'gold'
53-
tags = {'nmax': 'Level 2 Nmax data for the GOLD instrument'}
54-
inst_ids = {'': ['nmax']}
56+
tags = {'nmax': 'Level 2 max dens data for the GOLD instrument',
57+
'tlimb': 'Level 2 limb temp data for the GOLD instrument',
58+
'tdisk': 'Level 2 disk temp data for the GOLD instrument',
59+
'o2den': 'Level 2 O2 dens data for the GOLD instrument'}
60+
inst_ids = {'': [tag for tag in tags.keys()]}
5561

5662
pandas_format = False
5763

5864
# ----------------------------------------------------------------------------
5965
# Instrument test attributes
6066

61-
_test_dates = {'': {'nmax': dt.datetime(2020, 1, 1)}}
67+
_test_dates = {'': {tag: dt.datetime(2020, 1, 1) for tag in tags.keys()}}
6268

6369
# ----------------------------------------------------------------------------
6470
# Instrument methods
@@ -153,12 +159,19 @@ def load(fnames, tag='', inst_id=''):
153159
'Valid_Max': 'Valid_Max', '_FillValue': 'fill',
154160
'FillVal': 'fill', 'TIME_BASE': 'time_base'}
155161

162+
if tag in ['nmax', 'tdisk', 'tlimb']:
163+
epoch_name = 'nscans'
164+
165+
elif tag == 'o2den':
166+
epoch_name = 'nevents'
167+
156168
data, meta = load_netcdf(fnames, pandas_format=pandas_format,
157-
epoch_name='nscans', labels=labels,
169+
epoch_name=epoch_name, labels=labels,
158170
meta_translation=meta_translation,
171+
combine_by_coords=False,
159172
drop_meta_labels='FILLVAL')
160173

161-
if tag == 'nmax':
174+
if tag == ['nmax', 'tdisk', 'tlimb']:
162175
# Add time coordinate from scan_start_time.
163176
time = [dt.datetime.strptime(str(val), "b'%Y-%m-%dT%H:%M:%SZ'")
164177
for val in data['scan_start_time'].values]
@@ -182,4 +195,30 @@ def load(fnames, tag='', inst_id=''):
182195
meta['nlons'] = {meta.labels.notes: 'Index for longitude values'}
183196
meta['nmask'] = {meta.labels.notes: 'Index for mask values'}
184197

198+
elif tag == 'o2den':
199+
200+
# Removing extra variables
201+
if len(data['zret'].dims) > 1:
202+
data['zret'] = data['zret'].isel(time=0)
203+
data['zdat'] = data['zdat'].isel(time=0)
204+
205+
# Add time coordinate from utc_time
206+
data['time'] = [dt.datetime.strptime(str(val),
207+
"b'%Y-%m-%dT%H:%M:%S.%fZ'")
208+
for val in data['time_utc'].values]
209+
210+
# Add retrieval altitude values and data tangent altitude values
211+
data = data.swap_dims({"nzret": "zret", "nzdat": "zdat"})
212+
213+
# Update coordinates with dimensional data
214+
data = data.assign_coords({'zret': data['zret'],
215+
'zdat': data['zdat'],
216+
'n_wavelength': data['n_wavelength'],
217+
'channel': data['channel']})
218+
meta['time'] = {meta.labels.notes: 'Converted from time_utc'}
219+
meta['zret'] = {meta.labels.notes: ''.join(('Index for retrieval',
220+
' altitude values'))}
221+
meta['zdat'] = {meta.labels.notes: ''.join(('Index for data tangent',
222+
' altitude values'))}
223+
185224
return data, meta

0 commit comments

Comments
 (0)