-
Notifications
You must be signed in to change notification settings - Fork 8
New page for user tips using xarray #52
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
Conversation
|
@ChrisJohnNOAA I'm working on a ERDDAP engine for xarray that could simplify this a little bit: https://gist.github.com/ocefpaf/ed3bf52e3314b8390377e779c52cc7ae It is just a draft for now and I still recommend the "OpeNDAP" way for most people, but sometimes it is more convenient to just use the sliced ERDDAP URL. |
That'd be great! I'm happy to include it when it's ready. Either make a pull request at that time or let me know and I can integrate it. |
| @@ -0,0 +1,81 @@ | |||
| Thanks to Roy Mendelssohn for this write up. | |||
|
|
|||
| The Python package 'xarray' has become very popular for accessing, subsetting and visualizing gridded data in a variety of formats. 'xarray' works fine with ERDDAP™ once you understand how to use it properly. I would point out that the Python package 'erddapy' (https://github.com/ioos/erddapy) can access data from ERDDAP™ servers using both 'griddap' and 'tabledap', while 'xarray' is limited to gridded data, and 'erddapy' can export the data for 'xarray'. But if you are accustomed to using 'xarray' and have workflows using the package, then it can be desirable to just work within the single package. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Saying that xarray is limited to gridded dataset is not accurate. Xarray has many engines and any engine that can opens OPeNDAP can open the opendap response (the erddap URL + the dataset_id, no slices/selections). TL;DR tabledap will work in xarray in the same fashion as the griddap example below. (What I don't know if the data /coords are eargerly downloaded or not for the tabledap case, they are not for the griddap case for sure).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would changing it to the following be good?
I would point out that the Python package 'erddapy' (https://github.com/ioos/erddapy) can access data from ERDDAP™ servers using both 'griddap' and 'tabledap', and 'erddapy' can export the data for 'xarray'. But if you are accustomed to using 'xarray' and have workflows using the package, then it can be desirable to just work within the single package. The below is an example with a 'griddap' dataset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that!
Maybe the fact that any ERDDAP URL without slicing or filters, just the datasetID, behaves like an OPeNDAP URL -- and that is fine fie for xarray -- could be more explicit? This information is implicit in the example though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated here: #56 56
No description provided.