@@ -118,6 +118,7 @@ def or_ipf28(xpath):
118
118
return xpath
119
119
120
120
121
+
121
122
def list_poly_from_list_string_coords (str_coords_list ):
122
123
footprints = []
123
124
for gmlpoly in str_coords_list :
@@ -187,7 +188,8 @@ def list_poly_from_list_string_coords(str_coords_list):
187
188
'sample' : (int_1Darray_from_string , '//calibration/calibrationVectorList/calibrationVector[1]/pixel' ),
188
189
'sigma0_lut' : (
189
190
float_2Darray_from_string_list , '//calibration/calibrationVectorList/calibrationVector/sigmaNought' ),
190
- 'gamma0_lut' : (float_2Darray_from_string_list , '//calibration/calibrationVectorList/calibrationVector/gamma' )
191
+ 'gamma0_lut' : (float_2Darray_from_string_list , '//calibration/calibrationVectorList/calibrationVector/gamma' ),
192
+ 'azimuthTime' : (datetime64_array , '/calibration/calibrationVectorList/calibrationVector/azimuthTime' )
191
193
},
192
194
'noise' : {
193
195
'mode' : (scalar , '/noise/adsHeader/mode' ),
@@ -198,7 +200,8 @@ def list_poly_from_list_string_coords(str_coords_list):
198
200
or_ipf28 ('/noise/noiseRangeVectorList/noiseRangeVector/pixel' )),
199
201
'noiseLut' : (
200
202
lambda x : [np .fromstring (s , dtype = float , sep = ' ' ) for s in x ],
201
- or_ipf28 ('/noise/noiseRangeVectorList/noiseRangeVector/noiseRangeLut' ))
203
+ or_ipf28 ('/noise/noiseRangeVectorList/noiseRangeVector/noiseRangeLut' )),
204
+ 'azimuthTime' : (datetime64_array , '/noise/noiseRangeVectorList/noiseRangeVector/azimuthTime' )
202
205
},
203
206
'azi' : {
204
207
'swath' : '/noise/noiseAzimuthVectorList/noiseAzimuthVector/swath' ,
@@ -309,17 +312,19 @@ def list_poly_from_list_string_coords(str_coords_list):
309
312
}
310
313
311
314
312
- def signal_lut_raw (line , sample , lut_sigma0 , lut_gamma0 ):
315
+ def signal_lut_raw (line , sample , lut_sigma0 , lut_gamma0 , azimuth_times ):
313
316
ds = xr .Dataset ()
314
317
ds ['sigma0_lut' ] = xr .DataArray (lut_sigma0 , dims = ['line' , 'sample' ], coords = {'line' : line , 'sample' : sample },
315
318
name = 'sigma0' , attrs = {'description' : 'look up table sigma0' })
316
319
ds ['gamma0_lut' ] = xr .DataArray (lut_gamma0 , dims = ['line' , 'sample' ], coords = {'line' : line , 'sample' : sample },
317
320
name = 'gamma0' , attrs = {'description' : 'look up table gamma0' })
321
+ ds ['azimuthTime' ] = xr .DataArray (azimuth_times , dims = ['line' ],coords = {'line' : line },
322
+ attrs = {'description' : 'azimuth times associated to the signal look up table' })
318
323
319
324
return ds
320
325
321
326
322
- def noise_lut_range_raw (lines , samples , noiseLuts ):
327
+ def noise_lut_range_raw (lines , samples , noiseLuts , azimuthTimes ):
323
328
"""
324
329
325
330
Parameters
@@ -330,6 +335,8 @@ def noise_lut_range_raw(lines, samples, noiseLuts):
330
335
arrays of samples. list length is same as samples. each array define samples where lut is defined
331
336
noiseLuts: list of np.ndarray
332
337
arrays of luts. Same structure as samples.
338
+ azimuthTimes: np.ndarray
339
+ 1D array of azimuth dates associated to each lines of the noise range grid
333
340
334
341
Returns
335
342
-------
@@ -351,6 +358,10 @@ def noise_lut_range_raw(lines, samples, noiseLuts):
351
358
ds ['noise_lut' ] = xr .DataArray (tmp_noise ,
352
359
coords = {'line' : lines , 'sample' : samples [0 ][0 :minimum_pts ]},
353
360
dims = ['line' , 'sample' ])
361
+ try :
362
+ ds ['azimuthTime' ] = xr .DataArray (azimuthTimes ,coords = {'line' : lines },dims = ['line' ])
363
+ except : #for IPF2.72 for instance there is no azimuthTimes associated to the noise range LUT
364
+ ds ['azimuthTime' ] = xr .DataArray (np .ones (len (lines ))* np .nan , coords = {'line' : lines }, dims = ['line' ])
354
365
# ds['sample'] = xr.DataArray(np.stack(normalized_samples), coords={'lines': lines, 'sample_index': np.arange(minimum_pts)},
355
366
# dims=['lines', 'sample_index'])
356
367
@@ -749,11 +760,12 @@ def geolocation_grid(line, sample, values):
749
760
},
750
761
'luts_raw' : {
751
762
'func' : signal_lut_raw ,
752
- 'args' : ('calibration.line' , 'calibration.sample' , 'calibration.sigma0_lut' , 'calibration.gamma0_lut' )
763
+ 'args' : ('calibration.line' , 'calibration.sample' , 'calibration.sigma0_lut' , 'calibration.gamma0_lut' ,
764
+ 'calibration.azimuthTime' )
753
765
},
754
766
'noise_lut_range_raw' : {
755
767
'func' : noise_lut_range_raw ,
756
- 'args' : ('noise.range.line' , 'noise.range.sample' , 'noise.range.noiseLut' )
768
+ 'args' : ('noise.range.line' , 'noise.range.sample' , 'noise.range.noiseLut' , 'noise.range.azimuthTime' )
757
769
},
758
770
'noise_lut_azi_raw_grd' : {
759
771
'func' : noise_lut_azi_raw_grd ,
0 commit comments