diff --git a/simpeg_drivers/components/factories/survey_factory.py b/simpeg_drivers/components/factories/survey_factory.py index 589a8de9..2c555372 100644 --- a/simpeg_drivers/components/factories/survey_factory.py +++ b/simpeg_drivers/components/factories/survey_factory.py @@ -294,6 +294,9 @@ def _dcip_arguments(self, data=None, local_index=None): if local_index is not None: receiver_indices = list(set(receiver_indices).intersection(local_index)) + if len(receiver_indices) == 0: + continue + receivers = ReceiversFactory(self.params).build( locations=receiver_locations, local_index=receiver_entity.cells[receiver_indices], diff --git a/simpeg_drivers/utils/utils.py b/simpeg_drivers/utils/utils.py index 0834eb94..41c18b14 100644 --- a/simpeg_drivers/utils/utils.py +++ b/simpeg_drivers/utils/utils.py @@ -661,7 +661,7 @@ def get_containing_cells( locations = data.drape_locations(np.unique(data.locations, axis=0)) xi = np.searchsorted(mesh.nodes_x, locations[:, 0]) - 1 yi = np.searchsorted(mesh.nodes_y, locations[:, -1]) - 1 - inds = xi * mesh.shape_cells[1] + yi + inds = xi + yi * mesh.shape_cells[0] else: raise TypeError("Mesh must be 'TreeMesh' or 'TensorMesh'")