11
11
'gold'
12
12
tag
13
13
'nmax'
14
+ 'tlimb'
15
+ 'tdisk'
16
+ 'o2den'
14
17
15
18
Warnings
16
19
--------
50
53
51
54
platform = 'ses14'
52
55
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 ()]}
55
61
56
62
pandas_format = False
57
63
58
64
# ----------------------------------------------------------------------------
59
65
# Instrument test attributes
60
66
61
- _test_dates = {'' : {'nmax' : dt .datetime (2020 , 1 , 1 )}}
67
+ _test_dates = {'' : {tag : dt .datetime (2020 , 1 , 1 ) for tag in tags . keys ( )}}
62
68
63
69
# ----------------------------------------------------------------------------
64
70
# Instrument methods
@@ -153,12 +159,19 @@ def load(fnames, tag='', inst_id=''):
153
159
'Valid_Max' : 'Valid_Max' , '_FillValue' : 'fill' ,
154
160
'FillVal' : 'fill' , 'TIME_BASE' : 'time_base' }
155
161
162
+ if tag in ['nmax' , 'tdisk' , 'tlimb' ]:
163
+ epoch_name = 'nscans'
164
+
165
+ elif tag == 'o2den' :
166
+ epoch_name = 'nevents'
167
+
156
168
data , meta = load_netcdf (fnames , pandas_format = pandas_format ,
157
- epoch_name = 'nscans' , labels = labels ,
169
+ epoch_name = epoch_name , labels = labels ,
158
170
meta_translation = meta_translation ,
171
+ combine_by_coords = False ,
159
172
drop_meta_labels = 'FILLVAL' )
160
173
161
- if tag == 'nmax' :
174
+ if tag == [ 'nmax' , 'tdisk' , 'tlimb' ] :
162
175
# Add time coordinate from scan_start_time.
163
176
time = [dt .datetime .strptime (str (val ), "b'%Y-%m-%dT%H:%M:%SZ'" )
164
177
for val in data ['scan_start_time' ].values ]
@@ -182,4 +195,30 @@ def load(fnames, tag='', inst_id=''):
182
195
meta ['nlons' ] = {meta .labels .notes : 'Index for longitude values' }
183
196
meta ['nmask' ] = {meta .labels .notes : 'Index for mask values' }
184
197
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
+
185
224
return data , meta
0 commit comments