-
Notifications
You must be signed in to change notification settings - Fork 12
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
[DOC] Add CDAT API mapping table and gallery examples #239
Conversation
Codecov Report
@@ Coverage Diff @@
## main #239 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 9 8 -1
Lines 742 721 -21
=========================================
- Hits 742 721 -21
Continue to review full report at Codecov.
|
3dfc560
to
58633cb
Compare
docs/api.rst
Outdated
``cf_xarray`` for interpreting CF-compliant attributes | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
``xcdat`` leverages ``cf_xarray`` for interpreting CF-compliant attributes (``.attrs``) present on ``xarray.DataArray`` or ``xarray.Dataset`` objects. | ||
|
||
.. pull-quote:: | ||
One powerful feature of ``cf_xarray`` is the ability to refer to named dimensions by standard ``axis`` or ``coordinate`` names in Dataset or DataArray methods. | ||
|
||
-- https://cf-xarray.readthedocs.io/en/latest/coord_axes.html#axes-and-coordinates: | ||
|
||
.. code-block:: python | ||
|
||
from cf_xarray.datasets import airds | ||
|
||
airds.cf | ||
|
||
Coordinates: | ||
- CF Axes: * X: ['lon'] | ||
* Y: ['lat'] | ||
* T: ['time'] | ||
Z: n/a | ||
|
||
- CF Coordinates: * longitude: ['lon'] | ||
* latitude: ['lat'] | ||
* time: ['time'] | ||
vertical: n/a | ||
|
||
- Cell Measures: area: ['cell_area'] | ||
volume: n/a | ||
|
||
- Standard Names: * latitude: ['lat'] | ||
* longitude: ['lon'] | ||
* time: ['time'] | ||
|
||
- Bounds: n/a | ||
|
||
Data Variables: | ||
- Cell Measures: area, volume: n/a | ||
|
||
- Standard Names: air_temperature: ['air'] | ||
|
||
- Bounds: n/a | ||
|
||
|
||
.. list-table:: | ||
:widths: 20 40 40 | ||
:header-rows: 1 | ||
|
||
* - How do I... | ||
- cf_xarray | ||
- CDAT | ||
* - Get latitude coordinates (Y axis)? | ||
- ``Dataset.cf["Y"]``, ``Dataset.cf["lat"]``, or ``Dataset.cf["latitude"]`` | ||
- ``TransientVariable.getLatitude()`` | ||
* - Get longitude coordinates (X axis)? | ||
- ``Dataset.cf["X"]``, ``Dataset.cf["lon"]``, or ``Dataset.cf["longitude"]`` | ||
- ``TransientVariable.getLongitude()`` | ||
* - Get time coordinates (T axis)? | ||
- ``Dataset.cf["T"]`` or ``Dataset.cf["time"]`` | ||
- ``TransientVariable.getTime()`` | ||
* - Get vertical coordinates (Z axis)? | ||
- ``Dataset.cf["Z"]`` | ||
- ``TransientVariable.getLevel()`` |
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.
Hi @durack1, let me know how this looks based on your suggestion from a previous comment.
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.
On second thought, this information might be best placed in another repo (e.g., xcdat_utils
) since the APIs here aren't from xCDAT.
b3b4289
to
6f674b7
Compare
Hi @pochedls and @lee1043, whenever you have time, it would be nice to have reviewers for the Jupyter Notebooks used as gallery examples. I provided links to a preview build of the docs, so hopefully the review process is smooth. |
@tomvothecoder this is really great, thank you for adding this suite of documents.
|
Thanks for the feedback @lee1043!
Your suggestion makes sense to me. I'll try using daily and 3-hr inputs for those
I noticed that sub-setting for Niño 3.4 was done with
Do you know why there might be a discrepancy with those region values and the ones defined by NCAR? |
dd72931
to
36bfc69
Compare
@tomvothecoder thanks for your reply.
170W-120W is actually equivalent to 190-240 from the 0-360 longitude range. 170W indicates 170 degree westward from 0 (=360), thus 360-170=190. Likewise, 120W = 360-120 = 240. In the current notebook, cell [9] is:
which is need to be replaced by
In above
|
This looks great - thanks Tom! general-utilities
Calculate Geospatial Weighted Averages from Monthly Time Series
|
Thanks @lee1043 and @pochedls, both of your feedback is helpful. I'll apply your fixes and suggestions!
Nice catch, and I'll need to dig deeper in this issue. Maybe we need to add a catch for cases where the user attempts to convert their longitude axis to the same system (e.g.,
That's a great suggestion, thanks for providing the summaries!
I agree, we can have general details over how the spatial averaging works. We can leave out some of the lower-level details (e.g., how weights are generated for each axis) since they user can go directly to the method docstrings for that information if they are interested. I can see the verbosity of the lower-level info possibly being overwhelming for users. |
Some suggested text for Overview in the Calculate Geospatial Weighted Averages from Monthly Time Series Gallery entry:
Let me know if you think this has too little detail. |
- Add `nbsphinx` and `pandoc` to conda-env dependencies
- Info was pulled from docstrings
63ef750
to
40ec05e
Compare
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.
Additional doc updates
Looks good to me. I implemented your changes. I will do a final review and merge. |
Description
Preview of API Reference Page: https://xcdat.readthedocs.io/en/docs-238-tutorials/api.html#cdat-mapping-table
Preview of Gallery: https://xcdat.readthedocs.io/en/docs-238-tutorials/gallery.html
Summary of Changes
Checklist
If applicable: