Add SARscape SBAS prepared stack workflow

This commit is contained in:
2026-04-30 09:42:01 +08:00
parent 4c0d1f2c2b
commit 6696fe90fa
27 changed files with 4915 additions and 95 deletions
+22 -1
View File
@@ -18,6 +18,8 @@ from ..models import (
RadarData,
TimeseriesStackPlan,
TimeseriesStackPlanDetail,
TimeseriesStackPlanEdge,
TimeseriesStackPlanEdgeORM,
TimeseriesStackPlanItem,
TimeseriesStackPlanItemORM,
TimeseriesStackPlanORM,
@@ -89,11 +91,21 @@ def get_pairing_request_from_form(
def get_ps_request_from_form(
initial_overlap_threshold: float = Form(0.3),
final_overlap_threshold: float = Form(0.95)
final_overlap_threshold: float = Form(0.95),
time_baseline_min: int = Form(1),
time_baseline_max: int = Form(90),
spatial_baseline_max_meters: int = Form(3000),
network_overlap_threshold: float = Form(0.5),
num_connections: int = Form(1),
) -> PsRequest:
return PsRequest(
initial_overlap_threshold=initial_overlap_threshold,
final_overlap_threshold=final_overlap_threshold,
time_baseline_min=time_baseline_min,
time_baseline_max=time_baseline_max,
spatial_baseline_max_meters=spatial_baseline_max_meters,
network_overlap_threshold=network_overlap_threshold,
num_connections=num_connections,
)
@@ -205,11 +217,20 @@ async def get_timeseries_stack_plan_endpoint(
.where(TimeseriesStackPlanItemORM.plan_ref_id == plan.id)
.order_by(TimeseriesStackPlanItemORM.scene_rank.asc(), TimeseriesStackPlanItemORM.id.asc())
)
edges_result = await db.execute(
select(TimeseriesStackPlanEdgeORM)
.where(TimeseriesStackPlanEdgeORM.plan_ref_id == plan.id)
.order_by(TimeseriesStackPlanEdgeORM.edge_rank.asc(), TimeseriesStackPlanEdgeORM.id.asc())
)
payload = TimeseriesStackPlan.model_validate(plan).model_dump()
payload["items"] = [
TimeseriesStackPlanItem.model_validate(item)
for item in items_result.scalars().all()
]
payload["edges"] = [
TimeseriesStackPlanEdge.model_validate(edge)
for edge in edges_result.scalars().all()
]
return TimeseriesStackPlanDetail.model_validate(payload)