Skip to main content

ncgrow

To grow/extend masked fields so they extend into the mask. Developed mainly to extend ocean data with a land-sea mask either after regridding or for visualization. The script computes weights and indices iteratively and then applies them

Installation

ncgrow can be installed after downloading this repository by running:

python3 setup.py install [--user]

It can also be installed directly from the Python Packaging Index (PyPI) by running:

pip3 install ncgrow

Development

Packaging

Create distribution:

python3 setup.py sdist bdist_wheel

After that the package can be uploaded to PyPI.

Usage

The ncgrow script has the following usage.

usage: ncgrow [-h] [-v [..]] [-d [..]] [-m [..]] [--maskfile filename]
              [--smooth [..]] [--fill [..]] [-i [..]] [--niter_chunks [..]]
              [-c [..]] [-O] [-V] [--version]
              infile outfile

Grow/extend and/or fill masked fields.

positional arguments:
 infile                path to source file.
 outfile               filename of the output file.

optional arguments:
 -h, --help            show this help message and exit
 -v [..], --variables [..]
                       list of variables to extend, e.g. -v temp,elev.
 -d [..], --dims [..]  Dimension subset, e.g. -d level,1,10,2
 -m [..], --maskvar [..]
                       Variable name for land-sea mask that will be the
                       enforced.
 --maskfile filename   External file containing mask variable(s), i.e.
                       maskvar. Will be used before infile in case maskvar is
                       present in both.
 --smooth [..]         Smooth grown cells to avoid unphysical values. Can
                       also be specified per variable, e.g. --smooth
                       True,temp, --smooth False,ice. default is True.
 --fill [..]           Default value to apply to any cells that are not
                       missing_value or Fillvalue in maskvar. Will be ignored
                       if --maskvar is not set. Optionally one can select
                       'max' 'min', 'mean' of variable or None. Can also be
                       specified per variable, e.g. --fill mean, temp, --fill
                       0,ice.
 -i [..], --iterations [..]
                       Number of iterations to use, corresponds to one land
                       cell per iteration. optionally with variable name
                       appended, e.g. -i 2,temp,elev. Multiple defintions
                       possible for granulated control.
 --niter_chunks [..]   Maximum number of iterations to hold in memory. Will
                       reduce performance, but enable larger dataset and
                       number of iterations. Optionally with variable name
                       appended. Multiple defintions possible for granulated
                       control. Default is 5.
 -c [..], --converge [..]
                       Converge towards a given value 'V' with a factor f =
                       [0-1] (default = 1). If not set no convergence is
                       applied. e.g. -c 0,0.25,ice. Multiple defintions
                       possible for granulated control.
 -O, --overwrite       Overwrite output file if it exist (or append to input
                       file).
 -V, --verbose         Increase runtime information.
 --version             show program's version number and exit

Release files for ncgrow 1.6.10

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

Source distribution (sdist)

Source distribution for ncgrow 1.6.10
File Size Uploaded
ncgrow-1.6.10.tar.gz 16.0 kB Details

Built distribution (wheel)

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

Total release size: 37.9 kB

Release files / ncgrow-1.6.10.tar.gz

Download URL ncgrow-1.6.10.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
edb9b2caa19fcdfab69f7c525c207cc248bd4b0fb708df703413cd7be9991114
BLAKE2b-256 checksum
How to use checksums
3e6569d7d4aacad261666b3061e7bed48aacd91140b11990bb8cb7949fa5b39d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

Release files / ncgrow-1.6.10-py3-none-any.whl

Download URL ncgrow-1.6.10-py3-none-any.whl
Size 21.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ef3fcc124fce304318d5a5c6e46b731f7555c305a95b28ebe431505176eb3db
BLAKE2b-256 checksum
How to use checksums
5341f4edf2f5d62eea460f17ec1b2e302a57ea01850f84c711a46b460c03f35e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

Release history Release notifications | RSS feed

This release

1.6.10 This release

2 release files

1.6.9

2 release files

1.6.8

2 release files

1.6.6

2 release files

1.6.5

2 release files

1.6.4

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