NASA Logo

NTRS

NTRS - NASA Technical Reports Server

Back to Results
ncompare: A Python Package for Comparing netCDF StructuresEarth science researchers and data engineers have a common problem: they often need to compare data files to see what is different between them. A lot of time is spent developing code to test differences. When it comes to comparing multidimensional data file formats like netCDFs (Network Common Data Form), this is particularly challenging and time-consuming, since there is frequently a need to evaluate the differences between dimension sizes, variable structures, and variable attributes, especially for regression testing. Since netCDFs are widely used in Earth science — with climate models, oceanographic or atmospheric reanalyses, and observational data — improved means of evaluating netCDF files can help enable a wide range of applications. We have developed a reusable open source approach through `ncompare`, which is a Python package for comparing netCDF structures [[https://github.com/nasa/ncompare]].

The `ncompare` tool compares the structure of two Network Common Data Form (NetCDF) files at the command line. It facilitates rapid comparisons by generating a formatted display of the matching and non-matching groups, variables, and associated metadata between two NetCDF datasets. The user has the option to colorize the terminal output for ease of viewing, and `ncompare` can optionally save comparison reports in text, comma-separated value (CSV), and/or Microsoft Excel formats. Despite the availability of tools (such as ncmpidiff or nccmp) that compare the values of variables, there was not previously a readily available, Python-based tool for rapid visual comparisons of group and variable structures, attributes, and chunking. `ncompare` was developed at NASA’s Atmospheric Science Data Center (ASDC) and is a collaboration with NASA Openscapes [[https://nasa-openscapes.github.io]] mentors across 11 of NASA’s data centers. Openscapes’ overarching vision is to support scientific researchers using NASA Earthdata as they migrate their workflows to the cloud.


Relevant links:
- https://github.com/nasa/ncompare
- https://github.com/pyOpenSci/software-submission/issues/146
- https://nasa-openscapes.github.io
Document ID
20240008535
Acquisition Source
Langley Research Center
Document Type
Poster
Authors
Daniel Kaufman
(Booz Allen Hamilton (United States) Tysons Corner, United States)
Walter Baskin
(Adnet Systems (United States) Bethesda, Maryland, United States)
Julia Lowndes
(University of California, Santa Barbara Santa Barbara, United States)
Date Acquired
July 3, 2024
Subject Category
Computer Programming and Software
Meeting Information
Meeting: SciPy 2024, Scientific Computing with Python Conference
Location: Tacoma, WA
Country: US
Start Date: July 8, 2024
End Date: July 14, 2024
Sponsors: NumFOCUS
Funding Number(s)
CONTRACT_GRANT: RSES.C3.15.00119
Distribution Limits
Public
Copyright
Portions of document may include copyright protected material.
Technical Review
NASA Peer Committee
No Preview Available