Skip to content

Commit 74d4ddc

Browse files
authored
Merge pull request #203 from MiraGeoscience/GEOPY-2152
GEOPY-2152: Bad referencing to transmitter id name
2 parents 1832850 + 0109b6c commit 74d4ddc

11 files changed

Lines changed: 38 additions & 47 deletions

simpeg_drivers-assets/uijson/induced_polarization_2d_forward.ui.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
"parent": "mesh",
136136
"label": "Value(s)",
137137
"property": "",
138-
"value": 0.0
138+
"value": 0.0001
139139
},
140140
"topography_object": {
141141
"main": true,

simpeg_drivers-assets/uijson/induced_polarization_2d_inversion.ui.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
"parent": "mesh",
155155
"label": "Initial chargeability (V/V)",
156156
"property": "",
157-
"value": 0.0
157+
"value": 0.0001
158158
},
159159
"reference_model": {
160160
"association": "Cell",

simpeg_drivers-assets/uijson/induced_polarization_3d_forward.ui.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"property": "",
6969
"min": 0.0,
7070
"max": 10000.0,
71-
"value": 0.0
71+
"value": 0.0001
7272
},
7373
"topography_object": {
7474
"main": true,

simpeg_drivers-assets/uijson/induced_polarization_3d_inversion.ui.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
"property": "",
9494
"min": 0.0,
9595
"max": 10000.0,
96-
"value": 0.0
96+
"value": 0.0001
9797
},
9898
"reference_model": {
9999
"association": [

simpeg_drivers-assets/uijson/induced_polarization_batch2d_forward.ui.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
"parent": "mesh",
118118
"label": "Value(s)",
119119
"property": "",
120-
"value": 0.001
120+
"value": 0.0001
121121
},
122122
"topography_object": {
123123
"main": true,

simpeg_drivers-assets/uijson/induced_polarization_batch2d_inversion.ui.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
"parent": "mesh",
137137
"label": "Initial chargeability (V/V)",
138138
"property": "",
139-
"value": 0.001
139+
"value": 0.0001
140140
},
141141
"reference_model": {
142142
"association": "Cell",

simpeg_drivers/components/factories/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from .entity_factory import EntityFactory
2020
from .misfit_factory import MisfitFactory
2121
from .simulation_factory import SimulationFactory
22-
from .survey_factory import SurveyFactory, receiver_group
22+
from .survey_factory import SurveyFactory
2323

2424
# pylint: disable=unused-import
2525
# flake8: noqa

simpeg_drivers/components/factories/survey_factory.py

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -33,39 +33,6 @@
3333
from simpeg_drivers.components.factories.source_factory import SourcesFactory
3434

3535

36-
def receiver_group(txi, potential_electrodes):
37-
"""
38-
Group receivers by common transmitter id.
39-
40-
:param: txi : transmitter index number.
41-
:param: potential_electrodes : geoh5py object that holds potential electrodes
42-
ab_map and ab_cell_id for a dc survey.
43-
44-
:return: ids : list of ids of potential electrodes used with transmitter txi.
45-
"""
46-
47-
index_map = potential_electrodes.ab_map()
48-
index_map = {int(v): k for k, v in index_map.items() if v != "Unknown"}
49-
ids = np.where(
50-
potential_electrodes.ab_cell_id.values.astype(int) == index_map[txi]
51-
)[0]
52-
53-
return ids
54-
55-
56-
def group_locations(obj, ids):
57-
"""
58-
Return vertex locations for possible group of cells.
59-
60-
:param obj : geoh5py object containing cells, vertices structure.
61-
:param ids : list of ids (or possibly single id) that indexes cells array.
62-
63-
:return locations : tuple of n locations arrays where n is length of second
64-
dimension of cells array.
65-
"""
66-
return (obj.vertices[obj.cells[ids, i]] for i in range(obj.cells.shape[1]))
67-
68-
6936
class SurveyFactory(SimPEGFactory):
7037
"""Build SimPEG sources objects based on factory type."""
7138

@@ -289,7 +256,9 @@ def _dcip_arguments(self, data=None, local_index=None):
289256
sources = []
290257
self.local_index = []
291258
for source_id in source_ids[np.argsort(order)]: # Cycle in original order
292-
receiver_indices = receiver_group(source_id, receiver_entity)
259+
receiver_indices = np.where(receiver_entity.ab_cell_id.values == source_id)[
260+
0
261+
]
293262

294263
if local_index is not None:
295264
receiver_indices = list(set(receiver_indices).intersection(local_index))

simpeg_drivers/components/topography.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,16 @@ def expand_actives(
164164
neighbours = get_neighbouring_cells(mesh.mesh, containing_cells)
165165
neighbours_xy = np.r_[neighbours[0] + neighbours[1]]
166166

167+
neighbours_xy = neighbours_xy[neighbours_xy != -1]
167168
# Make sure the new actives are connected to the old actives
168169
new_actives = ~active_cells[neighbours_xy]
169170
if np.any(new_actives):
170171
neighbours = get_neighbouring_cells(
171172
mesh.mesh, neighbours_xy[new_actives]
172173
)
173-
active_cells[np.r_[neighbours[2][0]]] = True # z-axis neighbours
174+
neighbours_z = np.r_[neighbours[2][0]]
175+
neighbours_z = neighbours_z[neighbours_z != -1]
176+
active_cells[neighbours_z] = True # z-axis neighbours
174177

175178
active_cells[neighbours_xy] = True # xy-axis neighbours
176179

simpeg_drivers/options.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
ReferencedData,
2828
)
2929
from geoh5py.groups import PropertyGroup, SimPEGGroup, UIJsonGroup
30-
from geoh5py.objects import DrapeModel, Octree, Points
30+
from geoh5py.objects import DrapeModel, Grid2D, Octree, Points
3131
from geoh5py.shared.utils import fetch_active_workspace
3232
from geoh5py.ui_json import InputFile
3333
from pydantic import BaseModel, ConfigDict, field_validator, model_validator
@@ -54,7 +54,7 @@ class ActiveCellsOptions(BaseModel):
5454
model_config = ConfigDict(
5555
arbitrary_types_allowed=True,
5656
)
57-
topography_object: Points | None = None
57+
topography_object: Points | Grid2D | None = None
5858
topography: FloatData | float | None = None
5959
active_model: BooleanData | IntegerData | None = None
6060

0 commit comments

Comments
 (0)