salvus.flow.collections.receiver_channel
The definition of the ReceiverChannel class to map multiple point receivers into one output channel.
Classes
ReceiverChannel
ReceiverChannelclass ReceiverChannel(
salvus.flow.utils.serialization_helpers.SerializationMixin,
salvus.flow.utils.deep_setters._DeepSetter,
):
def __init__(
self,
identifier: str,
input_receivers: Sequence[str],
input_receiver_weights: numpy.ndarray,
input_receiver_delays: Optional[numpy.ndarray] = None,
):
...A receiver channel mapping multiple point receivers to a single output channel.
Each output component of that channel will be a weighted, normalized sum of each input component.
CHANNEL[COMPONENT_A] = ( input_receiver_weights[0] * get_data(input_receivers[0])[COMPONENT_A] + input_receiver_weights[1] * get_data(input_receivers[1])[COMPONENT_A] + input_receiver_weights[2] * get_data(input_receivers[2])[COMPONENT_A] + … ) / sum(input_receiver_weights)
Optionally, the individual input components can be time-shifted before summation to support beamforming channels. Each receiver is time-shifted according to input_receiver_delays.
identifierstr — The name/identifier of the receiver channel.input_receiversSequence[str] — The names/identifiers of all individual receivers making up said channel.input_receiver_weightsnumpy.ndarray — The weight of each input receiver.input_receiver_delaysOptional[numpy.ndarray] — Optionally define a delay for each receiver in seconds to support beamforming channels.
from_json()
from_json()def from_json(d: Dict) -> ReceiverChannel:
...Initialize a receiver channel object from a dictionary.
dDict — Dictionary containing the init parameters and a few other things.
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.