Skip to content

Commit c4ba284

Browse files
committed
adopt polewards questinaire before processing
1 parent 6240302 commit c4ba284

File tree

2 files changed

+48
-19
lines changed

2 files changed

+48
-19
lines changed

ost/Project.py

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -652,10 +652,36 @@ def bursts_to_ards(
652652
# when outside SRTM
653653
center_lat = loads(self.aoi).centroid.y
654654
if float(center_lat) > 59 or float(center_lat) < -59:
655-
logger.info('Scene is outside SRTM coverage. Snap will therefore '
656-
'use the Earth\'s geoid model.')
657-
self.ard_parameters['single_ARD']['dem'][
658-
'dem_name'] = 'Aster 1sec GDEM'
655+
656+
if 'SRTM' in self.ard_parameters['single_ARD']['dem']['dem_name']:
657+
logger.info(
658+
'Scene is outside SRTM coverage. Snap will therefore use '
659+
'the Copernicus 30m Global DEM. '
660+
)
661+
662+
self.ard_parameters['single_ARD']['dem'][
663+
'dem_name'] = 'Copernicus 30m Global DEM'
664+
665+
if self.ard_parameters['dem']['out_projection'] == 4326:
666+
667+
logger.info(
668+
'The scene\'s location is towards the poles. '
669+
'Consider to use a stereographic projection.'
670+
)
671+
672+
epsg = input(
673+
'Type an alternative EPSG code for the projection of the '
674+
'output data or just press enter for keeping Lat/Lon '
675+
'coordinate system (e.g. 3413 for NSIDC Sea Ice Polar '
676+
'Stereographic North projection, or 3976 for '
677+
'NSIDC Sea Ice Polar Stereographic South projection'
678+
)
679+
680+
if not epsg:
681+
epsg = 4326
682+
683+
self.ard_parameters['single_ARD']['dem'][
684+
'out_projection'] = int(epsg)
659685

660686
# --------------------------------------------
661687
# 3 subset determination

ost/s1/s1scene.py

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,7 @@ def create_ard(self, infile, out_dir, subset=None, overwrite=False):
788788
# when outside SRTM
789789
center_lat = self._get_center_lat(infile)
790790
if float(center_lat) > 59 or float(center_lat) < -59:
791+
791792
if 'SRTM' in self.ard_parameters['single_ARD']['dem']['dem_name']:
792793

793794
logger.info(
@@ -798,24 +799,26 @@ def create_ard(self, infile, out_dir, subset=None, overwrite=False):
798799
self.ard_parameters['single_ARD']['dem'][
799800
'dem_name'] = 'Copernicus 30m Global DEM'
800801

801-
logger.info(
802-
'The scene\'s location is towards the poles. '
803-
'Consider to use a stereographic projection.'
804-
)
802+
if self.ard_parameters['dem']['out_projection'] == 4326:
805803

806-
epsg = input(
807-
'Type an alternative EPSG code for the projection of the '
808-
'output data or just press enter for keeping Lat/Lon '
809-
'coordinate system (e.g. 3413 for NSIDC Sea Ice Polar '
810-
'Stereographic North projection, or 3976 for NSIDC Sea Ice '
811-
'Polar Stereographic South projection'
812-
)
804+
logger.info(
805+
'The scene\'s location is towards the poles. '
806+
'Consider to use a stereographic projection.'
807+
)
808+
809+
epsg = input(
810+
'Type an alternative EPSG code for the projection of the '
811+
'output data or just press enter for keeping Lat/Lon '
812+
'coordinate system (e.g. 3413 for NSIDC Sea Ice Polar '
813+
'Stereographic North projection, or 3976 for '
814+
'NSIDC Sea Ice Polar Stereographic South projection'
815+
)
813816

814-
if not epsg:
815-
epsg = 4326
817+
if not epsg:
818+
epsg = 4326
816819

817-
self.ard_parameters['single_ARD']['dem'][
818-
'out_projection'] = int(epsg)
820+
self.ard_parameters['single_ARD']['dem'][
821+
'out_projection'] = int(epsg)
819822

820823
# --------------------------------------------
821824
# 3 Check ard parameters in case they have been updated,

0 commit comments

Comments
 (0)