def test_widgets_with_arucos(): from sandbox.sensor import Sensor from sandbox.markers import MarkerDetection from sandbox import _calibration_dir, _test_data sensor = Sensor(calibsensor=_calibration_dir + 'sensorcalib.json', name='kinect_v2') aruco = MarkerDetection(sensor=sensor) color = np.load(_test_data['test'] + 'frame1.npz')['arr_1'] geo_model = create_example_model(name='Anticline') module = GemPyModule(geo_model=geo_model, extent=sensor.extent, box=[1000, 800], load_examples=True, name_example=['Horizontal_layers']) module.setup(sensor.get_frame()) pytest.sb_params['marker'] = aruco.update(frame=color) sb_params = module.update(pytest.sb_params) sb_params['fig'].show() module.set_section_dict((10, 10), (500, 500), "Section1") module.set_section_dict((100, 100), (500, 10), "Section2") module.set_borehole_dict((500, 500), "borehole3") module.set_borehole_dict((900, 500), "borehole4") module._get_polygon_data() aruco.plot_aruco(sb_params['ax'], sb_params['marker']) sb_params['fig'].show() widgets = module.show_widgets() widgets.show()
def test_section_dictionaries_cross_section(): geo_model = create_example_model('Horizontal_layers') module = GemPyModule(geo_model=geo_model, extent=extent, box=[1000, 800], load_examples=False) module.setup(frame) module.set_section_dict((10, 10), (500, 500), "Section1") module.set_section_dict((100, 100), (500, 10), "Section2") module.show_actual_model() assert module.section_dict == { 'Model: Horizontal_layers': ([0.0, 500.0], [1000.0, 500.0], [150, 100]), 'Section1': ([10, 10], [500, 500], [150, 100]), 'Section2': ([100, 100], [500, 10], [150, 100]), } module.remove_section_dict("Section2") assert module.section_dict == { 'Model: Horizontal_layers': ([0.0, 500.0], [1000.0, 500.0], [150, 100]), 'Section1': ([10, 10], [500, 500], [150, 100]) }
def test_cross_section_widgets(): geo_model = create_example_model('Horizontal_layers') module = GemPyModule(geo_model=geo_model, extent=extent, box=[1000, 800], load_examples=False) module.setup(frame) module.set_section_dict((10, 10), (500, 500), "Section1") module.set_section_dict((100, 100), (500, 10), "Section2") widget = module.widget_cross_sections() widget.show()
def test_plot_cross_sections(): geo_model = create_example_model('Horizontal_layers') module = GemPyModule(geo_model=geo_model, extent=extent, box=[1000, 800], load_examples=False) sb_params = module.update(pytest.sb_params) sb_params['fig'].show() module.set_section_dict((10, 10), (500, 500), "Section1") module.set_section_dict((100, 100), (500, 10), "Section2") module.show_actual_model() module.show_section_traces() module.show_cross_section("Section1") module.show_cross_section("Section2") module.show_geological_map()
def test_widgets(): module = GemPyModule(geo_model=None, extent=extent, box=[1000, 800], load_examples=True) module.setup(frame) #fig, ax = plt.subplots() #depth, ax, size, cmap, norm, df = module.update(frame, ax, extent) module.setup(frame) module.set_section_dict((10, 10), (500, 500), "Section1") module.set_section_dict((100, 100), (500, 10), "Section2") module.set_borehole_dict((500, 500), "borehole3") module.set_borehole_dict((900, 500), "borehole4") widgets = module.show_widgets() widgets.show()