-
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
add a from_cf() mechanism for AreaDefinition #269
Comments
This is an example of how I implemented something similar outside pyresample. The from_cf() should be more robust, and guess the name of the grid_mapping information.
|
I like the idea of this feature. I think the design will have to depend heavily on what the end goal is. It would be best if we split this in to multiple functions that handle various levels of the problem. That said, are you against an xarray dependency? It may make some of this easier to write. Here is what a CF compliant NetCDF file typically looks like when it has CRS information provided:
I think at the highest level, the function needs to allow the user to specify a particular variable. If not provided then the function can search through every variable that has a The other optional keyword argument is what the names of the dimensions are to look at. In the above example the
I think it is important that this function doesn't magically find the variables/attributes in the file. It should be based on the CF standard with maybe some common conventions that aren't CF. This high-level function should be just one interface too. If an xarray dependency is OK then I feel like the function should take an xarray Dataset (or maybe DataArray). This could even be made in to an xarray accessor so you could do This is all my opinion. I'm open to discussion and other solutions. |
Thanks David. I agree with all you write above. I would try and develop the routine first without the xarray dependency, and then wrap it into something xarray, would that work? (I don't know xarray so I'll need some help :). I think I'd like first to collect several/many "minimal" netCDF/CF example files in advance in a test suite. Did you see my comment about #264, and do you think it interferes? I'll give this a try during PCW. How to I move this issue to the PCW issue board? |
I added it to the project for you. I think for you to do it you have to go to the project page and add it there. I don't remember. As for #264. No this should only change the internals of the AreaDefinition. It should actually make this issue easier as you should now be able to pass a
|
In progress here: https://github.com/TomLav/pyresample/tree/feature-areadef-from-cf |
Once you make a PR then you can mention this issue and it'll make the changes easier to review. Thanks for working on this. |
We would like to get AreaDefinition objects directly initialized from a netCDF/CF file.
The user should be able to point the from_cf() to an existing netCDF/CF file (e.g. a forecast model file), and in return get an areadef object. Then he/she can resample other data (e.g. satellite swath) on that area. This is a new way of building an areadef, and does not touch upon the resampling methods.
Some initial notes:
It is not clear how implementation of #264 affects the implementation of this feature, and if one must come first.
The text was updated successfully, but these errors were encountered: