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.
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"
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
- Antonio Mariani (antonio.mariani@cmcc.it)
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
Built Distribution
File details
Details for the file nccompare-0.2.4.tar.gz
.
File metadata
- Download URL: nccompare-0.2.4.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/6.5.0-1019-oem
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f0443c32aba588a8a48667085b4a2419bafb763057992db87e7bd76b6ee280b |
|
MD5 | c6c6e923ef0ce533de8753f44874f223 |
|
BLAKE2b-256 | 5e28048ee59db2482c7c268b5cc4af44b0bffb78b8bcd11bb53fb3cee8e84000 |
File details
Details for the file nccompare-0.2.4-py3-none-any.whl
.
File metadata
- Download URL: nccompare-0.2.4-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/6.5.0-1019-oem
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ffa77cfa043ce706c1accd3cec671c7887ae09868bfc28af462db09de765f3f |
|
MD5 | 36205ff1c23c423b7f5496ef37dfb4ff |
|
BLAKE2b-256 | beaf5e2a1d14cadcf56f5a6c11756303ba0426f48a5ca665545c0a8bc600ea3a |