Skip to main content

Python library for radio astronomy data processing and visualization for the Owens Valley Radio Observatory - Long Wavelength Array (OVRO-LWA)

Project description

OVRO-LWA Portal

DOI PyPI

A Python library for radio astronomy data processing and visualization for the Owens Valley Radio Observatory - Long Wavelength Array (OVRO-LWA).

Features

  • Unified Data Loading: Load OVRO-LWA data from local paths, remote URLs (S3, HTTPS), or DOI identifiers with a single open_dataset() function
  • FITS to Zarr Conversion: Convert OVRO-LWA FITS image files to cloud-optimized Zarr format
  • Command-Line Interface: User-friendly ovro-ingest CLI with progress tracking
  • WCS Coordinate Preservation: Maintain celestial coordinates (RA/Dec) for FITS-free analysis
  • Incremental Processing: Append new observations to existing Zarr stores
  • Concurrent Write Protection: File locking prevents data corruption from simultaneous processes
  • Optional Workflow Orchestration: Prefect integration for production deployments

Prerequisites

This project uses Pixi for dependency management and task execution. Install Pixi by following the installation instructions.

Getting Started

Installation

For Users

Install the package using pip:

pip install git+https://github.com/uw-ssec/ovro-lwa-portal.git

Or install from a local clone:

pip install .

For Developers

Install dependencies using Pixi:

# Install dependencies (Pixi will automatically create the environment)
pixi install

For detailed installation and development instructions, see CONTRIBUTING.md.

Onboarding

For first-time setup, use the onboarding environment to configure your development environment:

pixi run -e onboard onboard

This will:

  • Install pre-commit hooks in your git repository
  • Set up shell completion for ssec-cli
  • Run the SSEC onboarding process

Project Structure

This project is organized using Pixi features for modular dependency management:

  • pre-commit: Code quality and consistency checks
  • gh-cli: GitHub CLI for repository interactions
  • onboard: Tools for project onboarding and setup

Available Environments

  • default: Standard development environment with pre-commit hooks and GitHub CLI
  • onboard: Extended environment including onboarding tools

Development

Using Different Environments

Switch between environments as needed:

# Use default environment
pixi shell

# Use onboard environment
pixi shell -e onboard

Adding Dependencies

Edit pyproject.toml to add new dependencies in the [tool.pixi.dependencies] section:

[tool.pixi.dependencies]
your-package = ">=1.0.0"

Then run:

pixi install

or

Directly add packages (this will edit the pyproject.toml and install):

pixi add your-package

Quick Start

Loading OVRO-LWA Data

Load data from various sources with a unified interface:

import ovro_lwa_portal

# Load from local zarr store
ds = ovro_lwa_portal.open_dataset("/path/to/observation.zarr")

# Load from remote URL
ds = ovro_lwa_portal.open_dataset("s3://ovro-lwa-data/obs_12345.zarr")

# Load via DOI
ds = ovro_lwa_portal.open_dataset("doi:10.5281/zenodo.1234567")

# Customize chunking for large datasets
ds = ovro_lwa_portal.open_dataset(
    "path/to/data.zarr",
    chunks={"time": 100, "frequency": 50}  # or chunks="auto" (default), chunks=None
)

For remote data access, install with remote extras:

pip install 'ovro_lwa_portal[remote]'

See the open_dataset documentation for more details.

Using the FITS to Zarr Ingest CLI

After installation, convert OVRO-LWA FITS files to Zarr format:

# Basic conversion
ovro-ingest convert /path/to/fits /path/to/output

# With custom options
ovro-ingest convert /path/to/fits /path/to/output \
    --zarr-name my_data.zarr \
    --chunk-lm 2048 \
    --rebuild

# Show help
ovro-ingest convert --help

For detailed documentation on the ingest module, see the Ingest Module README.

Using the Python API

from pathlib import Path
from ovro_lwa_portal.ingest import FITSToZarrConverter
from ovro_lwa_portal.ingest.core import ConversionConfig

# Configure conversion
config = ConversionConfig(
    input_dir=Path("/path/to/fits"),
    output_dir=Path("/path/to/output"),
    zarr_name="ovro_lwa_data.zarr",
    chunk_lm=1024,
)

# Execute conversion
converter = FITSToZarrConverter(config)
result = converter.convert()
print(f"Created: {result}")

Technology Stack

  • Core: Python 3.12, xarray, dask, zarr
  • Astronomy: astropy, xradio, python-casacore
  • CLI: typer, rich (progress bars and formatted output)
  • Workflow: prefect (optional orchestration)
  • Storage: Zarr format optimized for cloud access
  • Environment Management: pixi

Contributing

Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

License

This project is licensed under the terms specified in the LICENSE file.

Project Resources

General Discussions

For general discussion, ideas, and resources please use the GitHub Discussions. However, if there's an internal discussion that need to happen, please use the slack channel provided.

Citation

If you use this software in your research, please cite it:

@software{ovro_lwa_portal,
  title = {OVRO-LWA Portal},
  author = {Core, Cordero and Setiawan, Don and Tambay, Anshul T. and Kosogorov, Nikita and Johari, Ishika},
  url = {https://github.com/uw-ssec/ovro-lwa-portal},
  license = {BSD-3-Clause}
}

Questions

If you have any questions about our process, or locations of SSEC resources, please ask Anshul Tambay.

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

ovro_lwa_portal-0.1.0.tar.gz (449.0 kB view details)

Uploaded Source

Built Distribution

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

ovro_lwa_portal-0.1.0-py3-none-any.whl (99.6 kB view details)

Uploaded Python 3

File details

Details for the file ovro_lwa_portal-0.1.0.tar.gz.

File metadata

  • Download URL: ovro_lwa_portal-0.1.0.tar.gz
  • Upload date:
  • Size: 449.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ovro_lwa_portal-0.1.0.tar.gz
Algorithm Hash digest
SHA256 69ceaa863e3056cee6044b3ebb4d68e525c8dea92e436820a13b792a76db9222
MD5 e5929286049e8fded1c69c3d278dc90a
BLAKE2b-256 0ea1607fae74e46a73f3744dc8a55bf2ac3a74462ee2338d7739938258a55737

See more details on using hashes here.

Provenance

The following attestation bundles were made for ovro_lwa_portal-0.1.0.tar.gz:

Publisher: cd.yml on uw-ssec/ovro-lwa-portal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ovro_lwa_portal-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ovro_lwa_portal-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 99.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ovro_lwa_portal-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 374d52daa37169623886a9f9371e28c675c3f1ab6e2cc9c2328f8f85c7165f6a
MD5 e0b37843a2da87014f09d8f59d791d70
BLAKE2b-256 1a999d10a00e32990dfce8ffa0e39ff4c41ee77a14609af453dba50d936bd5d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for ovro_lwa_portal-0.1.0-py3-none-any.whl:

Publisher: cd.yml on uw-ssec/ovro-lwa-portal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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