Mondaic

salvus.flow.collections.event

salvus.flow.collections.event salvus flow collections event

The Salvus Event class.

Classes

Event

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,
    ): ...

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.

Parameters
  • event_name str | None — 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.
  • sources collections.abc.Iterable[simple_config.source._Base] | collections.abc.Iterable[dict] | simple_config.source._Base — List of sources for this event.
  • receivers collections.abc.Iterable[simple_config.receiver._Base] | collections.abc.Iterable[dict] | simple_config.receiver._Base | None — List of receivers for this event.
  • receiver_channels collections.abc.Iterable[ReceiverChannel] | collections.abc.Iterable[dict] | ReceiverChannel | None — Optionally define one or more receiver channels that can map multiple input receivers to an output channel.
Attributes
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
expected_components_from_receiver()
def expected_components_from_receiver(
    receiver: simple_config.receiver._Base | dict, receiver_field: str
) -> list[str]: ...

Get the expected components from a receiver object and field name.

Parameters
  • receiver simple_config.receiver._Base | dict — The receiver object or dictionary representation.
  • receiver_field str — The receiver field.
Returns list[str]
get_receiver()
def get_receiver(self, receiver_name: str) -> simple_config.receiver._Base: ...

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.

Parameters
  • receiver_name str — The name of the receiver.
Returns simple_config.receiver._Base
get_receiver_channel()
def get_receiver_channel(
    self, receiver_channel_name: str
) -> ReceiverChannel: ...

Returns a receiver channel object by its identifier.

Parameters
  • receiver_channel_name str — The name of the receiver channel.
Returns ReceiverChannel
has_receiver()
def has_receiver(self, receiver_name: str) -> bool: ...

Figure out if the given receiver is available.

Parameters
  • receiver_name str — Name of the receiver.
Returns bool
has_receiver_nsl()
def has_receiver_nsl(
    self, network_code: str, station_code: str, location_code: str
) -> bool: ...

Figure out if the given receiver is available.

Parameters
  • network_code str — The network code.
  • station_code str — The station code.
  • location_code str — The location code.
Returns bool

Used in tutorials