diff --git a/.circleci/freeze-deps.sh b/.circleci/freeze-deps.sh index 566ed2e0..187cef20 100755 --- a/.circleci/freeze-deps.sh +++ b/.circleci/freeze-deps.sh @@ -1,6 +1,46 @@ -#!/bin/sh -docker run -v "$PWD:/mnt" -w /mnt --rm -it continuumio/miniconda3 bash -c '\ - conda config --add channels conda-forge && \ - conda config --remove channels defaults && \ - conda update -y conda && \ - conda install -y -c conda-forge isce3=0.8 build setuptools pytest isce3 shapely lxml && conda list --explicit > specfile.txt' +#!/usr/bin/env bash + +# Enable common error handling options. +set -o errexit +set -o nounset +set -o pipefail + +readonly HELP='usage: ./freeze-deps.sh ENVFILE > specfile.txt + +Create a conda lockfile from an environment YAML file for reproducible +environments. + +positional arguments: +ENVFILE a YAML file containing package specifications + +options: +-h, --help show this help message and exit +' + +main() { + # Get absolute path of input YAML file. + local ENVFILE + ENVFILE=$(realpath "$1") + + # Get concretized package list. + local PKGLIST + PKGLIST=$(docker run --network=host \ + -v "$ENVFILE:/tmp/environment.yml:ro" --rm \ + mambaorg/micromamba:1.1.0 bash -c '\ + micromamba install -y -n base -f /tmp/environment.yml > /dev/null && \ + micromamba env export --explicit') + + # Sort packages alphabetically. + # (The first 4 lines are assumed to be header lines and ignored.) + echo "$PKGLIST" | (sed -u 4q; sort) +} + +if [[ "${1-}" =~ ^-*h(elp)?$ ]]; then + echo "$HELP" +elif [[ "$#" -ne 1 ]]; then + echo 'Illegal number of parameters' >&2 + echo "$HELP" + exit 1 +else + main "$@" +fi diff --git a/LICENSE b/LICENSE index 261eeb9e..a5acca3b 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,8 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2022 California Institute of Technology (“Caltech”). + U.S. Government sponsorship acknowledged. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index f8711392..b01a4e2c 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,51 @@ -## s1-reader +# s1-reader A package to read Sentinel-1 data into the ISCE3-compatible burst class. -### Features +## Features -+ Create ISCE3-compatible Sentinel1 burst class given: +Create ISCE3-compatible Sentinel1 burst class given: - - S1 SAFE - - subswath index - - polarization - - path to orbit directory +- S1 SAFE +- subswath index +- polarization +- path to orbit directory -+ Monotonically increasing bursts IDs. +Creates a Burst ID based on [ESA's published burst ID maps](https://sentinel.esa.int/web/sentinel/-/publication-of-brust-id-maps-for-copernicus-sentinel-1/1.1). 🚨 This toolbox is still in **pre-alpha** stage and undergoing **rapid development**. 🚨 -### Install +## Install + +`s1reader` is available to install via `conda-forge`: + +```bash +conda install -c conda-forge s1reader +``` + +### Installing for development 1. Download source code: ```bash git clone https://github.com/opera-adt/s1-reader.git +cd s1-reader ``` 2. Install dependencies: ```bash -conda install -c conda-forge --file s1-reader/requirements.txt +conda env create --file environment.yaml ``` -3. Install `s1-reader` via pip: +3. Install `s1reader` via pip: ```bash # run "pip install -e" to install in development mode -python -m pip install ./s1-reader +python -m pip install -e . ``` -### Usage +## Usage The following sample code demonstrates how to process a single burst from a S1 SAFE zip: @@ -56,7 +65,7 @@ bursts = s1reader.load_bursts(zip_path, orbit_path, swath_num, pol) burst_ids = [x.burst_id for x in bursts] ``` -### License +## License **Copyright (c) 2021** California Institute of Technology (“Caltech”). U.S. Government sponsorship acknowledged. diff --git a/environment.yaml b/environment.yaml index 039e0015..60d91cf9 100644 --- a/environment.yaml +++ b/environment.yaml @@ -1,11 +1,12 @@ name: s1reader channels: - - defaults - conda-forge dependencies: - - numpy - - gdal - - isce3 - - packaging - - requests - - shapely + - python>=3.8 + - numpy>=1.20 + - gdal>=3.0 + - isce3>=0.13 + - packaging>=21.0 + - requests>=2.0 + - shapely>=1.8 + - lxml>=4.8 diff --git a/src/s1reader/version.py b/src/s1reader/version.py index 61be5eae..6c755f0c 100644 --- a/src/s1reader/version.py +++ b/src/s1reader/version.py @@ -1,11 +1,10 @@ # release history - import collections - # release history Tag = collections.namedtuple('Tag', 'version date') release_history = ( + Tag('0.2.0', '2023-07-25'), Tag('0.1.7', '2023-05-09'), Tag('0.1.6', '2023-03-22'), Tag('0.1.5', '2022-12-21'),