ncompare: A Python package for comparing netCDF structures

Daniel E. Kaufman, Walter E. Baskin · The Journal of Open Source Software · 2024

ncompare compares the structure of two Network Common Data Form (netCDF) files at the command line, thus providing rapid and human-readable evaluation of netCDF pairs.The essential inputs to ncompare are the filepaths of two netCDF datasets, and the output is a report that automatically aligns and highlights differences between the matching and non-matching groups, variables, and associated metadata (e.g., dimension lengths, attributes, chunking).The user is provided the option to colorize the terminal output for ease of viewing, to save comparison reports in text, comma-separated value (CSV), and/or Microsoft Excel formats, and to compare values for a particular variable of interest.ncompare is written using the Python programming language (Python Core Team, 2015;Van Rossum & Drake, 2009).To use ncompare, it can be given input from a command line interface (CLI), or its functions can be called directly from within a running Python kernel.The order of operations proceeds through these steps: comparing root-level dimensions, groups, structure and values of an optional user-specified group/variable, and finally all the variables in each group.

Read the paper · More papers on PaperTik