This is a utility package to enable IO for .nc, .tif, .zmap, .asc grid files or xarray objects
Project description
pygridsio
Introduction
This is a python submodule containing IO 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_gridallows 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_comparisonCreates 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_plotCreates a interactive .html plot using plotly, this saves to a .html file
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pygridsio-0.3.24.tar.gz.
File metadata
- Download URL: pygridsio-0.3.24.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07c0c5dc1353613499ab6f65bc8ad19cde314dc8cc174558f36b21aa6dfe6cd5
|
|
| MD5 |
181caa05ed79053c39a14076c5afe25e
|
|
| BLAKE2b-256 |
232f7945c242f2ee2d52b6c43b7c9b067a069976c1ebd9d4efeef7d470474a82
|
File details
Details for the file pygridsio-0.3.24-py3-none-any.whl.
File metadata
- Download URL: pygridsio-0.3.24-py3-none-any.whl
- Upload date:
- Size: 1.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de53b3c28066f177b4808094a129489047792b90cab59a2ce339591050cd7df1
|
|
| MD5 |
f9780d8db0985d2cf69ec6f9f1f94771
|
|
| BLAKE2b-256 |
7643aa12f3070b772fd33a992c71e52ecf785e65e51610e77127682b7bf53178
|