Find differences between two NetCDF files
Project description
IPSL-ncdiff
Easy comparison of NetCDF files. Similar to nccmp, recursive_diff/ncdiff, and ncompare, more tools: https://lguez.github.io/Max_diff_nc/other_utils/!
Why another tool?
Each tool for NetCDF comparison that we have analysed, has lacked in some feature which would be appreciated by us: - No structured output (e.g. json, csv, html): nccmp, ncompare - No comparison of partial files (e.g. only 5 days out of 1 year): all tools - No multi-backend (e.g. handling various formats)
| Feature | IPSL-ncdiff | nccmp | recursive_diff/ncdiff | ncompare | cdo diff | nco diff |
|---|---|---|---|---|---|---|
| Time-aware comparison | ||||||
| Partial file comparison | ||||||
| Per-variable tolerance | ||||||
| Various NetCDF versions | ||||||
| Structured output (e.g. json, csv) |
- It semes that ncdiff doesn't support groups/nested variables
How it works?
ipsl-ncdiff compares two NetCDF files on the dataset and variable level. Two dataset might have dissimilar attributes, dimension list or variable list.
On the variable level, two variables might have dissimilar attributes, compression settings, datatype, dimension, shape or value.
The tool tries to analyse both files and display all found differences!
Furthermore, ipsl-ncdiff provides several options changing the comparison and allowing, e.g. to compare variables of different name or shape.
Performed comparisons
- Dataset (file) level
- Global attributes (new or different):
diff_global_attributes - New variables (left or right side):
diff_new_variables
- Global attributes (new or different):
- Variable level:
diff_variable- Attributes (not implemented)
- Dimensions
- Shape
- Datatype
- Values
- Compression
Other operations
- Alignment of dimensions (when dataset is a subset of bigger file, we can still compare it by matching specified dimensions - usually it's time)
Usage
Installation
ipsl-ncdiff is hosted on official PyPI Python package repository. The installation is as easy as typing:
pip install ipsl-ncdiff
Also, you can install the latest version directly from the repository:
Furthermore, generic linux binary is available here:
Using as a tool
ipsl-ncdiff <NETCDF1> <NETCDF2>
Using as a library
In your Python code:
from ipsl_ncdiff.diff import diff, diff_files, diff_datasets
are_equal, differences = diff(Path("<NETCDF1>"), Path("<NETCDF2>"))
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ipsl_ncdiff-0.1.4.tar.gz.
File metadata
- Download URL: ipsl_ncdiff-0.1.4.tar.gz
- Upload date:
- Size: 31.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f07a8df5f8b234a5daa9b6ae42210451e044cd79697f293ee7c5b812526c0db2
|
|
| MD5 |
8788d0be3331afab216648ed7fa71ac0
|
|
| BLAKE2b-256 |
b7be83ee99153f091eb2dda2d6fcf42f7b7892f6b7cbade83f45ad5416a09f5f
|
File details
Details for the file ipsl_ncdiff-0.1.4-py3-none-any.whl.
File metadata
- Download URL: ipsl_ncdiff-0.1.4-py3-none-any.whl
- Upload date:
- Size: 17.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3cabafa38b9a145a854b3cffaa87532c7a13676f5412573cd76f70dc7585387
|
|
| MD5 |
689aed228f016bda61dce797b63e908e
|
|
| BLAKE2b-256 |
61d7267ff30bc71c01a4f3597659b8f81c5c6c54466db52b18f2a9ba76609f98
|