@@ -133,7 +133,7 @@ def check_product_consistency(prod: Product):
133
133
assert isinstance (orbit_dir , OrbitDirection )
134
134
135
135
136
- def check_load (prod : Product , first_band ) -> None :
136
+ def check_load (prod : Product , first_band , pixel_size ) -> None :
137
137
"""
138
138
Check if the loading process
139
139
Args:
@@ -145,33 +145,38 @@ def check_load(prod: Product, first_band) -> None:
145
145
146
146
# Don't orthorectify with a window to 1000 m
147
147
with tempenv .TemporaryEnvironment ({SAR_DEF_PIXEL_SIZE : "0" }):
148
- # Load with the raw process
149
- band_arr_raw = prod .load (
150
- first_band .value ,
151
- window = Window (col_off = 0 , row_off = 0 , width = 100 , height = 100 ),
152
- clean_optical = "raw" ,
153
- )[first_band ]
154
-
155
148
# Check that band loaded 2 times gives the same results (disregarding float uncertainties)
156
149
band_arr1 = prod .load (
157
150
first_band ,
151
+ pixel_size = pixel_size ,
158
152
window = Window (col_off = 0 , row_off = 0 , width = 100 , height = 100 ),
159
153
clean_optical = "nodata" ,
160
154
)[first_band ]
161
155
band_arr2 = prod .load (
162
156
first_band ,
157
+ pixel_size = pixel_size ,
163
158
window = Window (col_off = 0 , row_off = 0 , width = 100 , height = 100 ),
164
159
)[first_band ]
165
-
166
- np .testing .assert_array_almost_equal (band_arr1 , band_arr2 )
167
-
168
- # Check dtypes
169
- ci .assert_val (band_arr_raw .dtype , np .float32 , "band_arr_raw dtype" )
170
160
ci .assert_val (band_arr1 .dtype , np .float32 , "band_arr1 dtype" )
171
161
ci .assert_val (band_arr2 .dtype , np .float32 , "band_arr2 dtype" )
162
+ ci .assert_val (band_arr1 .shape , band_arr2 .shape , "band_arr2 shape" )
163
+
164
+ if prod .sensor_type == SensorType .OPTICAL :
165
+ # Load with the raw process
166
+ band_arr_raw = prod .load (
167
+ first_band .value ,
168
+ pixel_size = pixel_size ,
169
+ window = Window (col_off = 0 , row_off = 0 , width = 100 , height = 100 ),
170
+ clean_optical = "raw" ,
171
+ )[first_band ]
172
+
173
+ np .testing .assert_array_almost_equal (band_arr1 , band_arr2 )
174
+
175
+ # Check dtypes
176
+ ci .assert_val (band_arr_raw .dtype , np .float32 , "band_arr_raw dtype" )
172
177
173
- # Check shapes between raw and no data cleaning
174
- ci .assert_val (band_arr_raw .shape , band_arr1 .shape , "band_arr1 shape" )
178
+ # Check shapes between raw and no data cleaning
179
+ ci .assert_val (band_arr_raw .shape , band_arr1 .shape , "band_arr_raw shape" )
175
180
176
181
177
182
def check_attrs (prod : Product , array : xr .DataArray , long_name ) -> None :
@@ -367,7 +372,7 @@ def core(prod_path, possible_bands, debug, **kwargs):
367
372
first_band = stack_bands [0 ]
368
373
369
374
# Check that band loaded 2 times gives the same results (disregarding float uncertainties)
370
- check_load (prod , first_band )
375
+ check_load (prod , first_band , pixel_size )
371
376
372
377
# Check stack
373
378
stack = test_satellites .check_stack (
0 commit comments