Metadata-Version: 2.4
Name: pygridsio
Version: 1.1.1
Summary: This is a utility package to enable IO and plotting for .nc, .tif, .zmap, .asc grid files or xarray objects
Author-email: Hen Brett <hen.brett@tno.nl>
License: 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.
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: pykrige
Requires-Dist: xarray
Requires-Dist: rioxarray
Requires-Dist: netCDF4
Requires-Dist: plotly
Requires-Dist: geopandas
Requires-Dist: matplotlib
Requires-Dist: contextily
Dynamic: license-file

# pygridsio

## Introduction

This is a python submodule containing IO and plotting functionality for reading and writing .asc, .zmap .nc and .tif grids.

## Installation

pygridsio is available via the pypi package registry:

`pip install pygridsio`

## Usage

`from pygridsio import *`

The standard grid class used throughout this project is a Xarray DataArray (see: https://xarray.dev/) with 2 dimensions: x and y.

To read a grid file to this class use:

`grid = read_grid(filename)`

You can write a grid to .asc, .zmap, .nc or .tif using the following method:

`write_grid(grid,filename)`

The code will discern which filetype to write out to by the file extension in filename. Note: .asc and .zmap are ascii based files and take up a lot of space. .nc and .tif are binary file types.

There is some plotting functionality implemented in pygridsio, this can be accessed using the `pygridsio.grid_plotting` module:
- The method `pygridsio.grid_plotting.plot_grid` allows you to plot a custom Grid class, or xr.DataArray with multiple options. See the description of the method for more detail.
- The method `pygridsio.grid_plotting.plot_grid_comparison` Creates a plot comparing two grids values against each other. See the description of the method for more detail.
- The method `pygridsio.grid_plotting.make_interactive_plot` Creates a interactive .html plot using plotly, this saves to a .html file
