CASPER – CSV Automation Service for Processing & Easy Retrieval
CASPER is a Python package that converts NetCDF (.nc, .h5) files to one or more CSV files based on the dimensional schema in the NetCDF file.
Using xarray, CASPER obtains the dimensions identified in the NetCDF file and groups variables by the dimensional schema, then outputs each dimensional schema in a separate CSV file.
- Follow the instructions for installing
uvhere. - Install
casper, with its dependencies, by running the following from the repository directory:
uv syncFor example:
uv run casper TEMPO_NO2_L2_V04_S009G07.ncFor example (note that these are pseudo-real, not actual, TEMPO file names):
casper TEMPO_NO2_L2_V04_S009G07.ncOutput:
Zip file TEMPO_NO2_L2_V04_S009G07.zip including csv files:
TEMPO_NO2_L2_V04_S009G07-0.csv, → dimension schema 1 (ie, dimensions ('mirror_step', 'xtrack', 'corner'))TEMPO_NO2_L2_V04_S009G07-1.csv, → dimension schema 2 (ie, dimensions('mirror_step', 'xtrack', 'swt_level'))
- Reads NetCDF files and groups the data by shared dimensions and creates a CSV file for each dimension group.
- Command-line interface and Python API for integration with NASA Harmony service orchestrator
- Verbose logging for debugging
For local development or the latest features:
git clone <Repository URL>
cd casper
uv syncuv run casper filenameIssues and pull requests welcome on GitHub.
CASPER is released under the Apache License 2.0.