FakeN2

class FakeN2 : public kotekan::Stage

Generate fake visibility data into a N2FrameView.

This stage produces fake visibility data that can be used to feed downstream kotekan stages for testing. It fills its buffer with frames in the N2FrameView format. Frames are generated for a set of frequencies and a cadence specified in the config.

Todo:

It might be useful eventually to produce realistic looking mock visibilities.

Buffers

  • out_buf The kotekan buffer which will be fed, can be any size.

    • Format: N2FrameView structured

    • Metadata: N2Metadata

Param num_elements:

Int. The number of elements (i.e. inputs) in the correlator data,

Param num_ev:

Int. The number of eigenvectors to be stored.

Param freq_ids:

List of int. The frequency IDs to generate frames for. Leave empty for 0..num_total_freq-1.

Param num_total_freq:

Int. The total number of frequencies in the system. Used if freq_ids is empty.

Param start_time:

Double. The start time of the range of data (as a Unix time in seconds). This simply changes the time the frames are labelled with. Default is the current time.

Param cadence:

Double. The interval of time (in seconds) between frames.

Param mode:

String. How to fill the visibility array. See the set of FakeVisPattern implementations for details.

Param wait:

Bool. Sleep to try and output data at roughly the correct cadence.

Param num_frames:

Stop after num_frames have been produced (but don’t exit). If less than zero, no limit is applied. Default is -1.

Param zero_weight:

Bool. Set all weights to zero, if this is True. Default is False.

Param frequencies:

Array of UInt32. Definition of frequency IDs for mode ‘test_pattern_freq’.

Param sleep_before:

Float. Sleep for this number of seconds before starting. Useful for allowing other processes to send REST commands. Default is 0s.

Param sleep_after:

Float. Sleep for this number of seconds after running and before shutting down. Useful for allowing other processes to finish. Default is 1s.

Param simulate_fpga_restart_at_frame:

Int. If >= 0, reset the fpga_seq to 0 at this frame index to simulate an FPGA restart. This is useful for testing countCheck. Default is -1 (disabled).

Param end_interrupt:

Bool. If true, call exit_kotekan(CLEAN_EXIT) after num_frames have been generated. Default is false.

Public Functions

FakeN2(kotekan::Config &config, const std::string &unique_name, kotekan::bufferContainer &buffer_container)

Constructor. Loads config options.

virtual void main_thread() override

Primary loop to wait for buffers, stuff in data, mark full, lather, rinse and repeat.