Skip to content
Snippets Groups Projects
Commit 6cb02ae2 authored by Simon Dreutter's avatar Simon Dreutter
Browse files

tiny improvements

parent 1caa5b62
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,9 @@ from config import * ...@@ -40,6 +40,9 @@ from config import *
# PROCESS # PROCESS
#============================================================================= #=============================================================================
# resolution for GIMP_RASTER
gimp_res = RESOLUTION_DEG / 2
# layer names # layer names
gimp_name = os.path.splitext(os.path.basename(GIMP))[0] gimp_name = os.path.splitext(os.path.basename(GIMP))[0]
...@@ -48,11 +51,11 @@ print() ...@@ -48,11 +51,11 @@ print()
print('====================================================================') print('====================================================================')
print(f'{"GREENLAND ICE MAPPING PROJECT / GIMP":^68}') print(f'{"GREENLAND ICE MAPPING PROJECT / GIMP":^68}')
msg = 'Reprojecting and downsampling GIMP raster...' msg = 'Reprojecting and resampling GIMP raster...'
cmd = (f'gdalwarp' cmd = (f'gdalwarp'
f' -t_srs {EPSG_WORLD}' f' -t_srs {EPSG_WORLD}'
f' -dstnodata 0.0' f' -dstnodata 0.0'
f' -tr {GIMP_RESOLUTION} {GIMP_RESOLUTION}' f' -tr {gimp_res} {gimp_res}'
f' -r near' f' -r near'
f' -of GTiff' f' -of GTiff'
f' {GIMP_IN} {GIMP_RASTER}') f' {GIMP_IN} {GIMP_RASTER}')
......
...@@ -16,6 +16,15 @@ Antarctic extent, reprojected (warped) to the Arctic and Antarctic ...@@ -16,6 +16,15 @@ Antarctic extent, reprojected (warped) to the Arctic and Antarctic
projections (EPSG_ARCTIC and EPSG_ANTARCTIC), and downsampled to the projections (EPSG_ARCTIC and EPSG_ANTARCTIC), and downsampled to the
target resolution (RESOLUTION_M). target resolution (RESOLUTION_M).
Due to ice shelfs there is a very steep drop in the DEM from shelf
ice edge down to the seabed, which creates hillshade artifacts. To
avoid these, the GEBCO grid for World and Antarctic outputs will be
processed twice, once the ice surface DEM and once the sub ice
topography DEM. The main hillshade is created from the sub ice DEM.
Then all data above sea level is extracted from the ice surface DEM,
a hillshade is created for these areas and the sub ice hillshade is
replaced in these areas.
""" """
...@@ -102,6 +111,7 @@ cmd = (f'gdalwarp' ...@@ -102,6 +111,7 @@ cmd = (f'gdalwarp'
f' {GEBCO_SUBICE_IN} {GEBCO_WORLD_SUBICE}') f' {GEBCO_SUBICE_IN} {GEBCO_WORLD_SUBICE}')
run(msg,cmd) run(msg,cmd)
# Arctic # Arctic
msg = 'Clipping GEBCO for the Arctic...' msg = 'Clipping GEBCO for the Arctic...'
cmd = (f'gdal_translate' cmd = (f'gdal_translate'
...@@ -133,15 +143,8 @@ cmd = (f'gdalwarp' ...@@ -133,15 +143,8 @@ cmd = (f'gdalwarp'
f' {GEBCO_ARCTIC_FULL_VRT} {GEBCO_ARCTIC}') f' {GEBCO_ARCTIC_FULL_VRT} {GEBCO_ARCTIC}')
run(msg,cmd) run(msg,cmd)
# Antarctic
# Due to ice shelfs there is a very steep drop in the DEM from shelf ice edge
# down to the seabed, which creates hillshade artifacts. To avoid these, the
# Antarctic GEBCO grid will processed twice, once the ice surface DEM and once
# the sub ice topography DEM. The main hillshade is created from the sub ice
# DEM. Then all data above sea level is extracted from the ice surface DEM, a
# hillshade is created for these areas and the sub ice hillshade is replaced
# in these areas.
# Antarctic
# ice surface # ice surface
msg = 'Clipping GEBCO ice surface for the Antarctic...' msg = 'Clipping GEBCO ice surface for the Antarctic...'
cmd = (f'gdal_translate' cmd = (f'gdal_translate'
......
...@@ -12,7 +12,7 @@ This scipt computes the hillshade layers for the World, the Arctic ...@@ -12,7 +12,7 @@ This scipt computes the hillshade layers for the World, the Arctic
and the Antarctic basemap. The hillshades are computed with a and the Antarctic basemap. The hillshades are computed with a
synthetic light source from 315° Azimuth and 45° Altitude and with synthetic light source from 315° Azimuth and 45° Altitude and with
and exaggeration / z factor of 10 (Z_FACTOR in config). The combined and exaggeration / z factor of 10 (Z_FACTOR in config). The combined
shading is used to get Simon's magical relief visualization, which shading is used to get "Simon's magical relief visualization", which
combines shading by synthetic illumination and shading by slope combines shading by synthetic illumination and shading by slope
inclination. inclination.
...@@ -101,6 +101,7 @@ cmd = (f'gdal_merge' ...@@ -101,6 +101,7 @@ cmd = (f'gdal_merge'
f' {GEBCO_WORLD_SUBICE_HILLSHADE} {GEBCO_WORLD_ICESURFACE_HILLSHADE}') f' {GEBCO_WORLD_SUBICE_HILLSHADE} {GEBCO_WORLD_ICESURFACE_HILLSHADE}')
run(msg,cmd) run(msg,cmd)
# Arctic # Arctic
msg = 'Creating Arctic Hillshade...' msg = 'Creating Arctic Hillshade...'
cmd = (f'gdaldem' cmd = (f'gdaldem'
...@@ -117,14 +118,8 @@ cmd = (f'gdaldem' ...@@ -117,14 +118,8 @@ cmd = (f'gdaldem'
f' {GEBCO_ARCTIC} {GEBCO_ARCTIC_HILLSHADE}') f' {GEBCO_ARCTIC} {GEBCO_ARCTIC_HILLSHADE}')
run(msg,cmd) run(msg,cmd)
# Antarctic # Antarctic
# Due to ice shelfs there is a very steep drop in the DEM from shelf ice edge
# down to the seabed, which creates hillshade artifacts. To avoid these, the
# Antarctic GEBCO grid will processed twice, once the ice surface DEM and once
# the sub ice topography DEM. The main hillshade is created from the sub ice
# DEM. Then all data above sea level is extracted from the ice surface DEM, a
# hillshade is created for these areas and the sub ice hillshade is replaced
# in these areas.
msg = 'Creating Antarctic ice surface Hillshade...' msg = 'Creating Antarctic ice surface Hillshade...'
cmd = (f'gdaldem' cmd = (f'gdaldem'
f' hillshade' f' hillshade'
......
...@@ -159,23 +159,12 @@ GLIMS_IN = os.path.join(PATH_GLIMS,'glims_polygons.shp') ...@@ -159,23 +159,12 @@ GLIMS_IN = os.path.join(PATH_GLIMS,'glims_polygons.shp')
# latitudes. # latitudes.
# Final AWI Basemap (World) resolution # Final AWI Basemap (World) resolution
# 15 arc seconds (original GEBCO resolution) #RESOLUTION_DEG = 0.004166666666666666 # 15 arc seconds (original GEBCO resolution)
#RESOLUTION_DEG = 0.004166666666666666 RESOLUTION_DEG = 0.008333333333333333 # 30 arc seconds
# 30 arc seconds
RESOLUTION_DEG = 0.008333333333333333
# Final AWI Basemap (Arctic and Antarctic) resolution # Final AWI Basemap (Arctic and Antarctic) resolution
# pendant to 15 arc seconds #RESOLUTION_M = 500.0 # approximate pendant to 15 arc seconds
#RESOLUTION_M = 500.0 RESOLUTION_M = 1000.0 # approximate pendant to 30 arc seconds
# pendant to 30 arc seconds
RESOLUTION_M = 1000.0
# GIMP Resolution
# half the grid resolution
GIMP_RESOLUTION = RESOLUTION_DEG / 2
# Hillshade z factor / vertical exaggeration
Z_FACTOR = 10.0
# Arctic extent down to X degree latitude (positive) # Arctic extent down to X degree latitude (positive)
ARCTIC_EXTENT_LAT = 30.0 ARCTIC_EXTENT_LAT = 30.0
...@@ -183,6 +172,9 @@ ARCTIC_EXTENT_LAT = 30.0 ...@@ -183,6 +172,9 @@ ARCTIC_EXTENT_LAT = 30.0
# Antarctic extent up to X degree latitude (negative) # Antarctic extent up to X degree latitude (negative)
ANTARCTIC_EXTENT_LAT= -30.0 ANTARCTIC_EXTENT_LAT= -30.0
# Hillshade z factor / vertical exaggeration
Z_FACTOR = 10.0
#============================================================================= #=============================================================================
# TEMPORARY FILES # TEMPORARY FILES
...@@ -227,12 +219,14 @@ GEBCO_WORLD_SUBICE_HILLSHADE = os.path.join(PATH_GEBCO,'GEBCO_world_subice_hills ...@@ -227,12 +219,14 @@ GEBCO_WORLD_SUBICE_HILLSHADE = os.path.join(PATH_GEBCO,'GEBCO_world_subice_hills
GEBCO_WORLD = os.path.join(PATH_GEBCO,'GEBCO_world.tif') GEBCO_WORLD = os.path.join(PATH_GEBCO,'GEBCO_world.tif')
GEBCO_WORLD_HILLSHADE = os.path.join(PATH_GEBCO,'GEBCO_world_hillshade.tif') GEBCO_WORLD_HILLSHADE = os.path.join(PATH_GEBCO,'GEBCO_world_hillshade.tif')
# GEBCO Arctic # GEBCO Arctic
GEBCO_ARCTIC_CLIP_VRT = os.path.join(PATH_GEBCO,'GEBCO_arctic_clip.vrt') GEBCO_ARCTIC_CLIP_VRT = os.path.join(PATH_GEBCO,'GEBCO_arctic_clip.vrt')
GEBCO_ARCTIC_FULL_VRT = os.path.join(PATH_GEBCO,'GEBCO_arctic_full.vrt') GEBCO_ARCTIC_FULL_VRT = os.path.join(PATH_GEBCO,'GEBCO_arctic_full.vrt')
GEBCO_ARCTIC = os.path.join(PATH_GEBCO,'GEBCO_arctic.tif') GEBCO_ARCTIC = os.path.join(PATH_GEBCO,'GEBCO_arctic.tif')
GEBCO_ARCTIC_HILLSHADE = os.path.join(PATH_GEBCO,'GEBCO_arctic_hillshade.tif') GEBCO_ARCTIC_HILLSHADE = os.path.join(PATH_GEBCO,'GEBCO_arctic_hillshade.tif')
# GEBCO Antarctic ice surface # GEBCO Antarctic ice surface
GEBCO_ANTARCTIC_ICESURFACE_CLIP_VRT = os.path.join(PATH_GEBCO,'GEBCO_antarctic_icesurface_clip.vrt') GEBCO_ANTARCTIC_ICESURFACE_CLIP_VRT = os.path.join(PATH_GEBCO,'GEBCO_antarctic_icesurface_clip.vrt')
GEBCO_ANTARCTIC_ICESURFACE_FULL_VRT = os.path.join(PATH_GEBCO,'GEBCO_antarctic_icesurface_full.vrt') GEBCO_ANTARCTIC_ICESURFACE_FULL_VRT = os.path.join(PATH_GEBCO,'GEBCO_antarctic_icesurface_full.vrt')
...@@ -310,6 +304,7 @@ CP_GREY = os.path.abspath(os.path.join('..','styles','color_palettes','basemap_g ...@@ -310,6 +304,7 @@ CP_GREY = os.path.abspath(os.path.join('..','styles','color_palettes','basemap_g
#============================================================================= #=============================================================================
# map combinations to be compiled at the end
MAPS = [ MAPS = [
{'name' : 'AWI Basemap World blue', {'name' : 'AWI Basemap World blue',
'grid' : GEBCO_WORLD, 'grid' : GEBCO_WORLD,
...@@ -382,18 +377,10 @@ METADATA_FILE = os.path.join(PATH_RESULT,'AWI_Basemap_Metadata.txt') ...@@ -382,18 +377,10 @@ METADATA_FILE = os.path.join(PATH_RESULT,'AWI_Basemap_Metadata.txt')
# OPERATIONAL PARAMETERS # OPERATIONAL PARAMETERS
#============================================================================= #=============================================================================
# The following settings are operational parameters for the process. If, e.g. # The following settings are operational parameters for the process. If the
# your Python (v3.x) installation has a different executable, like "python3" # temporary GeoTIFFs created by GDAL shall be created with different create
# as it comes with the OSGeo4W Python installation, some scripts need to know # options, they can be adjusted below. The create options for the final
# that and the command needs to be changed here. # results, however, are specified in the last python script.
# And if the temporary GeoTIFFs created by GDAL shall be created with
# different create options, they can be adjusted below. The create options for
# the final results, however, are specified in the last python script.
# Python executable
#PYTHON = 'python'
#PYTHON = 'python3'
PYTHON = sys.executable
# GDAL creation options # GDAL creation options
GDAL_CREATE_OPTIONS = '-co COMPRESS=NONE -co BIGTIFF=IF_NEEDED' GDAL_CREATE_OPTIONS = '-co COMPRESS=NONE -co BIGTIFF=IF_NEEDED'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment