Comments (8)
Using something like xr.set_options(keep_attrs=True)
might get the behavior we need from xesmf
. I'm not sure though. I'm not up to date on attrs behavior in xarray
.
from dodola.
It looks like what we need is keep_attrs=True
in the call to the xesmf regridder. The default is false for some reason.
e.g.
Line 381 in 0683271
if astype:
return regridder(x, keep_attrs=True).astype(astype)
return regridder(x)
from dodola.
@dgergel I think that's for the old xesmf
from a few years back and not the pangeo-supported fork...?
Edit: My rough fix for getting attrs merged from ds
to out_ds
has been
out_ds.attrs |= ds.attrs
for k, v in ds.variables.items():
if k in out_ds:
out_ds[k].attrs |= v.attrs
from dodola.
@brews I took a look at the source code for the pangeo-supported fork of xesmf and it still has that keep_attrs=True
option in applying the regridder (and the default is false), see here: https://github.com/pangeo-data/xESMF/blob/fa07fa6a7d382c8298261170e4e9df894d8f7cb6/xesmf/frontend.py#L382
from dodola.
@dgergel Huh! You're right! I'll see if that arg does the trick. Thanks.
from dodola.
@brews we fixed this, correct? So we can go ahead and close?
from dodola.
@dgergel good question. It's a bit of a stale issue but I say we should keep this open. Right now we have a hackish workaround. It works but I'd like to try the solution you recommend before we close this.
from dodola.
Got it - let's keep it open for now then.
from dodola.
Related Issues (20)
- Refactor `dodola regrid --cyclic` into new `dodola add-cyclic` HOT 2
- add AIQPD downscaling method adjust test HOT 1
- add multiplicative test for AIQPD method HOT 1
- update QDM in AIQPD test to use core functions HOT 1
- Pin ClimateImpactLab/xclim to single commit hash or tag HOT 1
- update precip units in cmip6 cleanup to be pint-compatible HOT 9
- dodola validate-dataset reads in entire zarr store? HOT 1
- update all analog-downscaling code names to new method name, QPLAD HOT 1
- update time check in dodola validate HOT 3
- Remove excess unit conversion logging to INFO from dodola.service HOT 4
- xclim_convert_360day_calendar_interpolate does not support data chunked across time
- wet-day frequency correction uses only one value for each 'dry' data point
- correct-wetday-frequency casts all output to float64 HOT 1
- dodola.services.get_attrs() is missing logging.
- Test that `dodola.services.validate` actually fails bad data
- Validation checks should throw new ValidationFailed-like, not AssertionError HOT 1
- Clean up container build, swap to mambaorg/micromamba
- Add label for code source to container images HOT 1
- Unit tests are very very slow
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dodola.