Skip to content

Commit

Permalink
👽 Use GMT subplot 0-based indexing and full EPSG:3031 proj4 string
Browse files Browse the repository at this point in the history
Couple of minor updates due to upgrade to GMT6.0 stable. The subplots now use 0-based indexing instead of 1-based before since GenericMappingTools/gmt#1315. Also using full PROJ4 string for EPSG:3031 in data_prep.save_array_to_grid as GMT conda now pulls in GDAL 3.0 instead of 2.4 before, and that causes problems with rasterio's CRS as it can't find the gcs.csv file (see e.g. rasterio/rasterio#1787), possibly a problem because we use pypi rasterio wheels that have built-in GDAL 2.4 binaries? Newer rasterio versions up to 1.1.1 don't work either, I've tried...
  • Loading branch information
weiji14 committed Dec 6, 2019
1 parent 2cb394c commit a29be06
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion data_prep.ipynb
Expand Up @@ -1422,7 +1422,7 @@
" window_bound: tuple, # bounding box in format (minx, miny, maxx, maxy)\n",
" array: np.ndarray, # must be in CHW format (channel, height, width)\n",
" save_netcdf: bool = False, # whether to also save a NetCDF file\n",
" crs: str = \"EPSG:3031\", # projected coordinate system to use\n",
" crs: str = \"+proj=stere +lat_0=-90 +lat_ts=-71 +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs\", # projected coordinate system to use\n",
" dtype: str = None, # data type to use e.g. np.float32, default inferred from array\n",
" nodataval: float = -2000, # what to use as NaN, hardcoded default to -2000m\n",
" tiled: bool = False, # store data arranged in square tiles, default is False\n",
Expand Down
2 changes: 1 addition & 1 deletion data_prep.py
Expand Up @@ -766,7 +766,7 @@ def save_array_to_grid(
window_bound: tuple, # bounding box in format (minx, miny, maxx, maxy)
array: np.ndarray, # must be in CHW format (channel, height, width)
save_netcdf: bool = False, # whether to also save a NetCDF file
crs: str = "EPSG:3031", # projected coordinate system to use
crs: str = "+proj=stere +lat_0=-90 +lat_ts=-71 +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs", # projected coordinate system to use
dtype: str = None, # data type to use e.g. np.float32, default inferred from array
nodataval: float = -2000, # what to use as NaN, hardcoded default to -2000m
tiled: bool = False, # store data arranged in square tiles, default is False
Expand Down
8 changes: 4 additions & 4 deletions deepbedmap.ipynb
Expand Up @@ -671,28 +671,28 @@
"subplot(directive=\"begin\", row=2, col=2, A=\"+jCT+o-4c/-5c\", Fs=\"9c/9c\", M=\"2c/3c\")\n",
"plot_3d_view(\n",
" img=\"model/deepbedmap3.nc\", # DeepBedMap\n",
" ax=(1, 1),\n",
" ax=(0, 0),\n",
" zmin=-1400,\n",
" title=\"DeepBedMap\", # ours\n",
" zlabel=\"Bed elevation (metres)\",\n",
")\n",
"plot_3d_view(\n",
" img=\"model/cubicbedmap.nc\", # BEDMAP2\n",
" ax=(1, 2),\n",
" ax=(0, 1),\n",
" zmin=-1400,\n",
" title=\"BEDMAP2\",\n",
" zlabel=\"Bed elevation (metres)\",\n",
")\n",
"plot_3d_view(\n",
" img=\"model/elevdiffmap.nc\", # DeepBedMap - BEDMAP2\n",
" ax=(2, 1),\n",
" ax=(1, 0),\n",
" zmin=-400,\n",
" title=\"Elevation Diff\",\n",
" zlabel=\"Difference (metres)\",\n",
")\n",
"plot_3d_view(\n",
" img=\"model/synthetichr.nc\", # Synthetic High Resolution product\n",
" ax=(2, 2),\n",
" ax=(1, 1),\n",
" zmin=-1400,\n",
" title=\"Synthetic HRES\",\n",
" zlabel=\"Bed elevation (metres)\",\n",
Expand Down
8 changes: 4 additions & 4 deletions deepbedmap.py
Expand Up @@ -452,28 +452,28 @@ def load_trained_model(
subplot(directive="begin", row=2, col=2, A="+jCT+o-4c/-5c", Fs="9c/9c", M="2c/3c")
plot_3d_view(
img="model/deepbedmap3.nc", # DeepBedMap
ax=(1, 1),
ax=(0, 0),
zmin=-1400,
title="DeepBedMap", # ours
zlabel="Bed elevation (metres)",
)
plot_3d_view(
img="model/cubicbedmap.nc", # BEDMAP2
ax=(1, 2),
ax=(0, 1),
zmin=-1400,
title="BEDMAP2",
zlabel="Bed elevation (metres)",
)
plot_3d_view(
img="model/elevdiffmap.nc", # DeepBedMap - BEDMAP2
ax=(2, 1),
ax=(1, 0),
zmin=-400,
title="Elevation Diff",
zlabel="Difference (metres)",
)
plot_3d_view(
img="model/synthetichr.nc", # Synthetic High Resolution product
ax=(2, 2),
ax=(1, 1),
zmin=-1400,
title="Synthetic HRES",
zlabel="Bed elevation (metres)",
Expand Down

0 comments on commit a29be06

Please sign in to comment.