Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
forrestfwilliams committed Sep 27, 2024
1 parent 2b29dcb commit 5278280
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,38 @@

Package for [OPERA DISP](https://www.jpl.nasa.gov/go/opera/products/disp-product-suite/) Tile Map Server (TMS) creation.

## Scripts
`generate_coh_tiles.py`: Generate a test dataset with a similar extent and result to the OPERA DISP dataset for testing.
## Installation
See [Develop Setup](#developer-setup)

## Credentials
This repositories assumes that you have credentials for `urs.earthdata.nasa.gov` (Earthdata login) and `uat.urs.earthdata.nasa.gov` (Earthdata login UAT) configured in your `netrc` file.

For instructions on setting up your Earthdata login (and Earthdata login UAT) via a `.netrc` file, check out this [guide](https://harmony.earthdata.nasa.gov/docs#getting-started).

## Usage
### Create a frame metadata tile
These tiles serve as the foundation for the creation of all other Tile Map Server datasets. More details on the structure of these datasets can be found in the [Design.md](https://github.com/ASFHyP3/OPERA-DISP-TMS/blob/develop/Design.md) document.

> [!WARNING]
> Products in ASF's Cumulus UAT environment are not publicly accessible. To run this workflow using data hosted in ASF's Cumulus UAT environment you first need to generate temporary S3 access credentials while on the NASA or ASF DAAC VPN, then copy the created credentials to an AWS us-west-2 compute environment at the location `~/LOCAL_OPERA-DISP-TMS_INSTALL_PATH/src/opera_disp_tms/credentials.json`. See [Create temp S3 credentials](#create-temp-s3-credentials) for more details.
The `generate_frame_tile` CLI command can be used to generate a frame metadata tile:
```bash
generate_frame_tile -122 37 -121 38 --ascending
```
Where `-122 37 -121 38` is a desired bounding box in INTEGER `minx, miny, max, maxy` longitude/latitude values, and `--ascending` specifies which orbit direction you want to generate a frame metadata tile for (`--ascending` for ascending, omit for descending).

For TMS generation ASF will be using 1x1 degree tiles

### Create temp S3 credentials
The `get_tmp_s3_creds` CLI command can be used to generate temporary S3 access credentials for a NASA Cumulus Thin Egress App (TEA):
```bash
get_tmp_s3_creds --tea-url https://cumulus-test.asf.alaska.edu/s3credentials --creds-path ./creds.json
```
Where `--tea-url` is the TEA S3 endpoint you want to generate credentials for, and `--creds-path` is the path to save the credentials to.
When called with no arguments (`get_tmp_s3_creds`) the CLI commands defaults to the ASF Cumulus UAT's TEA, and to the credentials path `~/LOCAL_OPERA-DISP-TMS_INSTALL_PATH/src/opera_disp_tms/credentials.json`.

**These temporary credentials expire every hour and will need to be regenerated accordingly.**

## Developer Setup
1. Ensure that conda is installed on your system (we recommend using [mambaforge](https://github.com/conda-forge/miniforge#mambaforge) to reduce setup times).
Expand Down
4 changes: 3 additions & 1 deletion src/opera_disp_tms/tmp_s3_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ def get_credentials(


def main():
"""CLI entrypoint for getting temporary S3 credentials"""
"""CLI entrypoint for getting temporary S3 credentials
Example: get_tmp_s3_creds --tea-url https://cumulus-test.asf.alaska.edu/s3credentials --creds-path ./creds.json
"""
parser = argparse.ArgumentParser(description='Get temporary S3 credentials')
parser.add_argument(
'--tea-url',
Expand Down

0 comments on commit 5278280

Please sign in to comment.