From 17880aa79921eb03e9e7a8e77275ac594ba0bde9 Mon Sep 17 00:00:00 2001 From: Scott Staniewicz Date: Fri, 12 Aug 2022 20:53:25 -0400 Subject: [PATCH 1/3] fix: wrong keywork arg for gdal2isce --- sardem/dem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sardem/dem.py b/sardem/dem.py index 45239bd..7a8e553 100644 --- a/sardem/dem.py +++ b/sardem/dem.py @@ -452,7 +452,7 @@ def main( if make_isce_xml: logger.info("Creating ISCE2 XML file") - utils.gdal2isce_xml(output_name, keep_egm=keep_egm, shift_rsc=using_gdal_bounds) + utils.gdal2isce_xml(output_name, keep_egm=keep_egm, using_gdal_bounds=using_gdal_bounds) if keep_egm or data_source == "NASA_WATER": logger.info("Keeping DEM as EGM96 geoid heights") From b33f2220cc22f458c81f689f4cc15a9954be4b01 Mon Sep 17 00:00:00 2001 From: Scott Staniewicz Date: Fri, 12 Aug 2022 21:06:48 -0400 Subject: [PATCH 2/3] catch the gdal command printing pickle error and skip bump version for exception catch typo --- sardem/cop_dem.py | 14 ++++++++++---- sardem/dem.py | 4 +++- setup.py | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/sardem/cop_dem.py b/sardem/cop_dem.py index 21dc249..9bb4a15 100644 --- a/sardem/cop_dem.py +++ b/sardem/cop_dem.py @@ -63,11 +63,17 @@ def download_and_stitch( # Used the __RETURN_OPTION_LIST__ to get the list of options for debugging logger.info("Creating {}".format(output_name)) logger.info("Fetching remote tiles...") - cmd = _gdal_cmd_from_options(vrt_filename, output_name, option_dict) - logger.info("Running GDAL command:") + try: + cmd = _gdal_cmd_from_options(vrt_filename, output_name, option_dict) + logger.info("Running GDAL command:") + logger.info(cmd) + except Exception: + # Can't form the cli version due to `deepcopy` Pickle error, just skip + logger.info("Running gdal Warp with options:") + logger.info(option_dict) + pass + # Now convert to something GDAL can actually use option_dict["callback"] = gdal.TermProgress - logger.info(cmd) - # Now convert to something GDAL can actuall use gdal.Warp(output_name, vrt_filename, options=gdal.WarpOptions(**option_dict)) return diff --git a/sardem/dem.py b/sardem/dem.py index 7a8e553..0752770 100644 --- a/sardem/dem.py +++ b/sardem/dem.py @@ -452,7 +452,9 @@ def main( if make_isce_xml: logger.info("Creating ISCE2 XML file") - utils.gdal2isce_xml(output_name, keep_egm=keep_egm, using_gdal_bounds=using_gdal_bounds) + utils.gdal2isce_xml( + output_name, keep_egm=keep_egm, using_gdal_bounds=using_gdal_bounds + ) if keep_egm or data_source == "NASA_WATER": logger.info("Keeping DEM as EGM96 geoid heights") diff --git a/setup.py b/setup.py index 42488ce..1e3881f 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="sardem", - version="0.10.5", + version="0.10.6", author="Scott Staniewicz", author_email="scott.stanie@gmail.com", description="Create upsampled DEMs for InSAR processing", From ec9dfd58478159b3e5e19ba4668e738e36f2a2fe Mon Sep 17 00:00:00 2001 From: Scott Staniewicz Date: Fri, 12 Aug 2022 21:14:44 -0400 Subject: [PATCH 3/3] change https to http to fix pytest --- sardem/tests/test_dem.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sardem/tests/test_dem.py b/sardem/tests/test_dem.py index a525a9b..aa8e8e7 100644 --- a/sardem/tests/test_dem.py +++ b/sardem/tests/test_dem.py @@ -37,7 +37,7 @@ class TestDownload(unittest.TestCase): def setUp(self): self.bounds = utils.bounding_box(-155.4, 19.75, 0.001, 0.001) self.test_tile = "N19W156" - self.hgt_url = "http://e4ftl01.cr.usgs.gov/MEASURES/\ + self.hgt_url = "https://e4ftl01.cr.usgs.gov/MEASURES/\ SRTMGL1.003/2000.02.11/N19W156.SRTMGL1.hgt.zip" sample_hgt_path = join(DATAPATH, self.test_tile + ".hgt.zip") @@ -52,7 +52,7 @@ def tearDown(self): def test_init(self): d = download.Downloader([self.test_tile], netrc_file=NETRC_PATH) self.assertEqual( - d.data_url, "http://e4ftl01.cr.usgs.gov/MEASURES/SRTMGL1.003/2000.02.11" + d.data_url, "https://e4ftl01.cr.usgs.gov/MEASURES/SRTMGL1.003/2000.02.11" ) @responses.activate