Skip to content

Commit 0824df2

Browse files
authored
Docs cleanup (#518)
* Docs cleanup * More links
1 parent 52160a5 commit 0824df2

9 files changed

+42
-8
lines changed

doc/bounds.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44

55
# Bounds Variables
66

7-
See
8-
7+
```{seealso}
8+
1. [CF conventions on coordinate bounds](http://cfconventions.org/Data/cf-conventions/cf-conventions-1.10/cf-conventions.html#cell-boundaries)
99
1. {py:attr}`Dataset.cf.bounds`,
1010
1. {py:func}`Dataset.cf.add_bounds`,
1111
1. {py:func}`cf_xarray.bounds_to_vertices`,
1212
1. {py:func}`cf_xarray.vertices_to_bounds`
13+
```
1314

1415
`cf_xarray` supports parsing [coordinate bounds](http://cfconventions.org/Data/cf-conventions/cf-conventions-1.10/cf-conventions.html#cell-boundaries) as encoded in the CF `bounds` attribute. A useful feature for incomplete dataset is also the automatic bounds estimation possible through `cf.add_bounds`. This method will estimate the missing bounds by finding the middle points between elements of the given coordinate, but also by extrapolating to find the outer bounds of the grid. This linear estimation works well with rectilinear grids, but it is only a coarse approximation for curvilinear and simple irregular grids.
1516

doc/dsg.md

+5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ xr.set_options(display_expand_data=False)
2323

2424
# Discrete Sampling Geometries
2525

26+
```{seealso}
27+
1. [CF conventions on Discrete Sampling Geometries](http://cfconventions.org/Data/cf-conventions/cf-conventions-1.9/cf-conventions.html#discrete-sampling-geometries)
28+
1. {py:attr}`Dataset.cf.cf_roles`
29+
```
30+
2631
`cf_xarray` supports identifying variables by the [`cf_role` attribute](http://cfconventions.org/Data/cf-conventions/cf-conventions-1.9/cf-conventions.html#discrete-sampling-geometries).
2732

2833
```{code-cell}

doc/flags.md

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ kernelspec:
1515

1616
# Flag Variables
1717

18+
```{seealso}
19+
1. [CF conventions on flag variables and masks](http://cfconventions.org/Data/cf-conventions/cf-conventions-1.8/cf-conventions.html#flags)
20+
```
21+
1822
`cf_xarray` has some support for [flag variables](http://cfconventions.org/Data/cf-conventions/cf-conventions-1.8/cf-conventions.html#flags), including flag masks.
1923

2024
## Flag Values

doc/geometry.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ cfxr.cf_to_shapely(ds_cf)
8888
```
8989

9090
This conversion adds coordinates that aren't in the `xr.DataArray` that we started with.
91-
By default these are called `crd_x` and `crd_y` unless `grid_mapping` is specified.
91+
By default these are called `'crd_x'` and `'crd_y'` unless `grid_mapping` is specified.
9292

9393
## Gotchas
9494

doc/grid_mappings.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ kernelspec:
1313

1414
# Grid Mappings
1515

16-
See
17-
18-
1. {py:attr}`Dataset.cf.grid_mapping_names`,
16+
```{seealso}
17+
1. [CF conventions on grid mappings and projections](https://cfconventions.org/Data/cf-conventions/cf-conventions-1.10/cf-conventions.html#grid-mappings-and-projections)
18+
1. {py:attr}`Dataset.cf.grid_mapping_names`
1919
1. {py:attr}`DataArray.cf.grid_mapping_name`
20+
```
2021

2122
`cf_xarray` understands the concept of coordinate projections using the [grid_mapping](https://cfconventions.org/Data/cf-conventions/cf-conventions-1.10/cf-conventions.html#grid-mappings-and-projections) attribute convention. For example, the dataset might contain two sets of coordinates:
2223

doc/parametricz.md

+6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ xr.set_options(display_expand_data=False)
2222

2323
# Parametric Vertical Coordinates
2424

25+
```{seealso}
26+
1. [CF conventions on parametric vertical coordinates](http://cfconventions.org/Data/cf-conventions/cf-conventions-1.8/cf-conventions.html#parametric-vertical-coordinate)
27+
2. {py:meth}`Dataset.cf.decode_vertical_coords`
28+
3. {py:attr}`Dataset.cf.formula_terms`
29+
```
30+
2531
`cf_xarray` supports decoding [parametric vertical coordinates](http://cfconventions.org/Data/cf-conventions/cf-conventions-1.8/cf-conventions.html#parametric-vertical-coordinate) encoded in the `formula_terms` attribute using {py:meth}`Dataset.cf.decode_vertical_coords`. Right now, only the two ocean s-coordinates and `ocean_sigma_coordinate` are supported, but support for the [rest](http://cfconventions.org/Data/cf-conventions/cf-conventions-1.8/cf-conventions.html#parametric-v-coord) should be easy to add (Pull Requests are very welcome!).
2632

2733
## Decoding parametric coordinates

doc/selecting.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@ xr.set_options(display_expand_data=False)
2222

2323
# Selecting DataArrays
2424

25-
A second powerful feature of `cf_xarray` is the ability select DataArrays using special "CF names" like the "latitude", or "longitude" coordinate names, "X" or "Y" axes names, oreven using the `standard_name` attribute if present.
25+
```{seealso}
26+
CF conventions on
27+
1. [coordinate variables](http://cfconventions.org/Data/cf-conventions/cf-conventions-1.8/cf-conventions.html#coordinate-types)
28+
1. [cell bounds and measures](http://cfconventions.org/Data/cf-conventions/cf-conventions-1.8/cf-conventions.html#_data_representative_of_cells)
29+
1. [standard name](http://cfconventions.org/Data/cf-conventions/cf-conventions-1.8/cf-conventions.html#standard-name)
30+
1. [ancillary data](http://cfconventions.org/Data/cf-conventions/cf-conventions-1.8/cf-conventions.html#ancillary-data)
31+
```
32+
33+
A powerful feature of `cf_xarray` is the ability select DataArrays using special "CF names" like the "latitude", or "longitude" coordinate names, "X" or "Y" axes names, oreven using the `standard_name` attribute if present.
2634

2735
To demonstrate this, let's load a few datasets
2836

doc/sgrid_ugrid.md

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ kernelspec:
99

1010
# SGRID / UGRID
1111

12+
```{seealso}
13+
1. [SGRID conventions](https://sgrid.github.io/sgrid/)
14+
1. [UGRID conventions](http://ugrid-conventions.github.io/ugrid-conventions/)
15+
```
16+
1217
## SGRID
1318

1419
`cf_xarray` can parse the attributes on the `grid_topology` variable to identify dimension names with axes names `X`, `Y`, `Z`.

doc/units.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ hide-toc: true
1010

1111
# Units
1212

13+
```{seealso}
14+
1. [CF conventions on units](http://cfconventions.org/Data/cf-conventions/cf-conventions-1.8/cf-conventions.html#units)
15+
```
16+
1317
The xarray ecosystem supports unit-aware arrays using [pint](https://pint.readthedocs.io) and [pint-xarray](https://pint-xarray.readthedocs.io). Some changes are required to make these packages work well with [UDUNITS format recommended by the CF conventions](http://cfconventions.org/Data/cf-conventions/cf-conventions-1.8/cf-conventions.html#units).
1418

15-
`cf_xarray` makes those recommended changes when you `import cf_xarray.units`. These changes allow pint to parse and format UDUNIT units strings, and add several custom units like `degrees_north`, `psu` etc.
19+
`cf_xarray` makes those recommended changes when you `import cf_xarray.units`. These changes allow pint to parse and format UDUNIT units strings, and add several custom units like `degrees_north` for latitude, `psu` for ocean salinity, etc.
1620

1721
## Formatting units
1822

0 commit comments

Comments
 (0)