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()
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.
filename_or_objAny — Filename/URL/Python objectdimensionsint — Determines if the function returns 2D or 3D receivers.fieldsList[str] — The fields to output.side_set_namestr — Name of the side set the receivers will be attached to. The default is likely good.axes_a_bTuple[float, float] — Assumed ellipticity of the planet used for converting the latitude. Defaults to the values for the WGS84 ellipsoid.network_codeOptional[str] — Network code needed to parse ObsPy station objects. Likely only needed for the recursive part of this method.
Classes
Point2D
Point2Dclass 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.
longitudefloat — The longitude in degree.depth_in_mfloat — The depth in meters of the receiver.radius_of_sphere_in_mfloat — This class assumes a perfect sphere to derive the cartesian coordinates of the receiver. This is the radius of that sphere.network_codestr — Network code.station_codestr — Station code.location_codestr — Location code.fieldsList[str] — Fields to record.
name str
name strFull receiver name as NETWORK_CODE.STATION_CODE.LOCATION_CODE.
from_json()
from_json()def from_json(d: Dict, skip_validation: bool = False) -> _BaseReceiver: ...Initialize a receiver object from a dictionary.
dDict — Dictionary containing the init parameters and a few other things.skip_validationbool — 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.
apply()
apply()def apply(self, d: Union[Dict, _DeepSetter]) -> None: ...Set the contents with a dictionary.
dUnion[Dict, _DeepSetter] — The dictionary to set.
copy()
copy()def copy(self) -> _DeepSetter: ...Return a deep copy of the object.
get_dictionary()
get_dictionary()def get_dictionary(self) -> Dict: ...Get the contents of this object as a dictionary.
to_json()
to_json()def to_json(self, external_file_hash: Optional[str] = None) -> Dict: ...Serialize the object to dictionary that can be written to JSON.
external_file_hashOptional[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.
validate()
validate()def validate(self) -> None: ...Validates the current state of the configuration against its schema.
Point3D
Point3Dclass 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.
latitudefloat — The latitude in degree.longitudefloat — The longitude in degree.depth_in_mfloat — The depth in meters of the receiver.radius_of_sphere_in_mfloat — This class assumes a perfect sphere to derive the cartesian coordinates of the receiver. This is the radius of that sphere.network_codestr — Network code.station_codestr — Station code.location_codestr — Location code.fieldsList[str] — Fields to record.
name str
name strFull receiver name as NETWORK_CODE.STATION_CODE.LOCATION_CODE.
from_json()
from_json()def from_json(d: Dict, skip_validation: bool = False) -> _BaseReceiver: ...Initialize a receiver object from a dictionary.
dDict — Dictionary containing the init parameters and a few other things.skip_validationbool — 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.
apply()
apply()def apply(self, d: Union[Dict, _DeepSetter]) -> None: ...Set the contents with a dictionary.
dUnion[Dict, _DeepSetter] — The dictionary to set.
copy()
copy()def copy(self) -> _DeepSetter: ...Return a deep copy of the object.
get_dictionary()
get_dictionary()def get_dictionary(self) -> Dict: ...Get the contents of this object as a dictionary.
to_json()
to_json()def to_json(self, external_file_hash: Optional[str] = None) -> Dict: ...Serialize the object to dictionary that can be written to JSON.
external_file_hashOptional[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.
validate()
validate()def validate(self) -> None: ...Validates the current state of the configuration against its schema.
SideSetPoint2D
SideSetPoint2Dclass 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.
longitudefloat — The longitude in degree.depth_in_mfloat — The depth in meters of the receiver below the specified side set.radius_of_sphere_in_mfloat — Planet radius used for the initial guess of the receiver. Can be a really rough estimate.side_set_namestr — Name of the side at which to place the receiver.network_codestr — Network code.station_codestr — Station code.location_codestr — Location code.fieldsList[str] — Fields to record.
name str
name strFull receiver name as NETWORK_CODE.STATION_CODE.LOCATION_CODE.
from_json()
from_json()def from_json(d: Dict) -> Any: ...Recreate the object from a dictionary serialization of its initialization parameters.
dDict — Dictionary containing its init parameters and a few other things.
to_json()
to_json()def to_json(self, external_file_hash: Optional[str] = None) -> Dict: ...Serialize the object to dictionary that can be written to JSON.
external_file_hashOptional[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.
SideSetPoint3D
SideSetPoint3Dclass 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.
latitudefloat — The latitude in degree.longitudefloat — The longitude in degree.depth_in_mfloat — The depth in meters of the receiver below the specified side set.radius_of_sphere_in_mfloat — Planet radius used for the initial guess of the receiver. Can be a really rough estimate.side_set_namestr — Name of the side at which to place the receiver.network_codestr — Network code.station_codestr — Station code.location_codestr — Location code.fieldsList[str] — Fields to record.
name str
name strFull receiver name as NETWORK_CODE.STATION_CODE.LOCATION_CODE.
from_json()
from_json()def from_json(d: Dict) -> Any: ...Recreate the object from a dictionary serialization of its initialization parameters.
dDict — Dictionary containing its init parameters and a few other things.
to_json()
to_json()def to_json(self, external_file_hash: Optional[str] = None) -> Dict: ...Serialize the object to dictionary that can be written to JSON.
external_file_hashOptional[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.
Exceptions
SalvusFlowReceiverParseError
SalvusFlowReceiverParseErrorRaised if a receiver file couldnot be parsed.
SalvusFlowReceiverParseWarning
SalvusFlowReceiverParseWarningRaised if a receiver file couldnot be parsed.