This is an automated email from the ASF dual-hosted git repository. rkk pushed a commit to branch tmp-stv in repository https://gitbox.apache.org/repos/asf/sdap-nexus.git
commit 77400c846ed0fd606a635abafcc3ccd7679209f2 Author: rileykk <[email protected]> AuthorDate: Thu Jun 27 14:45:51 2024 -0700 Fix for tomo 3d basemap being inverted by latitude --- analysis/webservice/algorithms/Tomogram3D.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/analysis/webservice/algorithms/Tomogram3D.py b/analysis/webservice/algorithms/Tomogram3D.py index 2436474..d64e7ad 100644 --- a/analysis/webservice/algorithms/Tomogram3D.py +++ b/analysis/webservice/algorithms/Tomogram3D.py @@ -19,6 +19,7 @@ import random from io import BytesIO from os.path import join from tempfile import TemporaryDirectory +from urllib.parse import urlencode import matplotlib as mpl import matplotlib.pyplot as plt @@ -604,7 +605,7 @@ class Tomogram3DResults(NexusResults): url = 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/export' - logger.info('Pulling basemap') + logger.info(f'Pulling basemap ({url}?{urlencode(params)})') try: elevations = results[['elevation']].values @@ -617,7 +618,7 @@ class Tomogram3DResults(NexusResults): buf = BytesIO(r.content) img = Image.open(buf) - img_data = np.array(img) + img_data = np.flipud(np.array(img)) lats = np.linspace(min_lat, max_lat, num=img.height) lons = np.linspace(min_lon, max_lon, num=img.width) @@ -743,7 +744,7 @@ class Tomogram3DResults(NexusResults): url = 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/export' - logger.info('Pulling basemap') + logger.info(f'Pulling basemap ({url}?{urlencode(params)})') try: elevations = results[['elevation']].values @@ -756,7 +757,7 @@ class Tomogram3DResults(NexusResults): buf = BytesIO(r.content) img = Image.open(buf) - img_data = np.array(img) + img_data = np.flipud(np.array(img)) lats = np.linspace(min_lat, max_lat, num=img.height) lons = np.linspace(min_lon, max_lon, num=img.width)
