Skip to main content

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

Metadata

Release files for pygridsio 2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygridsio 2.1
File Size Uploaded
pygridsio-2.1.tar.gz 1.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pygridsio 2.1
File Interpreter ABI Platform
pygridsio-2.1-py3-none-any.whl Python 3 none any Details

Total release size: 3.0 MB

Release files / pygridsio-2.1.tar.gz

Download URL pygridsio-2.1.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
bc905662654e294598e09d7aa772d8fb54c08efacd14c255655d41ebbba92074
BLAKE2b-256 checksum
How to use checksums
57fc69dc0810307ac277e2347c1014acc1d25a37e1b517fa024f85b12b0261a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Release files / pygridsio-2.1-py3-none-any.whl

Download URL pygridsio-2.1-py3-none-any.whl
Size 1.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
7974ddb35d9b787593c1857344731a590b6a60b9a133274765d95332b8d8708d
BLAKE2b-256 checksum
How to use checksums
b7327d28224ec7083e6a5bc6e4736fd5d6f843c00c8e0ede00742d6eb823ef1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Release history Release notifications | RSS feed

This release

2.1 This release

2 release files

2.0

2 release files

1.8

2 release files

1.7

2 release files

1.6

2 release files

1.5

2 release files

1.4

2 release files

1.3

2 release files

1.2

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1

2 release files

1.0

2 release files

0.3.26

2 release files

0.3.11

2 release files

0.3.10

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.0

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page