Skip to content

nasa/harmony-casper

Repository files navigation

Overview

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.

What does it do?

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.

Getting started, with uv

  1. Follow the instructions for installing uv here.
  2. Install casper, with its dependencies, by running the following from the repository directory:
uv sync

Usage

For example:

uv run casper TEMPO_NO2_L2_V04_S009G07.nc

For example (note that these are pseudo-real, not actual, TEMPO file names):

casper TEMPO_NO2_L2_V04_S009G07.nc

Output:

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'))

Key Features

  • 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

Installation

From Source (Development)

For local development or the latest features:

git clone <Repository URL>
cd casper
uv sync

Usage

Basic Usage

uv run casper filename

Contributing

Issues and pull requests welcome on GitHub.

License & Attribution

CASPER is released under the Apache License 2.0.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors