Skip to content

Commit

Permalink
Merge pull request #62 from earthdaily/dev
Browse files Browse the repository at this point in the history
v0.1.1
  • Loading branch information
nkarasiak authored May 13, 2024
2 parents 22efc64 + 674f182 commit defac59
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions earthdaily/accessor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,17 @@ def _max_time_wrap(self, wish=5, col="time"):
return np.min((wish, self._obj[col].size))

def drop_unfrozen_coords(self, keep_spatial_ref=True):
unfrozen_coords = [coord for coord in self._obj.coords if coord not in list(self._obj.sizes.keys())]
if keep_spatial_ref and 'spatial_ref' in unfrozen_coords:
unfrozen_coords.pop(np.argwhere(np.in1d(unfrozen_coords,'spatial_ref'))[0][0])
unfrozen_coords = [
coord
for coord in self._obj.coords
if coord not in list(self._obj.sizes.keys())
]
if keep_spatial_ref and "spatial_ref" in unfrozen_coords:
unfrozen_coords.pop(
np.argwhere(np.in1d(unfrozen_coords, "spatial_ref"))[0][0]
)
return self._obj.drop(unfrozen_coords)

def plot_rgb(
self,
red: str = "red",
Expand Down Expand Up @@ -295,9 +301,10 @@ def whittaker(
time="time",
):
from . import whittaker

data_crs = self._obj.rio.crs

self._obj = whittaker.xr_wt(
self._obj = whittaker.xr_wt(
self._obj,
lmbd,
time=time,
Expand All @@ -307,10 +314,10 @@ def whittaker(
max_value=max_value,
max_iter=max_iter,
)
self._obj = self._obj.rio.set_crs(data_crs).rio.write_crs(data_crs)
return self._obj

self._obj = self._obj.rio.set_crs(data_crs).rio.write_crs(data_crs)
return self._obj

def zonal_stats(
self,
geometry,
Expand Down

0 comments on commit defac59

Please sign in to comment.