Version:

salvus.flow.collections.event

salvus.flow.collections.event salvus flow collections event
The Salvus Event class.

Classes

Event

An Event collects the point-wise inputs and outputs for a single simulation. Many events will only have a single source but it is possible to have multiple events which, in this case, will fire simultaneously.
SIGNATURE
class Event(builtins.object):
    def __init__(
        self,
        event_name: str | None = None,
        sources: (
            collections.abc.Iterable[simple_config.source._Base]
            | collections.abc.Iterable[dict]
            | simple_config.source._Base
        ),
        receivers: (
            collections.abc.Iterable[simple_config.receiver._Base]
            | collections.abc.Iterable[dict]
            | simple_config.receiver._Base
            | None
        ) = None,
        receiver_channels: (
            collections.abc.Iterable[ReceiverChannel]
            | collections.abc.Iterable[dict]
            | ReceiverChannel
            | None
        ) = None,
    ): ...
ARGUMENTS
Optional
event_name
Type:str | None
Default value:None
Description:
Name of the event. If not given, a name will be generated from the passed sources. For some types of sources the name will be reasonable, for others random.
Required
sources
Type:collections.abc.Iterable[simple_config.source._Base] | collections.abc.Iterable[dict] | simple_config.source._Base
Description:
List of sources for this event.
Optional
receivers
Type:collections.abc.Iterable[simple_config.receiver._Base] | collections.abc.Iterable[dict] | simple_config.receiver._Base | None
Default value:None
Description:
List of receivers for this event.
Optional
receiver_channels
Type:collections.abc.Iterable[ReceiverChannel] | collections.abc.Iterable[dict] | ReceiverChannel | None
Default value:None
Description:
Optionally define one or more receiver channels that can map multiple input receivers to an output channel.

Properties

  • receiver_channels(list[ReceiverChannel])-The receiver channels for this event.
  • receiver_name_list(list[str])-Return a list of receiver names for this event.
  • receivers(list[simple_config.receiver._Base])-The receivers for this event.
  • sources(list[simple_config.source._Base])-The sources for this event.

Methods

Event.expected_components_from_receiver()
Get the expected components from a receiver object and field name.
SIGNATURE
def expected_components_from_receiver(
    receiver: simple_config.receiver._Base | dict, receiver_field: str
) -> list[str]: ...
ARGUMENTS
Required
receiver
Type:simple_config.receiver._Base | dict
Description:
The receiver object or dictionary representation.
Required
receiver_field
Type:str
Description:
The receiver field.
Event.get_receiver()
Returns a receiver object by name.
The receiver name should be NET.STA.LOC - if LOC is omitted it will be assumed to be an empty string.
SIGNATURE
def get_receiver(self, receiver_name: str) -> simple_config.receiver._Base: ...
ARGUMENTS
Required
receiver_name
Type:str
Description:
The name of the receiver.
Event.get_receiver_channel()
Returns a receiver channel object by its identifier.
SIGNATURE
def get_receiver_channel(
    self, receiver_channel_name: str
) -> ReceiverChannel: ...
ARGUMENTS
Required
receiver_channel_name
Type:str
Description:
The name of the receiver channel.
Event.has_receiver()
Figure out if the given receiver is available.
SIGNATURE
def has_receiver(self, receiver_name: str) -> bool: ...
ARGUMENTS
Required
receiver_name
Type:str
Description:
Name of the receiver.
Event.has_receiver_nsl()
Figure out if the given receiver is available.
SIGNATURE
def has_receiver_nsl(
    self, network_code: str, station_code: str, location_code: str
) -> bool: ...
ARGUMENTS
Required
network_code
Type:str
Description:
The network code.
Required
station_code
Type:str
Description:
The station code.
Required
location_code
Type:str
Description:
The location code.

Used in tutorials

Functionality from this module is used in the following tutorials.
PAGE CONTENTS