Skip to content

Commit

Permalink
🤦
Browse files Browse the repository at this point in the history
  • Loading branch information
kvantricht committed Sep 3, 2024
1 parent 1a19ec1 commit 8ee5b47
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion presto/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def _extract_eo_data(cls, inarr: xr.DataArray) -> Tuple[np.ndarray, np.ndarray]:
return eo_data, mask

@staticmethod
def _extract_latlons(inarr: xr.DataArray, epsg: int) -> np.ndarray: # type: ignore
def _extract_latlons(inarr: xr.DataArray, epsg: int) -> np.ndarray:
"""
Extracts latitudes and longitudes from the input xarray.DataArray.
Expand Down Expand Up @@ -496,6 +496,9 @@ def nc_to_arrays(
) -> Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray]:
ds = xr.open_dataset(filepath)
epsg = CRS.from_wkt(xr.open_dataset(filepath).crs.attrs["crs_wkt"]).to_epsg()

if epsg is None:
raise ValueError("EPSG code not found in the input file.")
inarr = ds.drop("crs").to_array(dim="bands")

eo_data, mask = cls._extract_eo_data(inarr)
Expand Down

0 comments on commit 8ee5b47

Please sign in to comment.