Skip to main content

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
  • 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipsl_ncdiff-0.1.4.tar.gz (31.4 kB view details)

Uploaded Source

Built Distribution

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

ipsl_ncdiff-0.1.4-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

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

Hashes for ipsl_ncdiff-0.1.4.tar.gz
Algorithm Hash digest
SHA256 f07a8df5f8b234a5daa9b6ae42210451e044cd79697f293ee7c5b812526c0db2
MD5 8788d0be3331afab216648ed7fa71ac0
BLAKE2b-256 b7be83ee99153f091eb2dda2d6fcf42f7b7892f6b7cbade83f45ad5416a09f5f

See more details on using hashes here.

File details

Details for the file ipsl_ncdiff-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for ipsl_ncdiff-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b3cabafa38b9a145a854b3cffaa87532c7a13676f5412573cd76f70dc7585387
MD5 689aed228f016bda61dce797b63e908e
BLAKE2b-256 61d7267ff30bc71c01a4f3597659b8f81c5c6c54466db52b18f2a9ba76609f98

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