@@ -122,9 +122,22 @@ def cp_geocode_meta(cfg, output_hdf5, dst):
122
122
# Copy of identification
123
123
identification_excludes = 'productType'
124
124
if is_insar :
125
- identification_excludes = ['productType' , 'listOfFrequencies' ]
125
+ identification_excludes = ['productType' , 'listOfFrequencies' ,
126
+ 'zeroDopplerStartTime' , 'zeroDopplerEndTime' ]
126
127
cp_h5_meta_data (src_h5 , dst_h5 , f'{ common_parent_path } /identification' ,
127
128
excludes = identification_excludes )
129
+ # If insar, create reference/secondary zeroDopplerStartEndTime
130
+ if is_insar :
131
+ # Open secondary hdf5 to copy information
132
+ with h5py .File (secondary_hdf5 , 'r' , libver = 'latest' , swmr = True ) as sec_src_h5 :
133
+ src_dataset = ['zeroDopplerStartTime' , 'zeroDopplerEndTime' ]
134
+ dst_dataset = ['referenceZeroDopplerStartTime' , 'referenceZeroDopplerEndTime' ]
135
+ for src_data , dst_data in zip (src_dataset , dst_dataset ):
136
+ cp_h5_meta_data (src_h5 , dst_h5 , f'{ common_parent_path } /identification/{ src_data } ' ,
137
+ f'{ common_parent_path } /identification/{ dst_data } ' )
138
+ dst_data = dst_data .replace ('reference' , 'secondary' )
139
+ cp_h5_meta_data (sec_src_h5 , dst_h5 , f'{ common_parent_path } /identification/{ src_data } ' ,
140
+ f'{ common_parent_path } /identification/{ dst_data } ' )
128
141
129
142
# Flag isGeocoded
130
143
ident = dst_h5 [f'{ common_parent_path } /identification' ]
@@ -144,10 +157,9 @@ def cp_geocode_meta(cfg, output_hdf5, dst):
144
157
f'{ dst_meta_path } /orbit' )
145
158
146
159
# copy attitude information group
147
- if is_geocoded :
148
- cp_h5_meta_data (src_h5 , dst_h5 , f'{ src_meta_path } /attitude' ,
149
- f'{ dst_meta_path } /attitude' )
150
- else :
160
+ cp_h5_meta_data (src_h5 , dst_h5 , f'{ src_meta_path } /attitude' ,
161
+ f'{ dst_meta_path } /attitude' )
162
+ if dst in ['RIFG' , 'RUNW' ]:
151
163
# RUNW and RIFG have no attitude group and have geolocation grid
152
164
yds = dst_h5 .create_dataset (f'{ dst_meta_path } /geolocationGrid/zeroDopplerTime' ,
153
165
data = src_h5 [f'{ src_meta_path } /geolocationGrid/zeroDopplerTime' ])
@@ -176,15 +188,10 @@ def cp_geocode_meta(cfg, output_hdf5, dst):
176
188
data = np .string_ (dem_interp_method ))
177
189
178
190
# copy processingInformation/inputs group
179
- exclude_args = ['l0bGranules' , 'demFiles' ]
180
- if not is_geocoded :
181
- exclude_args = ['attitudeFiles' , 'auxcalFiles' ,
182
- 'l0bGranules' , 'orbitFiles' ]
183
-
184
191
cp_h5_meta_data (src_h5 , dst_h5 ,
185
192
f'{ src_meta_path } /processingInformation/inputs' ,
186
193
f'{ dst_meta_path } /processingInformation/inputs' ,
187
- excludes = exclude_args )
194
+ excludes = [ 'l0bGranules' ] )
188
195
189
196
# Create l1SlcGranules
190
197
inputs = [input_hdf5 ]
0 commit comments