Mondaic
This API reference is not for the latest stable Salvus version.

salvus.flow.simple_config.receiver.seismology

Receivers in a seismological context.

Specifically this means:

  • Coordinates are specified in latitude, longitude, and burrial beneath the local subsurface.
  • The rotation matrices will be set so that the output of SalvusCompute will be in ZNE (vertical, north, and east) which corresponds to most seismological instruments.

For 2D the latitude will ignored and only the longitude will be assumed. This is the default polar coordinate system with:

  • x = r * cos(phi)
  • y = r * sin(phi)

phi is the longitude here.

Functions

parse()

def parse(
    filename_or_obj: Any,
    dimensions: int,
    fields: List[str],
    side_set_name: str = "r1",
    axes_a_b: Tuple[float, float] = (6378137.0, 6356752.314245),
    network_code: Optional[str] = None,
) -> List[
    Union[
        salvus.flow.simple_config.receiver.seismology.SideSetPoint2D,
        salvus.flow.simple_config.receiver.seismology.SideSetPoint3D,
    ]
]: ...

Attempts to parse anything to a list of either :class:.SideSetPoint2D or :class:.SideSetPoint3D objects.

Supports pretty much everything ObsPy supports, ranging from StationXML files, SEED files, SAC files, to ObsPy’s custom objects from filenames, URLs, memory files, …

Coordinates, by default, are assumed to be defined on the WGS84 ellipsoid and will be converted to geocentric coordinates. This can be influenced with the axes_a_b parameter.

Parameters
  • filename_or_obj Any — Filename/URL/Python object
  • dimensions int — Determines if the function returns 2D or 3D receivers.
  • fields List[str] — The fields to output.
  • side_set_name str — Name of the side set the receivers will be attached to. The default is likely good.
  • axes_a_b Tuple[float, float] — Assumed ellipticity of the planet used for converting the latitude. Defaults to the values for the WGS84 ellipsoid.
  • network_code Optional[str] — Network code needed to parse ObsPy station objects. Likely only needed for the recursive part of this method.
Returns List[Union[salvus.flow.simple_config.receiver.seismology.SideSetPoint2D, salvus.flow.simple_config.receiver.seismology.SideSetPoint3D]] — A list of locatable side set receivers.

Classes

Point2D

class Point2D(
    salvus.flow.simple_config.coordinate_system_utils._SeismologyBase,
    salvus.flow.simple_config.receiver._BaseReceiver,
):
    def __init__(
        self,
        longitude: float,
        depth_in_m: float = 0.0,
        radius_of_sphere_in_m: float = 6371000.0,
        network_code: str = "XX",
        station_code: str,
        location_code: str = "",
        fields: List[str],
    ): ...

2-D seismological receiver.

Parameters
  • longitude float — The longitude in degree.
  • depth_in_m float — The depth in meters of the receiver.
  • radius_of_sphere_in_m float — This class assumes a perfect sphere to derive the cartesian coordinates of the receiver. This is the radius of that sphere.
  • network_code str — Network code.
  • station_code str — Station code.
  • location_code str — Location code.
  • fields List[str] — Fields to record.
Attributes
name str

Full receiver name as NETWORK_CODE.STATION_CODE.LOCATION_CODE.

Methods
from_json()
def from_json(d: Dict, skip_validation: bool = False) -> _BaseReceiver: ...

Initialize a receiver object from a dictionary.

Parameters
  • d Dict — Dictionary containing the init parameters and a few other things.
  • skip_validation bool — For the cartesian Point2D and Point3D this method contains a special fast implementation that skips all validation steps. Useful for reading large quantities of pre-validated receivers.
Returns _BaseReceiver
apply()
def apply(self, d: Union[Dict, _DeepSetter]) -> None: ...

Set the contents with a dictionary.

Parameters
  • d Union[Dict, _DeepSetter] — The dictionary to set.
Returns None
copy()
def copy(self) -> _DeepSetter: ...

Return a deep copy of the object.

Returns _DeepSetter
get_dictionary()
def get_dictionary(self) -> Dict: ...

Get the contents of this object as a dictionary.

Returns Dict
to_json()
def to_json(self, external_file_hash: Optional[str] = None) -> Dict: ...

Serialize the object to dictionary that can be written to JSON.

Parameters
  • external_file_hash Optional[str] — Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file.
Returns Dict
validate()
def validate(self) -> None: ...

Validates the current state of the configuration against its schema.

Returns None

Point3D

class Point3D(
    salvus.flow.simple_config.coordinate_system_utils._SeismologyBase,
    salvus.flow.simple_config.receiver._BaseReceiver,
):
    def __init__(
        self,
        latitude: float,
        longitude: float,
        depth_in_m: float = 0.0,
        radius_of_sphere_in_m: float = 6371000.0,
        network_code: str = "XX",
        station_code: str,
        location_code: str = "",
        fields: List[str],
    ): ...

3-D seismological receiver.

Parameters
  • latitude float — The latitude in degree.
  • longitude float — The longitude in degree.
  • depth_in_m float — The depth in meters of the receiver.
  • radius_of_sphere_in_m float — This class assumes a perfect sphere to derive the cartesian coordinates of the receiver. This is the radius of that sphere.
  • network_code str — Network code.
  • station_code str — Station code.
  • location_code str — Location code.
  • fields List[str] — Fields to record.
Attributes
name str

Full receiver name as NETWORK_CODE.STATION_CODE.LOCATION_CODE.

Methods
from_json()
def from_json(d: Dict, skip_validation: bool = False) -> _BaseReceiver: ...

Initialize a receiver object from a dictionary.

Parameters
  • d Dict — Dictionary containing the init parameters and a few other things.
  • skip_validation bool — For the cartesian Point2D and Point3D this method contains a special fast implementation that skips all validation steps. Useful for reading large quantities of pre-validated receivers.
Returns _BaseReceiver
apply()
def apply(self, d: Union[Dict, _DeepSetter]) -> None: ...

Set the contents with a dictionary.

Parameters
  • d Union[Dict, _DeepSetter] — The dictionary to set.
Returns None
copy()
def copy(self) -> _DeepSetter: ...

Return a deep copy of the object.

Returns _DeepSetter
get_dictionary()
def get_dictionary(self) -> Dict: ...

Get the contents of this object as a dictionary.

Returns Dict
to_json()
def to_json(self, external_file_hash: Optional[str] = None) -> Dict: ...

Serialize the object to dictionary that can be written to JSON.

Parameters
  • external_file_hash Optional[str] — Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file.
Returns Dict
validate()
def validate(self) -> None: ...

Validates the current state of the configuration against its schema.

Returns None

SideSetPoint2D

class SideSetPoint2D(
    salvus.flow.simple_config.coordinate_system_utils._SeismologyBase,
    salvus.flow.simple_config.receiver.cartesian.SideSetPoint2D,
):
    def __init__(
        self,
        longitude: float,
        depth_in_m: float = 0.0,
        radius_of_sphere_in_m: float = 6371000.0,
        side_set_name: str,
        network_code: str = "XX",
        station_code: str,
        location_code: str = "",
        fields: List[str],
    ): ...

2-D seismological side-set receiver.

Parameters
  • longitude float — The longitude in degree.
  • depth_in_m float — The depth in meters of the receiver below the specified side set.
  • radius_of_sphere_in_m float — Planet radius used for the initial guess of the receiver. Can be a really rough estimate.
  • side_set_name str — Name of the side at which to place the receiver.
  • network_code str — Network code.
  • station_code str — Station code.
  • location_code str — Location code.
  • fields List[str] — Fields to record.
Attributes
name str

Full receiver name as NETWORK_CODE.STATION_CODE.LOCATION_CODE.

Methods
from_json()
def from_json(d: Dict) -> Any: ...

Recreate the object from a dictionary serialization of its initialization parameters.

Parameters
  • d Dict — Dictionary containing its init parameters and a few other things.
Returns Any
to_json()
def to_json(self, external_file_hash: Optional[str] = None) -> Dict: ...

Serialize the object to dictionary that can be written to JSON.

Parameters
  • external_file_hash Optional[str] — Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file.
Returns Dict

SideSetPoint3D

class SideSetPoint3D(
    salvus.flow.simple_config.coordinate_system_utils._SeismologyBase,
    salvus.flow.simple_config.receiver.cartesian.SideSetPoint3D,
):
    def __init__(
        self,
        latitude: float,
        longitude: float,
        depth_in_m: float = 0.0,
        radius_of_sphere_in_m: float = 6371000.0,
        side_set_name: str,
        network_code: str = "XX",
        station_code: str,
        location_code: str = "",
        fields: List[str],
    ): ...

3-D seismological side-set receiver.

Parameters
  • latitude float — The latitude in degree.
  • longitude float — The longitude in degree.
  • depth_in_m float — The depth in meters of the receiver below the specified side set.
  • radius_of_sphere_in_m float — Planet radius used for the initial guess of the receiver. Can be a really rough estimate.
  • side_set_name str — Name of the side at which to place the receiver.
  • network_code str — Network code.
  • station_code str — Station code.
  • location_code str — Location code.
  • fields List[str] — Fields to record.
Attributes
name str

Full receiver name as NETWORK_CODE.STATION_CODE.LOCATION_CODE.

Methods
from_json()
def from_json(d: Dict) -> Any: ...

Recreate the object from a dictionary serialization of its initialization parameters.

Parameters
  • d Dict — Dictionary containing its init parameters and a few other things.
Returns Any
to_json()
def to_json(self, external_file_hash: Optional[str] = None) -> Dict: ...

Serialize the object to dictionary that can be written to JSON.

Parameters
  • external_file_hash Optional[str] — Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file.
Returns Dict

Exceptions

SalvusFlowReceiverParseError

Raised if a receiver file couldnot be parsed.

SalvusFlowReceiverParseWarning

Raised if a receiver file couldnot be parsed.

Submodules