# 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.

tkp.db.monitoringlist._insert_1_to_1_assoc()[source]

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

tkp.db.monitoringlist._insert_new_1_to_1_assoc(image_id)[source]

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

tkp.db.monitoringlist._insert_new_runcat(image_id)[source]

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

tkp.db.monitoringlist._insert_new_runcat_flux(image_id)[source]

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.

tkp.db.monitoringlist._insert_runcat_flux()[source]

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

tkp.db.monitoringlist._insert_tempruncat(image_id)[source]

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.

tkp.db.monitoringlist._update_monitor_runcats(image_id)[source]

Update runcat col of monitor table for newly extracted positions.

tkp.db.monitoringlist.associate_ms(image_id)[source]

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.

tkp.db.monitoringlist.get_monitor_entries(dataset_id)[source]

Returns the monitor entries relevant to this dataset.

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