Skip to content

Commit

Permalink
add mention of rectangular grid / proj req. to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ks905383 committed Nov 12, 2024
1 parent 16b7b17 commit 47de3ed
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ Installation
The easiest and recommended way to install :py:mod:`xagg` is through ``conda`` or ``mamba``::

# Mamba
mamba install -c conda-forge xagg==0.3.2.1
mamba install -c conda-forge xagg==0.3.2.4

# Conda
conda install -c conda-forge xagg==0.3.2.1
conda install -c conda-forge xagg==0.3.2.4


``xagg`` can also be installed through ``pip``::
Expand Down
4 changes: 3 additions & 1 deletion docs/source/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ So, whenever we need to work with both gridded and geographic data products, we

Enter :py:mod:`xagg`.

:py:mod:`xagg` provides an easy-to-use (2 lines!), standardized way of aggregating raster data to polygons. All you need is some gridded data in an :class:`xarray.Dataset` or :class:`xarray.DataArray` and some polygon data in a :class:`geopandas.GeoDataFrame`. Both of these are easy to use for the purposes of :py:mod:`xagg` - for example, all you need to use a shapefile is to open it::
:py:mod:`xagg` provides an easy-to-use (2 lines!), standardized way of aggregating raster data on rectangular grids to polygons. All you need is some gridded data in an :class:`xarray.Dataset` or :class:`xarray.DataArray` and some polygon data in a :class:`geopandas.GeoDataFrame`. Both of these are easy to use for the purposes of :py:mod:`xagg` - for example, all you need to use a shapefile is to open it::

import xarray as xr
import geopandas as gpd
Expand Down Expand Up @@ -48,6 +48,8 @@ Finally, :py:mod:`xagg` allows for direct exporting of the aggregated data in se

Best of all, :py:mod:`xagg` is flexible. Multiple variables in your dataset? :py:mod:`xagg` will aggregate them all, as long as they have at least ``lat/lon`` dimensions. Fields in your shapefile that you'd like to keep? :py:mod:`xagg` keeps all fields (for example FIPS codes from county datasets) all the way through the final export. Weird dimension names? :py:mod:`xagg` is trained to recognize all versions of "lat", "Latitude", "Y", "nav_lat", "Latitude_1"... etc. that the author has run into over the years of working with climate data; and this list is easily expandable as a keyword argument if needed.

Note that as of now, polygons must be defined on an equirectangular projection (see `here <https://xagg.readthedocs.io/en/latest/tips.html#indexerrors-in-xa-pixel-overlaps>`_) and raster data must be on a rectangular grid.

How to support :py:mod:`xagg`
=======================================
The easiest way to support :py:mod:`xagg` is to star the `GitHub repository <https://github.com/ks905383/xagg>`_ and spread the word!
Expand Down
4 changes: 4 additions & 0 deletions docs/source/tips.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,9 @@ IndexErrors in :py:meth:`xa.pixel_overlaps`
------------------------------------------------------------
If you're running into an `IndexError` when running :py:meth:`xa.pixel_overlaps` (e.g., `IndexError: too many indices for array: array is 1-dimensional, but 3 were indexed`), try reprojecting the input :py:meth:`geodataframe` to `'EPSG:4326'` before running :py:meth:`xa.pixel_overlaps`. See `here <https://github.com/ks905383/xagg/issues/80>`_ for more discussion on this issue.

Non-rectangular grids
------------------------------------------------------------
:py:mod:`xagg` unfortunately currently only works with rectangular grids.



0 comments on commit 47de3ed

Please sign in to comment.