salvus.flow.collections.event
Classes
Event
Eventclass 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_nameOptional[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.sourcesUnion[Iterable[salvus.flow.simple_config.source._Base], Iterable[Dict], salvus.flow.simple_config.source._Base] — List of sources for this event.receiversOptional[Iterable[salvus.flow.simple_config.receiver._Base], Iterable[Dict], salvus.flow.simple_config.receiver._Base] — List of receivers for this event.receiver_channelsOptional[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]
receiver_channels List[salvus.flow.collections.receiver_channel.ReceiverChannel]The receiver channels for this event.
receiver_name_list List[str]
receiver_name_list List[str]Return a list of receiver names for this event.
receivers List[salvus.flow.simple_config.receiver._Base]
receivers List[salvus.flow.simple_config.receiver._Base]The receivers for this event.
sources List[salvus.flow.simple_config.source._Base]
sources List[salvus.flow.simple_config.source._Base]The sources for this event.
Methods
expected_components_from_receiver()
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
receiverUnion[salvus.flow.simple_config.receiver._Base, Dict] — The receiver object or dictionary representation.receiver_fieldstr — The receiver field.
Returns List[str]
get_receiver()
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_namestr — The name of the receiver.
Returns salvus.flow.simple_config.receiver._Base
has_receiver()
has_receiver()def has_receiver(self, receiver_name: str) -> bool:
...Figure out if the given receiver is available.
Parameters
receiver_namestr — Name of the receiver.
Returns bool
has_receiver_nsl()
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_codestr — The network code.station_codestr — The station code.location_codestr — The location code.
Returns bool