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

salvus.flow.collections.event

Classes

Event

class Event(builtins.object):
    def __init__(
        self,
        event_name: Optional[str] = None,
        sources: Union[
            Iterable[salvus.flow.simple_config.source._Base],
            Iterable[Dict],
            salvus.flow.simple_config.source._Base,
        ],
        receivers: Optional[
            Iterable[salvus.flow.simple_config.receiver._Base],
            Iterable[Dict],
            salvus.flow.simple_config.receiver._Base,
        ] = None,
        receiver_channels: Optional[
            Iterable[salvus.flow.collections.receiver_channel.ReceiverChannel],
            Iterable[Dict],
            salvus.flow.collections.receiver_channel.ReceiverChannel,
        ] = 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 Optional[str] — 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 Union[Iterable[salvus.flow.simple_config.source._Base], Iterable[Dict], salvus.flow.simple_config.source._Base] — List of sources for this event.
  • receivers Optional[Iterable[salvus.flow.simple_config.receiver._Base], Iterable[Dict], salvus.flow.simple_config.receiver._Base] — List of receivers for this event.
  • receiver_channels Optional[Iterable[salvus.flow.collections.receiver_channel.ReceiverChannel], Iterable[Dict], salvus.flow.collections.receiver_channel.ReceiverChannel] — Optionally define one or more receiver channels that can map multiple input receivers to an output channel.
Attributes
receiver_channels List[salvus.flow.collections.receiver_channel.ReceiverChannel]

The receiver channels for this event.

receiver_name_list List[str]

Return a list of receiver names for this event.

receivers List[salvus.flow.simple_config.receiver._Base]

The receivers for this event.

sources List[salvus.flow.simple_config.source._Base]

The sources for this event.

Methods
expected_components_from_receiver()
def expected_components_from_receiver(
    receiver: Union[salvus.flow.simple_config.receiver._Base, Dict],
    receiver_field: str,
) -> List[str]:
    ...

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

Parameters
  • receiver Union[salvus.flow.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
) -> salvus.flow.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 salvus.flow.simple_config.receiver._Base
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