Okay, so..
I’m using the read_dcip_xyz() function for a 3D DCIP inversion and run into issues with the number of sources vs receivers generated.
The actual survey was completed using a Pole-Dipole array, where the B electrode is located at ‘infinity’, i.e., far away from the survey site.
When running dc_simulation.dpred(starting_conductivity_model), I get the following error:
File C:\anaconda\Lib\site-packages\simpeg\simulation.py:195, in BaseSimulation.dpred(self, m, f)
193 for rx in src.receiver_list:
194 src_rx_slice = survey_slices[src, rx]
--> 195 dpred[src_rx_slice] = mkvc(rx.eval(src, self.mesh, f))
196 return mkvc(dpred)
ValueError: could not broadcast input array from shape (36,) into shape (6,)
Looking at that source, I see 6 associated receivers:
In [21]: src
Out[21]: Dipole(a: [4.9074050e+05 6.7348901e+06 7.3039350e+02]; b: [4.9224050e+05 6.7353901e+06 7.3039350e+02])
In [22]: src.receiver_list
Out[22]:
Dipole(m: [4.9094050e+05 6.7349901e+06 7.3039350e+02]; n: [4.9084050e+05 6.7349901e+06 7.3039350e+02]),
Dipole(m: [4.9064050e+05 6.7349901e+06 7.3039350e+02]; n: [4.9064050e+05 6.7349901e+06 7.3039350e+02]),
Dipole(m: [4.9064050e+05 6.7349901e+06 7.3039350e+02]; n: [4.9054050e+05 6.7349901e+06 7.3039350e+02]),
Dipole(m: [4.9054050e+05 6.7349901e+06 7.3039350e+02]; n: [4.9054050e+05 6.7349901e+06 7.3039350e+02]),
Dipole(m: [4.9054050e+05 6.7349901e+06 7.3039350e+02]; n: [4.9044050e+05 6.7349901e+06 7.3039350e+02]),
Dipole(m: [4.9044050e+05 6.7349901e+06 7.3039350e+02]; n: [4.9044050e+05 6.7349901e+06 7.3039350e+02])
I can get around this issue by manually assigning each receiver to the appropriate source:
def flatten_survey(survey):
new_sources = []
for src in survey.source_list:
for rx in src.receiver_list:
# Each rx contain multiple MN pairs
for i in range(rx.locations_m.shape[0]):
# One measurement per receiver
m = rx.locations_m[i : i+1]
n = rx.locations_n[i : i+1]
new_rx = dc.receivers.Dipole(locations_m=m, locations_n=n, data_type=rx.data_type)
# Build a new source with just this one receiver
new_sources.append(dc.sources.Dipole([new_rx], src.location_a, src.location_b))
# Create a new survey from the flattened sources
return dc.Survey(new_sources)
Turning:
In [1]: dc_simulation.survey
Out[1]: Survey(#sources: 167; #data: 4757)
Into:
In [1]: dc_simulation.survey
Out[1]: Survey(#sources: 4757; #data: 4757)
But I think this is having a significant impact on computation time.
If anyone has any tips, or if I’m approaching this the wrong, way, the help would be greatly appreciated.