File tree 1 file changed +4
-4
lines changed
earthdaily/earthdatastore/cube_utils 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -344,6 +344,10 @@ def datacube(
344
344
if nodata == 0 or nodata :
345
345
nodatas .update ({ds_asset : nodata })
346
346
break
347
+ # apply nodata
348
+ ds = _apply_nodata (ds , nodatas )
349
+ if rescale :
350
+ ds = rescale_assets_with_items (items_collection , ds , assets = assets )
347
351
348
352
# drop na dates
349
353
ds = ds .isel (dict (time = np .where (~ np .isnan (ds .time ))[0 ]))
@@ -360,10 +364,6 @@ def datacube(
360
364
# no need anymore thanks to geobox/geopolygon in doc
361
365
# ds = ds.rio.clip_box(*intersects.to_crs(ds.rio.crs).total_bounds)
362
366
ds = ds .rio .clip (intersects .to_crs (ds .rio .crs ).geometry )
363
- # apply nodata
364
- ds = _apply_nodata (ds , nodatas )
365
- if rescale :
366
- ds = rescale_assets_with_items (items_collection , ds , assets = assets )
367
367
if engine == "stackstac" :
368
368
ds = _autofix_unfrozen_coords_dtype (ds )
369
369
if cross_calibration_items is not None and len (cross_calibration_items ) > 0 :
You can’t perform that action at this time.
0 commit comments