From dff798e9dd95bdf49b01d8ea4c0ad9799bc69220 Mon Sep 17 00:00:00 2001
From: Simon Dreutter <simon.dreutter@awi.de>
Date: Mon, 18 Nov 2024 10:04:01 +0100
Subject: [PATCH] avoid tiny resolution differences

---
 process/4_process_gebco.py | 12 ++++++++++--
 process/config.py          |  4 ++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/process/4_process_gebco.py b/process/4_process_gebco.py
index 15fd5c7..f3e2508 100644
--- a/process/4_process_gebco.py
+++ b/process/4_process_gebco.py
@@ -56,12 +56,20 @@ print('====================================================================')
 print(f'{"GENERAL BATHYMETRIC CHART OF THE OCEANS / GEBCO":^68}')
 
 # World
+
+# DEBUG
+if RESOLUTION_DEG == (1 / 60 / 60 * 15):
+       tr = ''
+else:
+       tr = f' -tr {RESOLUTION_DEG} {RESOLUTION_DEG}'
+#/DEBUG
+
 # ice surface
 msg = 'Resampling GEBCO ice surface...'
 cmd = (f'gdalwarp'
        f' -s_srs EPSG:{EPSG_WORLD}'
        f' -t_srs EPSG:{EPSG_WORLD}'
-       f' -tr {RESOLUTION_DEG} {RESOLUTION_DEG}'
+       f'{tr}'
        f' -r cubic'
        f' -of GTiff'
        f' {WARP_OPTIONS}'
@@ -100,7 +108,7 @@ msg = 'Resampling GEBCO sub ice...'
 cmd = (f'gdalwarp'
        f' -s_srs EPSG:{EPSG_WORLD}'
        f' -t_srs EPSG:{EPSG_WORLD}'
-       f' -tr {RESOLUTION_DEG} {RESOLUTION_DEG}'
+       f'{tr}'
        f' -r cubic'
        f' -of GTiff'
        f' {WARP_OPTIONS}'
diff --git a/process/config.py b/process/config.py
index 063176f..f141363 100644
--- a/process/config.py
+++ b/process/config.py
@@ -194,8 +194,8 @@ GLIMS_IN = PATH_GLIMS / 'glims_polygons.shp'
 # warping in the lower latitudes.
 
 # Final AWI Basemap (World) resolution
-RESOLUTION_DEG = 0.004166666666666666  # 15 arc seconds (original GEBCO resolution)
-# RESOLUTION_DEG = 0.008333333333333333  # 30 arc seconds
+RESOLUTION_DEG =  1 / 60 / 60 * 15  # 15 arc seconds (original GEBCO resolution)
+# RESOLUTION_DEG =  1 / 60 / 60 * 30  # 30 arc seconds
 
 # Final AWI Basemap (Arctic and Antarctic) resolution
 RESOLUTION_M = 500.0  # approximate pendant to 15 arc seconds
-- 
GitLab