Metadata-Version: 2.1
Name: focal_stats
Version: 0.1.0
Author-email: Jasper Roebroek <roebroek.jasper@gmail.com>
License: MIT License
        
        Copyright (c) 2021 Jasper Roebroek
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: repository, https://github.com/jasperroebroek/focal-stats
Project-URL: documentation, https://focal-stats.readthedocs.io/en/latest/index.html
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: numpydantic
Requires-Dist: joblib
Requires-Dist: pandas
Provides-Extra: documentation
Requires-Dist: sphinx; extra == "documentation"
Requires-Dist: sphinx_rtd_theme; extra == "documentation"
Requires-Dist: numpydoc; extra == "documentation"
Requires-Dist: jupyter; extra == "documentation"
Requires-Dist: matplotlib; extra == "documentation"
Provides-Extra: develop
Requires-Dist: cython; extra == "develop"
Requires-Dist: sphinx; extra == "develop"
Requires-Dist: sphinx_rtd_theme; extra == "develop"
Requires-Dist: numpydoc; extra == "develop"
Requires-Dist: scipy; extra == "develop"
Requires-Dist: jupyter; extra == "develop"
Requires-Dist: matplotlib; extra == "develop"
Requires-Dist: pytest; extra == "develop"
Requires-Dist: joblib; extra == "develop"
Requires-Dist: statsmodels; extra == "develop"
Provides-Extra: test
Requires-Dist: scipy; extra == "test"
Requires-Dist: pytest; extra == "test"
Requires-Dist: statsmodels; extra == "test"

[![Documentation Status](https://readthedocs.org/projects/focal-stats/badge/?version=latest)](https://focal-stats.readthedocs.io/en/latest/?badge=latest)

This module aims to provide focal statistics for python, that runs without the installation of extensive GIS packages. 
It is mainly based on numpy. For more details see the documentation.

The package implements three different categories of spatial statistics:
- focal statistics, which are calculated as a moving window over input rasters
- grouped statistics, which calculates the statistics based on strata
- strata statistics, which calculates the statistics for each stratum and reapplies it to the input raster

Furthermore, this package provides functionality to implement your own focal statistics functions, based on the 
mechanisms of a rolling window.

# Installation

The package can be installed with conda:

```
conda install --channel conda-forge focal-stats
```

# Usage example

Focal mean of a 100x100 random numpy array.

```
from focal_stats import focal_mean
import numpy as np

x = np.random.rand(100, 100)
fm = focal_mean(x, window_size=5)
```

# Important links

- API reference: https://focal-stats.readthedocs.io/en/latest/api.html
- Documentation: https://focal-stats.readthedocs.io/en/latest/index.html
