visTestPattern¶
-
class visTestPattern : public kotekan::Stage¶
Checks if the visibility data matches a given expected pattern (CHIME specific).
This stage is just dropping incoming frames until it receives an update on what data to expect. An update would be sent to the endpoint
/run-test. * This stage will run the test for the given number of frames, then send a request to a reply-endpoint to signal that the test is done. The reply endpoint is expected in the update. In case there was an error during the test, it replies with the error message in the result field. Afterwards it will stay idle until the next test is started.Errors are calculated as the norm of the difference between the expected and the actual (complex) visibility value. For bad frames, the following data is written to a csv file specified in the config: fpga_count: FPGA counter for the frame time: the frames timestamp freq_id: the frames frequency ID num_bad: number of values that have an error higher then the threshold avg_err: average error of bad values min_err: minimum error of bad values max_err: maximum error of bad balues
Additionally a report is printed to the log in a configured interval.
- REST Endpoints
/run-testPOSTUpdates the FPGA test pattern to expect and how long to run a test on that pattern. Required json values: name String. Name of the test. num_frames Int. Number of frames to check for the given test pattern. If this is0, this stage will stay idle until a new update is received. test_pattern Dictionary of String -> (List of uint8). Mapping of correlator input serial number to a list of values for each frequency bin. For example: {‘FCCXXYYZZ: [2048 list of uint8], …}`, where the 2048 uint8 are the real and imaginary component for each frequency bin and FCCXXYYZZ is the serial number of the correlator input. reply_host String. Hostname to send test-done message to. reply_path String. Endpoint path to send test-done message to. reply_port Int. Port to send test-done message to.
- Buffers
in_bufThe buffer to debugFormat: VisBuffer structured
Metadata:
VisMetadata
out_bufAll frames found to contain errorsFormat: VisBuffer structured
Metadata:
VisMetadata
- Author
Rick Nitsche
- Param write_dir:
String. Path to the place to dump all output in.
- Param report_freq:
Int. Number of frames to print a summary for (default: 1000).
- Param tolerance:
Float. Defines what difference to the expected value is an error (default: 1e-6).
- Param endpoint_name:
String. Name for the update endpoint (default: “run_test”).
Public Functions
-
visTestPattern(kotekan::Config &config, const std::string &unique_name, kotekan::bufferContainer &buffer_container)¶
-
~visTestPattern()¶
-
virtual void main_thread() override¶
-
void receive_update(kotekan::connectionInstance &conn, nlohmann::json &data)¶
Callback function to receive updates from configUpdater.