# Gen 3 pipeline for Alert Production

description: End to end AP pipeline
imports:
  - location: $PIPE_TASKS_DIR/pipelines/DRP.yaml
    include:
      - processCcd
tasks:
    imageDifference:
        class: lsst.pipe.tasks.imageDifference.ImageDifferenceTask
        config:
            # Always prefer decorrelation; may eventually become ImageDifferenceTask default
            doDecorrelation: True
            detection.thresholdValue: 5.0  # needed with doDecorrelation
            # Don't have source catalogs for templates
            doSelectSources: False
    diaPipe:
        class: lsst.ap.association.DiaPipelineTask
contracts:
    # DiaPipelineTask needs diaSource fluxes, catalogs, and difference exposures
    - imageDifference.doMeasurement is True
    - imageDifference.doWriteSources is True
    - imageDifference.doWriteSubtractedExp is True
    # Inputs and outputs must match
    - imageDifference.connections.coaddName == diaPipe.connections.coaddName
    - imageDifference.connections.fakesType == diaPipe.connections.fakesType
