Skip to content

Commit e42b341

Browse files
authored
Update batch_image_correlation.yml
1 parent 795ed7e commit e42b341

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

.github/workflows/batch_image_correlation.yml

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ on:
66
workflow_dispatch:
77
inputs:
88
cloud_cover:
9-
type: choice
9+
type: string
1010
required: true
11-
description: percent cloud cover allowed in images
11+
description: percent cloud cover allowed in images (0-100)
1212
default: '10'
1313
start_month:
1414
type: choice
@@ -50,8 +50,8 @@ jobs:
5050
S2_search:
5151
runs-on: ubuntu-latest
5252
outputs:
53-
BURST_IDS: ${{ steps.asf-search.outputs.BURST_IDS }}
54-
MATRIX: ${{ steps.asf-search.outputs.MATRIX_PARAMS_COMBINATIONS }}
53+
BURST_IDS: ${{ steps.S2_search.outputs.IMAGE_DATES }}
54+
MATRIX: ${{ steps.S2_search.outputs.MATRIX_PARAMS_COMBINATIONS }}
5555
defaults:
5656
run:
5757
shell: bash -el {0}
@@ -95,21 +95,23 @@ jobs:
9595
[75.42382800808971,36.41082887114753]]]
9696
}
9797
98-
# We use the api from element84 to query the data
98+
# Use the api from element84 to query the data
9999
URL = "https://earth-search.aws.element84.com/v1"
100100
catalog = pystac_client.Client.open(URL)
101101
102102
search = catalog.search(
103103
collections=["sentinel-2-l2a"],
104104
intersects=bbox,
105-
query={"eo:cloud_cover": {"lt": ${{ inputs.cloud_cover }}}}, # less than 10% cloud cover
105+
query={"eo:cloud_cover": {"lt": ${{ inputs.cloud_cover }}}}
106106
)
107107
108108
# Check how many items were returned
109109
items = search.item_collection()
110110
print(f"Returned {len(items)} Items")
111111
112+
# create xarray dataset without loading data
112113
sentinel2_stack = stackstac.stack(items)
114+
# filter to specified month range
113115
sentinel2_stack_snowoff = sentinel2_stack.where((sentinel2_stack.time.dt.month >= ${{ inputs.start_month }}) & (sentinel2_stack.time.dt.month <= ${{ inputs.stop_month }}), drop=True)
114116
115117
image_dates = sentinel2_stack_snowoff.time.dt.strftime('%Y-%m-%d').values.tolist()
@@ -127,23 +129,19 @@ jobs:
127129
print(f'number of image pairs: {len(pairs)}')
128130
129131
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
130-
print(f'BURST_IDS={image_dates}', file=f)
132+
print(f'IMAGE_DATES={image_dates}', file=f)
131133
print(f'MATRIX_PARAMS_COMBINATIONS={matrixJSON}', file=f)
132134
133-
#STOPPED HERE 5/29/2024
134135
135136
# A matrix job that calls a reuseable workflow
136-
hyp3-isce2:
137-
needs: searchASF
137+
autoRIFT:
138+
needs: S2_search
138139
strategy:
139140
fail-fast: false
140-
matrix: ${{ fromJson(needs.searchASF.outputs.MATRIX) }}
141+
matrix: ${{ fromJson(needs.S2_search.outputs.MATRIX) }}
141142
name: ${{ matrix.name }}
142-
uses: ./.github/workflows/single-job.yml
143+
uses: ./.github/workflows/image_correlation_pair.yml
143144
with:
144-
reference: ${{ matrix.reference }}
145-
secondary: ${{ matrix.secondary }}
146-
looks: ${{ inputs.looks }}
147-
apply_water_mask: ${{ inputs.apply_water_mask }}
145+
img1_date: ${{ matrix.img1_date }}
146+
img2_date: ${{ matrix.img2_date }}
148147
workflow_name: ${{ matrix.name }}
149-
secrets: inherit

0 commit comments

Comments
 (0)