Skip to content

Commit

Permalink
Bugs 164 165 solved (#166)
Browse files Browse the repository at this point in the history
* fix #165

* fix #164
  • Loading branch information
hcwinsemius authored May 10, 2024
1 parent c4f128e commit 2943a92
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pyorc/api/frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ def project(self, method="cv", resolution=None, **kwargs):
z,
**kwargs
)
# ensure no missing values are persisting
da_proj = da_proj.fillna(0.)
# assign coordinates
da_proj = da_proj.frames._add_xy_coords([xs, ys, lons, lats], coords, const.GEOGRAPHICAL_ATTRS)
if "rgb" in da_proj.dims and len(da_proj.dims) == 4:
Expand Down
8 changes: 7 additions & 1 deletion pyorc/service/velocimetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ def __init__(
"""
if h_a is not None:
recipe["video"]["h_a"] = h_a
# check what projection method is used, use throughout
self.proj_method = "cv"
proj = recipe["frames"].get("project")
if proj:
if proj.get("method") == "numpy":
self.proj_method = "numpy"
self.update = update # set to True when checks are needed if data already exists or not
self.recipe = recipe
self.output = output
Expand Down Expand Up @@ -463,7 +469,7 @@ def plot(self, **plot_recipes):
opts = plot_params["frames"] if plot_params["frames"] is not None else {}
f = self.video_obj.get_frames(method="rgb")
if mode != "camera":
f = f.frames.project()[n]
f = f.frames.project(method=self.proj_method)[n]
else:
f = f[n]
p = f.frames.plot(ax=ax, mode=mode, **opts)
Expand Down

0 comments on commit 2943a92

Please sign in to comment.