cgre-aachen/open_AR_Sandbox

Problem with dummy sensor and GemPy module

flohorovicic opened this issue · 3 comments

I created a notebook using the dummy sensor and a loaded topography/ DEM, also in a new branch:

1b3db32

The dummy-sensor and loaded DEM works properly in the topography example, but I obtain a bug when trying with the GemPy module when I run:

main.add_module(name='gempy', module=gpsb) main.run()

sandbox.main_thread: INFO | module gempy added to modules
sandbox.main_thread: INFO | Thread started or resumed...
sandbox.main_thread: CRITICAL | all the input array dimensions for the concatenation axis must match exactly, but along dimension 0, the array at index 0 has size 54496 and the array at index 1 has size 30000
Traceback (most recent call last):
  File "c:\users\cgre_pro-user\git\open_ar_sandbox\sandbox\main_thread.py", line 171, in update
    self.sb_params = self.modules[key].update(self.sb_params)
  File "c:\users\cgre_pro-user\git\open_ar_sandbox\sandbox\modules\gempy\gempy_module.py", line 184, in update
    _ = self.grid.update_grid(scale_frame)
  File "c:\users\cgre_pro-user\git\open_ar_sandbox\sandbox\modules\gempy\utils.py", line 125, in update_grid
    depth_grid = numpy.c_[self.empty_depth_grid, flattened_depth]
  File "C:\Users\CGRE_Pro-User\miniconda3\envs\sandbox-env\lib\site-packages\numpy\lib\index_tricks.py", line 407, in __getitem__
    res = self.concatenate(tuple(objs), axis=axis)
  File "<__array_function__ internals>", line 5, in concatenate
ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 0, the array at index 0 has size 54496 and the array at index 1 has size 30000
Traceback (most recent call last):
  File "c:\users\cgre_pro-user\git\open_ar_sandbox\sandbox\main_thread.py", line 171, in update
    self.sb_params = self.modules[key].update(self.sb_params)
  File "c:\users\cgre_pro-user\git\open_ar_sandbox\sandbox\modules\gempy\gempy_module.py", line 184, in update
    _ = self.grid.update_grid(scale_frame)
  File "c:\users\cgre_pro-user\git\open_ar_sandbox\sandbox\modules\gempy\utils.py", line 125, in update_grid
    depth_grid = numpy.c_[self.empty_depth_grid, flattened_depth]
  File "C:\Users\CGRE_Pro-User\miniconda3\envs\sandbox-env\lib\site-packages\numpy\lib\index_tricks.py", line 407, in __getitem__
    res = self.concatenate(tuple(objs), axis=axis)
  File "<__array_function__ internals>", line 5, in concatenate
ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 0, the array at index 0 has size 54496 and the array at index 1 has size 30000

GemPy runs otherwise... any idea, @danielsk78 ? I am compiling some more example notebooks :-)

Update: I tried to fix the problem by adjusting the sensor width and height (after delving into all the underlying grid settings) with this line:

sensor = Sensor(calibsensor=_calibsensor, name="dummy", width=400, height=416)

This sets the sensor extent according to the loaded DEM and adding the GemPy module then works - but leads to other problems in the projection of the geological model:

image

UPDATE Fixed it :-) Axes swapped - works now with:

sensor = Sensor(calibsensor=_calibsensor, name="dummy", width=450, height=366)

image

Since this issue is solved I will close it now. Feel free to open it at any time.