An error on regional gravity inversion

Hi everyone,

For the following codes, I have an error. Do you have any idea:

Compute the source field

receiver_list = gravity.receivers.Point(receiver_locations, components=[“gz”])
receiver_list = [receiver_list]
srcField = gravity.sources.SourceField(receiver_list==receiver_list)

Error:


ValidationError Traceback (most recent call last)
Input In [35], in <cell line: 2>()
1 receiver_list = [receiver_list]
----> 2 srcField = gravity.sources.SourceField(receiver_list==receiver_list)

File ~\anaconda3\lib\site-packages\properties\base\base.py:280, in PropertyMetaclass.call(cls, *args, **kwargs)
278 with handlers.listeners_disabled():
279 obj._reset()
→ 280 obj.init(*args, **kwargs)
281 return obj

File ~\anaconda3\lib\site-packages\SimPEG\potential_fields\gravity\sources.py:10, in SourceField.init(self, receiver_list, **kwargs)
9 def init(self, receiver_list=None, **kwargs):
—> 10 super(SourceField, self).init(receiver_list=receiver_list, **kwargs)

File ~\anaconda3\lib\site-packages\SimPEG\survey.py:222, in BaseSrc.init(self, receiver_list, location, **kwargs)
220 super(BaseSrc, self).init(**kwargs)
221 if receiver_list is not None:
→ 222 self.receiver_list = receiver_list
223 if location is not None:
224 self.location = location

File ~\anaconda3\lib\site-packages\properties\basic.py:676, in Property.get_property..fset(self, value)
674 “”“Validate value and call the HasProperties _set method”“”
675 if value is not undefined:
→ 676 value = scope.validate(self, value)
677 self._set(scope.name, value)

File ~\anaconda3\lib\site-packages\properties\base\containers.py:410, in List.validate(self, instance, value)
409 def validate(self, instance, value):
→ 410 value = super(List, self).validate(instance, value)
411 if not self.observe_mutations:
412 return value

File ~\anaconda3\lib\site-packages\properties\base\containers.py:268, in Tuple.validate(self, instance, value)
262 “”“Check the class of the container and validate each element
263
264 This returns a copy of the container to prevent unwanted sharing of
265 pointers.
266 “””
267 if not self.coerce and not isinstance(value, self._class_container):
→ 268 self.error(instance, value)
269 if self.coerce and not isinstance(value, CONTAINERS):
270 value = [value]

File ~\anaconda3\lib\site-packages\properties\basic.py:356, in GettableProperty.error(self, instance, value, error_class, extra)
345 message = (
346 '{prefix} must be {info}. An invalid value of {val} {vtype} was ’
347 ‘specified.{extra}’.format(
(…)
353 )
354 )
355 if issubclass(error_class, ValidationError):
→ 356 raise error_class(message, ‘invalid’, self.name, instance)
357 raise error_class(message)

ValidationError: The List property ‘receiver_list’ of a SourceField instance must be a list (each item is an instance of BaseRx). An invalid value of True <class ‘bool’> was specified.

Hi @VTeknik ,

I answered on Slack, but also here in case you did catch it.
Looks like you are creating a bool with putting one too many = in your input.

srcField = gravity.sources.SourceField(receiver_list=receiver_list)