@@ -353,13 +353,13 @@ def open_azimuth_fm_rate_dataset(annotation: esa_safe.PathOrFileType) -> xr.Data
353
353
354
354
355
355
def find_available_groups (
356
- product_files : T .Dict [str , T .Tuple [str , str , str , str ]],
356
+ product_files : T .Dict [str , T .Tuple [str , str , str , str , str ]],
357
357
product_path : str ,
358
358
check_files_exist : bool = False ,
359
359
fs : fsspec .AbstractFileSystem = fsspec .filesystem ("file" ),
360
360
) -> T .Dict [str , T .List [str ]]:
361
361
groups : T .Dict [str , T .List [str ]] = {}
362
- for path , (type , swath , polarization , _ ) in product_files .items ():
362
+ for path , (type , _ , swath , polarization , _ ) in product_files .items ():
363
363
swath_pol_group = f"{ swath } /{ polarization } " .upper ()
364
364
abspath = os .path .join (product_path , os .path .normpath (path ))
365
365
if check_files_exist :
@@ -419,6 +419,7 @@ def open_pol_dataset(
419
419
}
420
420
encoding = {}
421
421
swap_dims = {}
422
+ chunks : T .Union [None , T .Dict [str , int ]] = None
422
423
423
424
azimuth_time = pd .date_range (
424
425
start = first_azimuth_time ,
@@ -452,6 +453,7 @@ def open_pol_dataset(
452
453
import dask # noqa
453
454
454
455
encoding ["preferred_chunks" ] = {"line" : lines_per_burst }
456
+ chunks = {}
455
457
except ModuleNotFoundError :
456
458
pass
457
459
@@ -486,7 +488,7 @@ def open_pol_dataset(
486
488
# the with is needed to avoid polluting stderr when the try block fails
487
489
with contextlib .redirect_stderr (open ("/dev/null" , "w" )):
488
490
try :
489
- arr = xr .open_dataarray (fs .open (measurement ), engine = "rasterio" ) # type: ignore
491
+ arr = xr .open_dataarray (fs .open (measurement ), engine = "rasterio" , chunks = chunks ) # type: ignore
490
492
except AttributeError :
491
493
arr = xr .open_dataarray (measurement , engine = "rasterio" ) # type: ignore
492
494
@@ -669,14 +671,15 @@ def compute_burst_centres(
669
671
670
672
671
673
def do_override_product_files (
672
- template : str , product_files : T .Dict [str , T .Tuple [str , str , str , str ]]
673
- ) -> T .Dict [str , T .Tuple [str , str , str , str ]]:
674
+ template : str , product_files : T .Dict [str , T .Tuple [str , str , str , str , str ]]
675
+ ) -> T .Dict [str , T .Tuple [str , str , str , str , str ]]:
674
676
overridden_product_files = {}
675
- for path , (type , swath , polarization , date ) in product_files .items ():
677
+ for path , description in product_files .items ():
678
+ type , prefix , swath , polarization , date = description
676
679
ext = os .path .splitext (path )[1 ]
677
680
dirname = os .path .dirname (path )
678
681
overridden_path = template .format (** locals ())
679
- overridden_product_files [overridden_path ] = ( type , swath , polarization , date )
682
+ overridden_product_files [overridden_path ] = description
680
683
return overridden_product_files
681
684
682
685
0 commit comments