Mondaic

salvus.flow.collections.receiver_channel

salvus.flow.collections.receiver_channel salvus flow collections receiver_channel

The definition of the ReceiverChannel class to map multiple point receivers into one output channel.

Classes

ReceiverChannel

class ReceiverChannel(
    salvus.flow.utils.serialization_helpers.SerializationMixin,
    salvus.flow.utils.deep_setters._DeepSetter,
):
    def __init__(
        self,
        identifier: str,
        input_receivers: typing.Sequence[str],
        input_receiver_weights: npt.NDArray[np.float64],
        input_receiver_delays: npt.NDArray[np.float64] | None = 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.

Parameters
  • identifier str — The name/identifier of the receiver channel.
  • input_receivers typing.Sequence[str] — The names/identifiers of all individual receivers making up said channel.
  • input_receiver_weights npt.NDArray[np.float64] — The weight of each input receiver.
  • input_receiver_delays npt.NDArray[np.float64] | None — Optionally define a delay for each receiver in seconds to support beamforming channels.
Methods
from_json()
def from_json(d: dict) -> ReceiverChannel: ...

Initialize a receiver channel object from a dictionary.

Parameters
  • d dict — Dictionary containing the init parameters and a few other things.
Returns ReceiverChannel
apply()
def apply(self, d: dict | _DeepSetter) -> None: ...

Set the contents with a dictionary.

Parameters
  • d dict | _DeepSetter — The dictionary to set.
Returns None
copy()
def copy(self) -> _DeepSetter: ...

Return a deep copy of the object.

Returns _DeepSetter
get_dictionary()
def get_dictionary(self) -> dict: ...

Get the contents of this object as a dictionary.

Returns dict
to_json()
def to_json(
    self,
    external_file_hash: types = None,
    timer: types = None,
    log_to_logger: bool = False,
    comm: types = None,
) -> builtins.dict: ...

Serialize the object to a dictionary that can be written to JSON.

Parameters
  • external_file_hash types — 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.
  • timer types — Execution timer.
  • log_to_logger bool — Log timings to the logger.
  • comm types — MPI communicator, if any.
Returns builtins.dict
validate()
def validate(self) -> None: ...

Validates the current state of the configuration against its schema.

Returns None

Used in tutorials