Skip to content

Commit

Permalink
add acheck before ds coarsen in eth_canopy_height
Browse files Browse the repository at this point in the history
  • Loading branch information
SarahAlidoost committed Oct 30, 2024
1 parent 56c5a5b commit 0f70d77
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/zampy/datasets/eth_canopy_height.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ def convert_tiff_to_netcdf(
ds = parse_tiff_file(file, sd_file)

# Coarsen the data to be 1/100 deg resolution instead of 1/12000
ds = ds.coarsen({"latitude": 120, "longitude": 120}).mean() # type: ignore
if len(ds.latitude) >= 120 and len(ds.longitude) >= 120:
ds = ds.coarsen({"latitude": 120, "longitude": 120}).mean() # type: ignore
ds = ds.compute()
ds = ds.interpolate_na(dim="longitude", limit=1)
ds = ds.interpolate_na(dim="latitude", limit=1)
Expand Down

0 comments on commit 0f70d77

Please sign in to comment.