Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions cwl/sar_coherence.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ $graph:

sub_swath:
type:
type: enum
symbols: [ "IW1", "IW2", "IW3" ]
- "null"
- type: enum
symbols: [ "IW1", "IW2", "IW3" ]
doc: "Sub-swath identifier"

temporal_extent:
Expand Down Expand Up @@ -147,7 +148,7 @@ $graph:
run: "#extract_pairs_array"
in:
pairs_json_file: generate_pairs/insar_pairs_json
out: [pairs_array]
out: [pairs_array, sub_swath_id]

process_pairs:
run: "#process_single_pair"
Expand All @@ -157,7 +158,7 @@ $graph:
burst_id: burst_id
spatial_extent: spatial_extent
polarization: polarization
sub_swath: sub_swath
sub_swath: extract_pairs/sub_swath_id
coherence_window_rg: coherence_window_rg
coherence_window_az: coherence_window_az
out: [pair_output]
Expand Down Expand Up @@ -195,7 +196,7 @@ $graph:
});
}
- class: DockerRequirement
dockerPull: ghcr.io/cloudinsar/openeo_insar:20260511T0923
dockerPull: ghcr.io/cloudinsar/openeo_insar:20260514T1358-merge
- class: NetworkAccess
networkAccess: true
- class: InlineJavascriptRequirement
Expand All @@ -209,8 +210,10 @@ $graph:
- type: enum
symbols: [ "VV", "VH" ]
sub_swath:
- type: enum
symbols: [ "IW1", "IW2", "IW3" ]
type:
- "null"
- type: enum
symbols: [ "IW1", "IW2", "IW3" ]
temporal_extent:
type: string[]
temporal_baseline:
Expand Down Expand Up @@ -242,11 +245,16 @@ $graph:
items:
type: array
items: string
sub_swath_id:
type: string

expression: |
${
var data = JSON.parse(inputs.pairs_json_file.contents);
return {"pairs_array": data.InSAR_pairs};
return {
"pairs_array": data.InSAR_pairs,
"sub_swath_id": data.sub_swath_id
};
}

- class: CommandLineTool
Expand Down Expand Up @@ -322,8 +330,7 @@ $graph:
- type: enum
symbols: [ "VV", "VH" ]
sub_swath:
- type: enum
symbols: [ "IW1", "IW2", "IW3" ]
type: string
coherence_window_rg:
type: int?
coherence_window_az:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"temporal_extent": [
"2018-01-28",
"2018-02-03"
],
"temporal_baseline": 6,
"spatial_extent": {
"west": -6.05477,
"east": -6.054,
"south": 37.039,
"north": 37.03968
},
"coherence_window_az": 2,
"coherence_window_rg": 10,
"n_az_looks": 1,
"n_rg_looks": 4,
"polarization": "VH"
}
4 changes: 3 additions & 1 deletion sar/get_bursts.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
spatial_extent=input_dict.get("spatial_extent"),
)

subswath = input_dict.get("sub_swath") if input_dict.get("sub_swath") is not None else s1_bursts[0]["SwathIdentifier"]

dates = [datetime.strptime(b["BeginningDateTime"][:10], "%Y-%m-%d") for b in s1_bursts]
dates.sort()
InSARpairs = []
Expand All @@ -61,7 +63,7 @@
raise ValueError(f"Not enough bursts found to make pairs for the given parameters: {input_dict}")

input_dict["InSAR_pairs"] = InSARpairs

input_dict["sub_swath_id"] = subswath
result_folder = Path.cwd().absolute()
# result_folder = repo_directory / "output"
# result_folder.mkdir(exist_ok=True)
Expand Down
4 changes: 3 additions & 1 deletion sar/sar_coherence.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
spatial_extent=input_dict.get("spatial_extent"),
)

# If we do not pass the subswath as input parameter, we get it from the automatically selected burst with lowest number
subswath = input_dict.get("sub_swath") if input_dict.get("sub_swath") is not None else bursts[0]["SwathIdentifier"]
burst_paths = []
for burst in bursts:
begin = parse_date(burst["BeginningDateTime"]).date()
Expand All @@ -61,7 +63,7 @@
"sentinel1_burst_extractor.sh",
"-n", burst["ParentProductName"],
"-p", input_dict["polarization"].lower(),
"-s", str(input_dict["sub_swath"].lower()),
"-s", str(subswath.lower()),
"-r", str(burst["BurstId"]),
"-o", str(tmp_insar),
]
Expand Down
Loading