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
7 changes: 3 additions & 4 deletions apex_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ def generate() -> dict:
####################
# PART 3: Apply statcube processing
####################:
context_udf = {"spatial_extent": {"from_parameter": "spatial_extent"}, "detection_start_time": {"from_parameter": "temporal_extent"},
"detection_end_time": {"from_parameter": "temporal_extent"}}
udf = UDF.from_file("udf_apex_S1backscatter_changedetection.py", context=context_udf)
output_statmcd = s1_backcatter.apply_dimension(process=udf, dimension="t")
context_udf = {"spatial_extent": {"from_parameter": "spatial_extent"}, "detection_extent": {"from_parameter": "temporal_extent"}}
udf = UDF.from_file("udf_apex_S1backscatter_changedetection.py", context={"from_parameter": "context"})
output_statmcd = s1_backcatter.apply_dimension(process=udf, dimension="t", context=context_udf)
output_statmcd = output_statmcd.rename_labels(dimension="bands",
target=["DEC", "DEC_asc", "DEC_asc_threshold", "DEC_des",
"DEC_des_threshold"])
Expand Down
20 changes: 10 additions & 10 deletions sentinel1_mcd.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions udf_apex_S1backscatter_changedetection.py
Original file line number Diff line number Diff line change
Expand Up @@ -829,16 +829,16 @@ def apply_datacube(cube: xr.DataArray, context: Dict) -> xr.DataArray:

# Get temporal extent
spatial_extent = context["spatial_extent"]
datection_time = context["detection_start_time"]
detection_end_time = context["detection_end_time"]
detection_start_time = context["detection_extent"][0]
detection_end_time = context["detection_extent"][1]

start_d = datetime.datetime.strptime(datection_time, "%Y-%m-%d")
start_d = datetime.datetime.strptime(detection_start_time, "%Y-%m-%d")
end_d = datetime.datetime.strptime(detection_end_time, "%Y-%m-%d")
delta_days = (end_d - start_d).days
acq_frequency = abs(delta_days)

# temporal extent
days_interval = get_context_intervals(datection_time, acq_frequency=acq_frequency)
days_interval = get_context_intervals(detection_start_time, acq_frequency=acq_frequency)
start_time, end_time = get_overall_start_end(days_interval)
# logger.info(f"Processingfromto: {start_time} to {end_time}")

Expand Down