Skip to main content

Miscellaneous utilities for working with OPERA data products

Project description

opera-utils

Actions Status PyPI version

Conda-Forge GitHub Discussion

Install

The opera_utils package is available on PyPI and conda-forge:

pip install opera-utils
# if mamba is not already installed: conda install -n base mamba
mamba install -c conda-forge opera-utils

(Note: using mamba is recommended for conda-forge packages, but miniconda can also be used.)

While not required for all, some utilities use the GDAL package, which can be installed most easily on conda-forge:

mamba env update --file environment-geo.yml

Example Usage

Parsing Sentinel-1 Burst IDs

import opera_utils
print(opera_utils.get_burst_id("OPERA_L2_CSLC-S1_T087-185683-IW2_20230322T161649Z_20240504T185235Z_S1A_VV_v1.1.h5"))
't087_185683_iw2'

Get DISP-S1 Frame metadata

In [4]: opera_utils.get_frame_to_burst_mapping(11114)
Out[4]:
{'epsg': 32610,
 'is_land': True,
 'is_north_america': True,
 'xmin': 546450,
 'ymin': 4204110,
 'xmax': 833790,
 'ymax': 4409070,
 'burst_ids': ['t042_088905_iw1',
  ...
 ]

To just get the burst IDs for a Frame:

In [3]: opera_utils.get_burst_ids_for_frame(11114)
Out[3]:
['t042_088905_iw1',
 't042_088905_iw2',
 ...
 't042_088913_iw2',
 't042_088913_iw3']

Setup for Developers

To contribute to the development of opera-utils, you can fork the repository and install the package in development mode. We encourage new features to be developed on a new branch of your fork, and then submitted as a pull request to the main repository.

To install locally,

  1. Download source code:
git clone https://github.com/opera-adt/opera-utils.git && cd opera-utils
  1. Install dependencies:
mamba env create --name my-opera-env --file environment.yml
mamba install gdal
  1. Install the source in editable mode:
mamba activate my-opera-env
python -m pip install -e .

The extra packages required for testing and building the documentation can be installed:

# Run "pip install -e" to install with extra development requirements
python -m pip install -e ".[docs,test]"

We use pre-commit to automatically run linting and formatting:

# Get pre-commit hooks so that linting/formatting is done automatically
pre-commit install

This will set up the linters and formatters to run on any staged files before you commit them.

After making functional changes, you can rerun the existing tests and any new ones you have added using:

python -m pytest

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

opera_utils-0.14.0.tar.gz (168.2 kB view details)

Uploaded Source

Built Distribution

opera_utils-0.14.0-py3-none-any.whl (49.6 kB view details)

Uploaded Python 3

File details

Details for the file opera_utils-0.14.0.tar.gz.

File metadata

  • Download URL: opera_utils-0.14.0.tar.gz
  • Upload date:
  • Size: 168.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for opera_utils-0.14.0.tar.gz
Algorithm Hash digest
SHA256 e7cff823c2a3811e2e7f1a28330806bc401c081c92e3b0ca6836fe8239c55b4f
MD5 288be43166d2d33091b1c4418cb5783b
BLAKE2b-256 32b7d79fc3a27a28cfb1914d8e8f1dec2a435066a9cabe34cc1485e982f5de69

See more details on using hashes here.

Provenance

The following attestation bundles were made for opera_utils-0.14.0.tar.gz:

Publisher: cd.yml on opera-adt/opera-utils

Attestations:

File details

Details for the file opera_utils-0.14.0-py3-none-any.whl.

File metadata

  • Download URL: opera_utils-0.14.0-py3-none-any.whl
  • Upload date:
  • Size: 49.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for opera_utils-0.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 acc483b978b120757b5cc39da1c940eadfb436bc8ef5968339135f7b2ca9d963
MD5 578fe12f444dc695a2c45e9043860097
BLAKE2b-256 2b7ee234d74a16c89f70af73d5263a762c64a279f15c5e18250a0515d6ae5952

See more details on using hashes here.

Provenance

The following attestation bundles were made for opera_utils-0.14.0-py3-none-any.whl:

Publisher: cd.yml on opera-adt/opera-utils

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page