Skip to content

Commit 5a17b2f

Browse files
authored
Merge pull request #59 from GeoscienceAustralia/feature/deafult_output_crs
allow UTM as --output-crs
2 parents 68a59bb + a8e4878 commit 5a17b2f

2 files changed

Lines changed: 9 additions & 12 deletions

File tree

sar_pipeline/aws/cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"--output-crs",
4545
required=False,
4646
default="",
47-
help="The output CRS as in integer. e.g. 3031. If None the default UTM zone for scene/burst center is used",
47+
help="The output CRS as an integer. e.g. 3031. If [None,'UTM','utm'] the default UTM zone for scene/burst center is used (polar stereo at lat>75).",
4848
)
4949
@click.option("--dem", required=True, type=click.Choice(["cop_glo30"]))
5050
@click.option(
@@ -269,8 +269,8 @@ def get_data_for_scene_and_make_run_config(
269269
RTC_RUN_CONFIG.set(f"{bk}.x_snap", int(resolution))
270270
RTC_RUN_CONFIG.set(f"{bk}.y_snap", int(resolution))
271271

272-
# update the burst crs if it has been set
273-
if output_crs and output_crs is not None:
272+
# update the burst crs if it has been set and is not UTM | utm
273+
if output_crs and (output_crs not in ["utm", "UTM"]):
274274
RTC_RUN_CONFIG.set(f"{bk}.output_epsg", int(output_crs))
275275

276276
# save the config

scripts/run_aws_pipeline.sh

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
scene=""
66
burst_ids=()
77
resolution=20
8-
output_crs=""
8+
output_crs="UTM"
99
dem="cop_glo30"
1010
product="RTC_S1"
1111
s3_bucket="deant-data-public-dev"
@@ -70,16 +70,13 @@ fi
7070
# If empty, the CRS corresponding to the center of the scene is used
7171
# OR, the CRS from the burst_db is used if provided.
7272

73-
if [[ -z "$output_crs" ]]; then
73+
if [[ -z "$output_crs" || "${output_crs,,}" == "utm" ]]; then
7474
epsg_code_msg="default UTM for scene center"
75+
elif [[ "$output_crs" =~ ^[0-9]+$ ]]; then
76+
epsg_code_msg="EPSG:$output_crs"
7577
else
76-
# Check if the parameter is an integer using regex
77-
if ! [[ "$output_crs" =~ ^[0-9]+$ ]]; then
78-
echo "Error: --output_crs must be an integer corresponding to a CRS code (e.g. 3031) or empty."
79-
exit 1
80-
else
81-
epsg_code_msg="EPSG:$output_crs"
82-
fi
78+
echo "Error: --output_crs must be empty, 'UTM', 'utm', or an integer corresponding to an EPSG code (e.g. 3031)."
79+
exit 1
8380
fi
8481

8582
# Ensure the specified product is valid

0 commit comments

Comments
 (0)