applyGains¶
-
class applyGains : public kotekan::Stage¶
Receives gains and apply them to the output buffer.
This stage registers as a subscriber to an updatable config block. The full name of the block should be defined in the value
updatable_blockGain updates must match the frequencies expected to be present in the input stream. That is there must be exactly as many frequencies in the gain update as there are in the
freqStateattached to the input stream. The number of elements must also match those on the incoming stream.The number of frequencies and inputs is locked in
- Buffers
in_bufThe input stream.Format: VisBuffer.
Metadata:
VisMetadata
out_bufThe output stream.Format: VisBuffer.
Metadata:
VisMetadata
- Metrics
kotekan_applygains_late_update_countThe number of updates received too late (The start time of the update is older than the currently processed frame).kotekan_applygains_late_frame_countThe number of frames received late (The frames timestamp is older then all start times of stored updates).kotekan_applygains_update_age_secondsThe time difference in seconds between the current frame being processed and the time stamp of the gains update being applied.
- Author
Mateus Fandino, Tristan Pinsonneault-Marotte and Richard Shaw
- Param num_elements:
Int. The number of elements (i.e. inputs) in the correlator data.
- Param updatable_block:
String. The full name of the updatable_block that will provide new flagging values (e.g. “/dynamic_block/gains”).
- Param gains_dir:
String. The path to the directory holding the gains file.
- Param broker_host:
String. Calibration broker host.
- Param broker_port:
Int. Calibration broker port.
- Param read_from_file:
Bool, default false. Whether to read the gains from file or fetch them over the network.
- Param tcombine:
Double. Time (in seconds) over which to combine old and new gains to prevent discontinuities. Default is 5 minutes.
- Param num_kept_updates:
Int. The number of gain updates stored in a FIFO.
- Param num_threads:
Int. Number of threads to run. Default is 1.
Public Functions
-
applyGains(kotekan::Config &config, const std::string &unique_name, kotekan::bufferContainer &buffer_container)¶
Default constructor.
-
virtual void main_thread() override¶
Main loop for the stage.
-
bool receive_update(nlohmann::json &json)¶
Callback function to receive updates on timestamps from configUpdater.