Skip to content

Conversation

@ChrisJohnNOAA
Copy link
Contributor

No description provided.

@ChrisJohnNOAA ChrisJohnNOAA merged commit eb5b737 into ERDDAP:main Jan 30, 2026
@ChrisJohnNOAA ChrisJohnNOAA deleted the xarray_tips branch January 30, 2026 21:47
@ocefpaf
Copy link

ocefpaf commented Jan 30, 2026

@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.

@ChrisJohnNOAA
Copy link
Contributor Author

@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.
Copy link

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).

Copy link
Contributor Author

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.

Copy link

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated here: #56 56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants