-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (142 loc) · 4.82 KB
/
timeseries.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# 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
# Map a step output to a job output
outputs:
BURST_IDS: ${{ steps.asf-search.outputs.BURST_IDS }}
MATRIX: ${{ steps.asf-search.outputs.MATRIX_PARAMS_COMBINATIONS }}
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: bash -el -c "python -u {0}"
run: |
import asf_search as asf
import json
import os
results = asf.search(platform=[asf.PLATFORM.SENTINEL1],
processingLevel=asf.BURST,
polarization="${{ inputs.polarization }}",
fullBurstID="${{ inputs.fullBurstID }}")
print('Results: ', len(results))
burstIDs = [x.meta['native-id'] for x in results]
# Oldest First
burstIDs.sort()
# Create Matrix Job Mapping (JSON Array)
pairs = []
for r in [0]:
for s in [1,2,3]:
pairs.append({'reference': burstIDs[r], 'secondary': burstIDs[r+s]})
matrixJSON = f'{\"include\":[{json.dumps(pairs)}]'
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
print(f'BURST_IDS={burstIDs}', file=f)
print(f'MATRIX_PARAMS_COMBINATIONS={matrixJSON}', file=f)
- name: Test Burst Output
env:
BURST_IDS: ${{ steps.asf-search.outputs.BURST_IDS }}
MATRIX: ${{ steps.asf-search.outputs.MATRIX_PARAMS_COMBINATIONS }}
run: |
#echo $BURST_IDS
echo $MATRIX
pass-burst-list:
needs: get-burst-list
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- name: Confirm BurstIDs
run: |
#echo ${{ needs.get-burst-list.outputs.BURST_IDS }}
echo ${{ needs.get-burst-list.outputs.MATRIX }}
# 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