Commit 0bc30207 authored by CEVAER's avatar CEVAER
Browse files

Added flag for polar transformation.

parent 8cde4f03
......@@ -62,10 +62,15 @@ def to_polar(ds, lon_center, lat_center):
lons_polar, lats_polar, baz = geod.fwd(ds.lon.values * 0. + lon_center, ds.lat.values * 0. + lat_center,
coord_theta, coord_rad)
print("bounds", ds.lon.isel(x=0, y=0).item(), ds.lat.isel(x=0, y=0).item(),
ds.lon.isel(x=-1, y=0).item(), ds.lat.isel(x=-1, y=0).item(),
ds.lon.isel(x=-1, y=-1).item(), ds.lat.isel(x=-1, y=-1).item(),
ds.lon.isel(x=0, y=-1).item(), ds.lat.isel(x=0, y=-1).item())
# Computing polar projection for all variables
vars_polar = {}
for var_name in ds.data_vars:
var_polar = cv2.linearPolar(ds[var_name].values, (int(yloc), int(xloc)), max_radius, cv2.INTER_NEAREST)
var_polar = cv2.linearPolar(ds[var_name].values, (int(yloc), int(xloc)), max_radius, cv2.INTER_NEAREST + cv2.WARP_FILL_OUTLIERS)
vars_polar[var_name] = (["theta", "rad"], var_polar)
vars_polar["lon"] = (["theta", "rad"], lons_polar)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment