From 47de3ed63182a05bd802f7fe5f9e0574d7b6b463 Mon Sep 17 00:00:00 2001 From: Kevin Schwarzwald Date: Tue, 12 Nov 2024 14:26:39 -0500 Subject: [PATCH] add mention of rectangular grid / proj req. to docs --- docs/source/installation.rst | 4 ++-- docs/source/intro.rst | 4 +++- docs/source/tips.rst | 4 ++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 08482ad..7b74791 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -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``:: diff --git a/docs/source/intro.rst b/docs/source/intro.rst index 1f9f356..b17d5c9 100644 --- a/docs/source/intro.rst +++ b/docs/source/intro.rst @@ -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 @@ -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 `_) 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 `_ and spread the word! diff --git a/docs/source/tips.rst b/docs/source/tips.rst index 3d5bf9f..fecce28 100644 --- a/docs/source/tips.rst +++ b/docs/source/tips.rst @@ -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 `_ for more discussion on this issue. +Non-rectangular grids +------------------------------------------------------------ +:py:mod:`xagg` unfortunately currently only works with rectangular grids. +