Exemplo n.º 1
0
def associate_nd(image_id):
    """
    Associate the null detections (ie forced fits) of the current image.

    They will be inserted in a temporary table, which contains the
    associations of the forced fits with the running catalog sources.
    Also, the forced fits are appended to the assocxtrsource (light-curve)
    table. The runcat_flux table is updated with the new datapoints if it
    already existed, otherwise it is inserted as a new datapoint.
    (We leave the runcat table unchanged.)
    After all this, the temporary table is emptied again.
    """

    _del_tempruncat()
    _insert_tempruncat(image_id)
    _insert_1_to_1_assoc()
    _increment_forcedfits_count()

    n_updated = _update_1_to_1_runcat_flux()
    if n_updated:
        logger.debug("Updated flux for %s null_detections" % n_updated)
    n_inserted = _insert_1_to_1_runcat_flux()
    if n_inserted:
        logger.debug(
            "Inserted new-band flux measurement for %s null_detections" %
            n_inserted)
    _del_tempruncat()
Exemplo n.º 2
0
def associate_nd(image_id):
    """
    Associate the null detections (ie forced fits) of the current image.

    They will be inserted in a temporary table, which contains the
    associations of the forced fits with the running catalog sources.
    Also, the forced fits are appended to the assocxtrsource (light-curve)
    table. The runcat_flux table is updated with the new datapoints if it
    already existed, otherwise it is inserted as a new datapoint.
    (We leave the runcat table unchanged.)
    After all this, the temporary table is emptied again.
    """

    _del_tempruncat()
    _insert_tempruncat(image_id)
    _insert_1_to_1_assoc()

    n_updated = _update_1_to_1_runcat_flux()
    if n_updated:
        logger.debug("Updated flux for %s null_detections" % n_updated)
    n_inserted = _insert_1_to_1_runcat_flux()
    if n_inserted:
        logger.debug("Inserted new-band flux measurement for %s null_detections"
                    % n_inserted)
    _del_tempruncat()
Exemplo n.º 3
0
def associate_ms(image_id):
    """
    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.
    """

    _del_tempruncat()

    _insert_tempruncat(image_id)

    _insert_1_to_1_assoc()
    _update_1_to_1_runcat()

    n_updated = _update_1_to_1_runcat_flux()
    if n_updated:
        logger.debug("Updated flux for %s monitor sources" % n_updated)
    n_inserted = _insert_1_to_1_runcat_flux()
    if n_inserted:
        logger.debug(
            "Inserted new-band flux measurement for %s monitor sources" %
            n_inserted)

    _insert_new_runcat(image_id)
    _insert_new_runcat_flux(image_id)

    _insert_new_1_to_1_assoc(image_id)

    _update_monitor_runcats(image_id)

    _del_tempruncat()
Exemplo n.º 4
0
def associate_ms(image_id):
    """
    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.
    """

    _del_tempruncat()
    _insert_tempruncat(image_id)
    #+-------------------------------------------------------------+
    #| First, we process the monitoring sources that are already   |
    #| known by position in the runningcatalog. Note that a source |
    #| might be known by position, but is new in a frequency band. |
    #+-------------------------------------------------------------+
    _update_runcat()
    _update_runcat_flux() # update flux in existing band
    _insert_runcat_flux() # insert flux for new band
    _insert_1_to_1_assoc()
    #+-------------------------------------------------------------+
    #| Then we process the new sources, i.e., those that           |
    #| were fitted for the first time.                             |
    #+-------------------------------------------------------------+
    _insert_new_runcat(image_id)
    _insert_new_runcat_flux(image_id)
    _insert_new_1_to_1_assoc(image_id)
    _del_tempruncat()