Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions simpeg_drivers/components/factories/directives_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
from typing import TYPE_CHECKING

import numpy as np
from geoh5py.data.data_type import ColorMap, DataType
from geoh5py.groups.property_group import GroupTypeEnum
from geoh5py.objects import PotentialElectrode
from matplotlib import colormaps
from numpy import sqrt
from simpeg import directives, maps
from simpeg.utils.mat_utils import cartesian2amplitude_dip_azimuth
Expand Down Expand Up @@ -422,6 +424,19 @@ def assemble_keyword_arguments(
active_cells_map,
inversion_object.permutation.T,
]
data_type = DataType.find_or_create_type(
self.params.geoh5,
"FLOAT",
)
angles = np.linspace(0, 1, 90)
colormap = np.c_[angles * 360, colormaps["twilight"](angles) * 255]
data_type.color_map = ColorMap(name="twilight.TBL", values=colormap)
Comment thread
domfournier marked this conversation as resolved.
kwargs["data_type"] = {
"": {
"declination": data_type,
"inclination": data_type,
}
Comment thread
domfournier marked this conversation as resolved.
}

if self.factory_type in [
"apparent conductivity",
Expand Down
5 changes: 4 additions & 1 deletion tests/run_tests/driver_mvi_pde_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,17 @@ def test_mvi_pde_run(
driver.run()

if pytest:
with Workspace(driver.params.geoh5.h5file):
with Workspace(driver.params.geoh5.h5file) as ws:
# Re-open the workspace and get iterations
output = get_inversion_output(
driver.params.geoh5.h5file, driver.params.out_group.uid
)
output["data"] = orig_tmi
check_target(output, target_mvi_pde_run)

angle_model = ws.get_entity("Iteration_5_declination_model")[0]
assert angle_model.entity_type.color_map.name == "twilight.TBL"


if __name__ == "__main__":
# Full run
Expand Down
Loading