pyPlotN2

class pyPlotN2 : public kotekan::Stage

Consumer kotekan::Stage to produce PDF plots of correlation matrices.

This stage does nothing until it receives a REST request from an outside user. Upon receipt, it spawns a companion python script (pyPlotN2.py), and pipes a short configuration header to it, followed by the contents of the next available buffer. The python script generates a pdf plot of the visibilitiy matrix, saving it to a timestamped file.

Todo:

Make the location of the python plotting script more robust / permanent.

Move config parsing to the constructor.

Spin the triggered dump/executre out into a new thread.

REST Endpoints

  • /plot_corr_matrix/``gpu_id`` Any contact here triggers a plot dump.

Buffers

  • in_buf Buffer containing the data to be plotted. Should be a blocked upper triangle correlation matrix

    • Format: Array of complex uint32_t values.

    • Metadata: none

Author

Keith Vanderlinde

Param gpu_id:

Int, used to generate the REST endpoint, needed in case of multiple streams in a single kotekan stage.

Public Functions

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

Constructor.

virtual ~pyPlotN2()

Destructor, currently does nothing.

virtual void main_thread() override

Creates n safe instances of the file_read_thread thread.

void request_plot_callback(kotekan::connectionInstance &conn)

Function to receive and receive the request for a new plot. Sets a flag informing the main loop to produce a plot of the next available buffer frame.

Warning

Nobody should ever call this directly, it’s only meant to service the RESTful callback.

Parameters:

conn – Connection object requesting the plot. Only used to reply HTTP_RESPONSE::OK.