Skip to main content

This is a utility package to enable IO and plotting for .nc, .tif, .zmap, .asc grid files or xarray objects

Project description

pygridsio

Introduction

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

Read the documentation here

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

Documentation

This repository now includes an MkDocs site under docs/ with usage guides and API reference pages.

To preview it locally after installing the docs dependencies:

  • pip install -e .[docs]
  • mkdocs serve

If you use Pixi, you can also run:

  • pixi run docs-serve
  • pixi run docs-build

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygridsio-1.1.4.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pygridsio-1.1.4-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file pygridsio-1.1.4.tar.gz.

File metadata

  • Download URL: pygridsio-1.1.4.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

Hashes for pygridsio-1.1.4.tar.gz
Algorithm Hash digest
SHA256 cf295a894635a0285aa945e841ab64d2e0178b7cc009c7f0895a2473d1cf4c31
MD5 5b54084dee5a877b1a394ca20d696f82
BLAKE2b-256 0ba07ad46a7ee4c0bd8ea39485e44c3ac58dd3a35e26c51c9d3bc9caa8916905

See more details on using hashes here.

File details

Details for the file pygridsio-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: pygridsio-1.1.4-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

Hashes for pygridsio-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 198187dd168864dc5d00b71e195c0ab13565ea5d7f6cf313882bcf70b4adcc27
MD5 fd1499c04652e4128df9be65e1ddd9eb
BLAKE2b-256 63943a59cd444e8ecdec0243c5612a5fbe34099042c98d29b4511370c653ffd2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page