Skip to content
Open
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
10 changes: 6 additions & 4 deletions omf/fileio/geoh5.py
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ def collect_h5_attributes(
Legend(values=StringArray(array=labels)),
Legend(
values=ColorArray(
array=element.entity_type.color_map.values[ # type: ignore
array=element.entity_type.color_map.values.T[ # type: ignore
1:-1, ind:
]
.astype(int)
Expand Down Expand Up @@ -921,10 +921,12 @@ def collect_h5_attributes(
with fetch_active_workspace(workspace):
if getattr(element.entity_type, "color_map", None) is not None:
cmap = element.entity_type.color_map # type: ignore
ind = np.argsort(cmap.values[0, :])
values = cmap.values[0, ind]

array = cmap.values.T
ind = np.argsort(array[0, :])
values = array[0, ind]
limits = [values[0], values[-1]]
colors = cmap.values[1:-1, ind] # Drop val and alpha
colors = array[1:-1, ind] # Drop val and alpha

if colors.shape[1] != 128:
new_vals = np.linspace(limits[0], limits[1], 128)
Expand Down
Loading
Loading