-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encode an AreaDefinition into a netCDF/CF file #278
Comments
@sfinkens What do you think about this for a PCW task (for yourself 😉 )? |
Sounds good! But it will have to wait for the next PCW 🙂 |
would appreciate that "feature too |
This is already supported with |
@gerritholl |
I opened this feature request a while ago, and had honestly forgotten about it. @gerritholl 's comment made me think a bit more. I recall how
So the routine I feel would be useful is It returns a new I am aware that the The
Keyworkd A possible workflow would then be:
Ideally, satpy's |
Really? I didn't think it was ever required to have lon/lats. I'm a little torn on the design of this. On one hand it seems really useful and does everything for you. On the other, it does a lot and has complex arguments. What about following pyproj's strategy where Additionally, this makes it easier for someone not using xarray to use a future kwarg |
It is indeed only from CF-1.8 that lat/lon could be omitted in case the coordinate system is fully defined by x, y, crs. cf-convention/cf-conventions#133 I don't have a strong feeling for whether the to_cf() should return individual arrays or a DataSet, but I think many (incl. myself) will use to_cf() to exactly bulid a DataSet / netCDF file, so we could bridge the last mile for them. |
I badly needed this feature for a project I am working on, so I did a prototype. It is fine for me to keep this outside the pyresample repo, but I know I'm going to use this code often, so I wouldn't mind having something similar in. What do people think? |
Isn't the |
Indeed. I was not aware of this. This will simplify the UI. |
Also, I must clarify that this issue started from the bold aim to have the satpy to_cf() writer to use the new code from pyresample to_cf(). But I don't think this is a pre-requisite for moving forward: pyresample could get its to_cf() and we can later consider if satpy should make use of it. But there are some pytroll users that use pyresample without satpy (me!) who would benefit from a pyresample to_cf(). Also, I am not particularly happy with the solution to create an xarray Dataset with a phony variable that the user can drop later (see my prototype linked above), but this is the only way I found so far. Alternative approaches are most welcome. |
I would also be in favor of having an @djhoese how much of these stuffs you already included in geoxarray? Is the plan to make geoxarray a dependency of pyresample/satpy ? |
Hello @ghiggi, this is awesome. I am looking forward to discussing this further when you are back. It sounds like a good idea to first let you finish with your satpy PR, then consider what can be moved to pyresample (also depending on David's answer re: geoxarray). I suggest opening separate issues for the bug you found in load_cf_area() and the other two features you want to add. |
Yep this is the plan. I will open the issues with reproducible examples as soon as I am back ;) |
@ghiggi @TomLav I haven't done anything with geoxarray since its first (0.1) release, but was hoping to start working on it again this week (but things keep popping up) but they wouldn't be this CF work. I could see geoxarray being a good place for this, but... Since |
Hello. Just to mention that I patched my prototype implementation to automatically select the order of the x and y dimentions when creating the xarray Dataset. |
This is the pendant of #269 (where we loaded an AreaDefinition from a netCDF/CF file).
In Pytroll, writing to netCDF/CF files is already covered in
https://github.com/pytroll/satpy/blob/master/satpy/writers/cf_writer.py
I propose to extract the part related to the AreaDefinition in pyresample (utils/_cf.py) so that the read/write logic is contained in one place.
Comments?
The text was updated successfully, but these errors were encountered: