Skip to content

Commit

Permalink
Update retrieval.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ZachHoppinen authored Sep 7, 2023
1 parent c828521 commit 701d23d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spicy_snow/retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def retrieve_snow_depth(area: shapely.geometry.Polygon,
wet_snow_thresh: float = -2,
freezing_snow_thresh: float = 1,
wet_SI_thresh: float = 0,
outfp: Union[str, bool] = False,
outfp: Union[str, Path, bool] = False,
params: List[float] = [2.5, 0.2, 0.55]) -> xr.Dataset:
"""
Finds, downloads Sentinel-1, forest cover, water mask (not implemented), and
Expand Down Expand Up @@ -87,6 +87,10 @@ def retrieve_snow_depth(area: shapely.geometry.Polygon,
assert len(params) == 3, f"List of params must be 3 in order A, B, C. Got {params}"
A, B, C = params

if type(outfp) != bool:
outfp = Path(outfp).expanduser().resolve()
assert outfp.parent.exists(), f"Out filepath {outfp}'s directory does not exist"

## set up directories and logging

os.makedirs(work_dir, exist_ok = True)
Expand Down

0 comments on commit 701d23d

Please sign in to comment.