Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions spicy_snow/retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,15 @@ def retrieve_snow_depth(aoi: shapely.geometry.Polygon,
# clip outlier values of backscatter to overall mean
ds = s1_clip_outliers(ds)

# The snow-index functions do in-place .loc[time=...] writes; without
# forcing fresh writable in-memory arrays, the second orbit's write
# fails with "assignment destination is read-only".
# .load() alone is insufficient: it materializes lazy/dask arrays but
# does NOT deep-copy already-in-memory arrays whose buffers are
# read-only (observed on fairbanks 2024_2025). Combine with
# .copy(deep=True) to guarantee writable backing.
ds = ds.load().copy(deep=True)

# -- Calulating Snow Index -- #
log.info("Calculating snow index")
# calculate delta CR and delta VV
Expand Down
Loading