Skip to main content

netCDF Comparison Tool

Project description

netCDF Diff Comparison tool - ncpare

ncpare is a tool for comparing netCDF files, providing a detailed diff of their contents. It is designed to help users identify differences between datasets stored in netCDF format.

Python Anaconda Pip netcdf4 xarray rich Tests

Output

Installation

Via PIP

pip install nccompare

Usage

ncpare [-h] [-f--filter FILTER_NAME] [--common_pattern COMMON_PATTERN] [--variables VARIABLES [VARIABLES ...]] [--last_time_step] [-V] folder1 folder2

netCDF Comparison Tool

positional arguments:
  folder1               Path of first folder to compare
  folder2               Path of second folder to compare

options:
  -h, --help            show this help message and exit
  -f--filter FILTER_NAME
                        Filter to select files to compare. Examples: *.nc, *_grid_*
  --common_pattern COMMON_PATTERN
                        Common file pattern in two files to compareEs mfsX_date.nc and expX_date.nc -> date.nc is the common part
  -v, --variables VARIABLES [VARIABLES ...]
                        Variable to compare
  --last_time_step      If True, compare only the last time step available in each file
  -V, --version         Print version and exit

Select Variables

It is possible to choose which parameter to compare:

ncpare folder1 folder2 -v "votemper" "vosaline"

Variables

Filter files

As default ncpare read iterate over all files in folder1 and expect to find them in folder2. Using filters, it is possible to select only a subset of input files. For example:

ncpare folder1 folder2 -f "*_grid_T.nc"

Compare files with different filenames

It is possible to compare two files also if the filenames are slightly different if they have a common pattern. For example, if we have:

  • a/my-simu_19820101_grid_T.nc
  • b/another-exp_19820101_grid_T.nc

It is still possible to compare the file with:

ncpare folder1 folder2 --commom-pattern ".+_19820101_grid_T.nc"

Notice the regex syntax .+ to match any pattern before _19820101

Author

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

Contact

For any questions or suggestions, please open an issue on the project's GitHub repository.

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

nccompare-0.2.5.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

nccompare-0.2.5-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file nccompare-0.2.5.tar.gz.

File metadata

  • Download URL: nccompare-0.2.5.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/6.14.0-27-generic

File hashes

Hashes for nccompare-0.2.5.tar.gz
Algorithm Hash digest
SHA256 75aabe4d2ec010ecd9da273181e1b84b1012ceb882a1c6975df13787ca7f95c6
MD5 0864cbc34c1f737745604e31a61a4794
BLAKE2b-256 e53dc9d24310502eaeb79e9a2d2d6d88eae5bd44d34b16abc79983bc352a55dc

See more details on using hashes here.

File details

Details for the file nccompare-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: nccompare-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/6.14.0-27-generic

File hashes

Hashes for nccompare-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 49eba5413ad7b30f925f6f6b055720fec9e2fbd83739f45e0a2abb1136814cdf
MD5 2be3ae1b863949f88510b29ba27051fc
BLAKE2b-256 cc7182e12c7213a781a044ddf89ce3b4c5f0fc59964b4c6e65c8ce7c8860ccd4

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