tkp.db.monitoringlist – handling of monitoring sources

A collection of back end subroutines (mostly SQL queries).

This module contains the routines to deal with the monitoring sources, provided by the user via the command line.


The runcat-monitoring pairs are appended to the assocxtrsource (light-curve) table as a type = 9 datapoint.


The forced fits of the monitoring sources which are new are appended to the assocxtrsource (light-curve) table as a type = 8 datapoint.


Insert the fits of the monitoring sources as new sources into the runningcatalog


Insert the fitted fluxes of the monitoring sources as new datapoints into the runningcatalog_flux.

Extractedsources for which not a counterpart was found in the runningcatalog, i.e., those that do not have an entry in the tempruncat table (t0) will be added as a new source in the runningcatalog_flux table.


Monitoring sources that were not yet fitted in this frequency band before, will be appended to it. Those have their first f_datapoint.


Here the associations of forced fits of the monitoring sources and their runningcatalog counterparts are inserted into the temporary table.

We follow the implementation of the normal association procedure, except that we don’t need to match with a De Ruiter radius, since the counterpart pairs are from the same runningcatalog source.


Update runcat col of monitor table for newly extracted positions.


Associate the monitoring sources, i.e., their forced fits, of the current image with the ones in the running catalog. These associations are treated separately from the normal associations and there will only be 1-to-1 associations.

The runcat-monitoring source pairs will be inserted in a temporary table. Of these, the runcat and runcat_flux tables are updated with the new datapoints if the (monitoring) source already existed, otherwise they are inserted as a new source. The source pair is appended to the light-curve table (assocxtrsource), with a type = 8 (for the first occurence) or type = 9 (for existing runcat sources). After all this, the temporary table is emptied again.


Returns the monitor entries relevant to this dataset.

Parameters:dataset_id (int) – Parent dataset.
Returns:list of tuples [(monitor_id, ra, decl)]