@@ -230,9 +230,28 @@ def test_open_dataset_chunks() -> None:
230230
231231
232232def test_crop_burst_dataset () -> None :
233- swath_polarisation_ds = sentinel1 .open_sentinel1_dataset (SLC_IW , group = "IW1/VH" )
233+ swath_ds = sentinel1 .open_sentinel1_dataset (SLC_IW , group = "IW1/VH" )
234234
235- res = sentinel1 .crop_burst_dataset (swath_polarisation_ds , 8 )
235+ res1 = sentinel1 .crop_burst_dataset (swath_ds , 8 )
236236
237- assert set (res .dims ) == {"azimuth_time" , "slant_range_time" }
238- assert res .dims ["azimuth_time" ] == swath_polarisation_ds .attrs ["lines_per_burst" ]
237+ assert set (res1 .dims ) == {"azimuth_time" , "slant_range_time" }
238+ assert res1 .dims ["azimuth_time" ] == swath_ds .attrs ["lines_per_burst" ]
239+
240+ res2 = sentinel1 .crop_burst_dataset (swath_ds , azimuth_anx_time = 2210 )
241+
242+ assert res2 .equals (res1 )
243+
244+ res3 = sentinel1 .crop_burst_dataset (
245+ swath_ds , azimuth_anx_time = 2213 , use_center = True
246+ )
247+
248+ assert res3 .equals (res1 )
249+
250+ with pytest .raises (TypeError ):
251+ sentinel1 .crop_burst_dataset (swath_ds )
252+
253+ with pytest .raises (TypeError ):
254+ sentinel1 .crop_burst_dataset (swath_ds , burst_index = 8 , azimuth_anx_time = 2213 )
255+
256+ with pytest .raises (IndexError ):
257+ sentinel1 .crop_burst_dataset (swath_ds , burst_index = - 1 )
0 commit comments