Skip to content

Commit

Permalink
timeseries and scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
scottyhq committed Jan 19, 2024
1 parent 143af52 commit 0fbd5fd
Show file tree
Hide file tree
Showing 5 changed files with 418 additions and 0 deletions.
130 changes: 130 additions & 0 deletions .github/workflows/timeseries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# n+1, n+2, n+3 pairs for a given burst
name: Timeseries

on:
workflow_dispatch:
inputs:
fullBurstID:
type: string
required: true
description: ESA Burst Identifier (RelativeObit, ID, Subswath)
default: '012_023790_IW1'
polarization:
type: choice
required: true
description: Polarization
default: VV
options:
- VV
- VH
- HH
nlooks:
type: choice
required: true
description: Range x Azimuth Looks
default: 20x4
options:
- 20x4
- 10x2
- 5x1

jobs:
get-burst-list:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
cache-environment: true
environment-file: environment.yml

# https://words.yuvi.in/post/python-in-github-actions/
- name: Search ASF for bursts
id: asf-search
shell: python -u {0}
run: |
import asf_search as asf
import os
results = asf.search(platform=[asf.PLATFORM.SENTINEL1],
processingLevel=asf.BURST,
polarization=${{ inputs.polarization }}),
relativeBurstID=${{ inputs.fullBurstID }})
print('Results: ', len(results))
burstIDs = [x.meta['native-id'] for x in results]
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
print(f'BURST_IDS={burstIDs}', file=f)
- name: Test Burst Output
env:
BURST_IDS: ${{ steps.asf-search.outputs.BURST_IDS }}
run: |
echo $BURST_IDS
# hyp3-isce2-matrix:
# needs: get-burst-list
# runs-on: ubuntu-latest
# defaults:
# run:
# shell: bash -el {0}
# #strategy:
# # matrix:
# # secondary: [S1_023790_IW1_20231218T121430_VV_B9A6-BURST,S1_023790_IW1_20231230T121429_VV_B9CD-BURST,S1_023790_IW1_20240111T121428_VV_5827-BURST]

# steps:
# - name: Checkout Repository
# uses: actions/checkout@v4
# with:
# repository: 'ASFHyP3/hyp3-isce2'

# - name: Install Conda environment with Micromamba
# uses: mamba-org/setup-micromamba@v1
# with:
# cache-environment: true
# environment-file: environment.yml

# - name: Development install
# run: pip install -e .

# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: us-west-2

# - name: Get Bucket Prefix
# env:
# REF: ${{ inputs.reference }}
# SEC: ${{ matrix.secondary }}
# run: |
# PREFIX=${REF:14:8}_${SEC:14:8}
# echo "PREFIX=${PREFIX}" >> $GITHUB_ENV

# - name: Run Example Workflow
# env:
# EARTHDATA_USERNAME: ${{ secrets.EARTHDATA_USERNAME }}
# EARTHDATA_PASSWORD: ${{ secrets.EARTHDATA_PASSWORD}}
# ESA_USERNAME: ${{ secrets.ESA_USERNAME }}
# ESA_PASSWORD: ${{ secrets.ESA_PASSWORD}}
# run: |
# python -m hyp3_isce2 ++process insar_tops_burst \
# ${{ inputs.reference }} \
# ${{ matrix.secondary }} \
# --looks 20x4 \
# --apply-water-mask False \
# --bucket fufiters \
# --bucket-prefix $PREFIX

# - name: Upload Hyp3 Output
# uses: actions/upload-artifact@v4
# with:
# name: ${{ env.PREFIX }}
# path: S1*.zip
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.vscode

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
9 changes: 9 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: hyp3-stac
channels:
- conda-forge
dependencies:
- asf_search
- pystac
- rasterio
- rio-stac
- jsonschema
Empty file added scripts/getBurstList.py
Empty file.
Loading

0 comments on commit 0fbd5fd

Please sign in to comment.