needCalibRegistry: true

camera: ../megacam/camera/
defects: ../megacam/defects

skytiles:
  paddingArcsec: 10.0
  resolutionPix: 700

levels:
  skyTile:
  - visit
  - ccd
  tract: patch
  visit:
  - ccd
  - extension
  - state
  sensor: none

defaultLevel: Ccd

defaultSubLevels:
  visit: Ccd
  skyTile: Ccd
  sensor: none

# exposures and datasets which are needed for all of the mappers are defined
# in the obs_base package (in either exposures.yaml or datasets.yaml).
# Where a modification to such a dataset is required for a particular camera,
# (e.g., for a template or specialized python type), the modification will
# appear below as a partial dataset definition.

exposures:
  raw:
    columns:
    - visit
    - state
    - ccd
    persistable: DecoratedImageF
    python: lsst.afw.image.DecoratedImageF
    template: raw/%(runId)s/%(object)s/%(date)s/%(filter)s/%(visit)d%(state)1s.fits.fz[%(extension)d]
  postISRCCD:
    columns:
    - visit
    - ccd
    template: postISRCCD/%(runId)s/%(object)s/%(date)s/%(filter)s/postISRCCD-%(visit)d-%(ccd)02d.fits
  icExp:
    columns:
    - visit
    - ccd
    template: icExp/%(runId)s/%(object)s/%(date)s/%(filter)s/icExp-%(visit)d-%(ccd)02d.fits
  calexp:
    columns:
    - visit
    - ccd
    template: calexp/%(runId)s/%(object)s/%(date)s/%(filter)s/calexp-%(visit)d-%(ccd)02d.fits
  wcs:  # deprecated in favor of jointcal_wcs, retained to read old outputs
    columns:
    - visit
    - ccd
    persistable: ExposureF
    python: lsst.afw.image.ExposureF
    template: calexp/%(runId)s/%(object)s/%(date)s/%(filter)s/%(tract)d/wcs-%(visit)d-%(ccd)02d.fits
  deepCoadd_directWarp:
    template: deepCoadd/%(filter)s/%(tract)d/%(patch)s/warp-%(filter)s-%(tract)d-%(patch)s-%(visit)d.fits
  deepCoadd_psfMatchedWarp:
    template: deepCoadd/%(filter)s/%(tract)d/%(patch)s/psfMatchedWarp-%(filter)s-%(tract)d-%(patch)s-%(visit)d.fits

calibrations:
  bias:
    columns:
    - taiObs
    - extension
    filter: false
    level: Ccd
    obsTimeName: taiObs
    persistable: DecoratedImageF
    python: lsst.afw.image.DecoratedImageF
    refCols:
    - visit
    - ccd
    - taiObs
    - extension
    reference: raw
    storage: FitsStorage
    tables: bias
    template: '%(path)s[%(extension)d]'
    validEndName: validEnd
    validRange: true
    validStartName: validStart
  dark:
    columns: taiObs
    filter: false
    level: Ccd
    obsTimeName: taiObs
    persistable: DecoratedImageF
    python: lsst.afw.image.DecoratedImageF
    refCols:
    - visit
    - ccd
    - taiObs
    - extension
    reference: raw
    storage: FitsStorage
    tables: dark
    template: '%(path)s[%(extension)d]'
    validEndName: validEnd
    validRange: true
    validStartName: validStart
  flat:
    columns:
    - filter
    - taiObs
    - extension
    filter: true
    level: Ccd
    obsTimeName: taiObs
    persistable: DecoratedImageF
    python: lsst.afw.image.DecoratedImageF
    refCols:
    - visit
    - ccd
    - filter
    - taiObs
    - extension
    reference: raw
    storage: FitsStorage
    tables: flat
    template: '%(path)s[%(extension)d]'
    validEndName: validEnd
    validRange: true
    validStartName: validStart
  fringe:
    columns:
    - filter
    - taiObs
    - extension
    filter: true
    level: Ccd
    obsTimeName: taiObs
    persistable: DecoratedImageF
    python: lsst.afw.image.DecoratedImageF
    refCols:
    - visit
    - ccd
    - filter
    - taiObs
    - extension
    reference: raw
    storage: FitsStorage
    tables: fringe
    template: '%(path)s[%(extension)d]'
    validEndName: validEnd
    validRange: true
    validStartName: validStart

datasets:
  src:
    template: src/%(runId)s/%(object)s/%(date)s/%(filter)s/SRC-%(visit)d-%(ccd)02d.fits
  icMatch:
    persistable: BaseCatalog
    python: lsst.afw.table.BaseCatalog
    storage: FitsCatalogStorage
    tables: raw
    template: icMatch/%(runId)s/%(object)s/%(date)s/%(filter)s/ICMATCH-%(visit)d-%(ccd)02d.fits
  srcMatch:
    template: srcMatch/%(runId)s/%(object)s/%(date)s/%(filter)s/SRCMATCH-%(visit)d-%(ccd)02d.fits
  srcMatchFull:
    template: srcMatch/%(runId)s/%(object)s/%(date)s/%(filter)s/SRCMATCHFULL-%(visit)d-%(ccd)02d.fits
  icSrc:
    template: icSrc/%(runId)s/%(object)s/%(date)s/%(filter)s/ICSRC-%(visit)d-%(ccd)02d.fits
  icExpBackground:
    template: icExp/%(runId)s/%(object)s/%(date)s/%(filter)s/bkgd-%(visit)d-%(ccd)02d.fits
  calexpBackground:
    template: calexp/%(runId)s/%(object)s/%(date)s/%(filter)s/bkgd-%(visit)d-%(ccd)02d.fits
  log:
    persistable: None
    python: str
    storage: TextStorage
    template: logs/%(runId)s/%(object)s/%(date)s/%(filter)s/run.log
  logDir:
    persistable: None
    python: str
    storage: None
    template: logs/%(runId)s/%(object)s/%(date)s/%(filter)s/
  photoCalib:  # deprecated in favor of jointcal_photoCalib, retained for reading old outputs
    template: jointcal-results/%(runId)s/%(object)s/%(date)s/%(filter)s/%(tract)d/photoCalib-%(visit)d-%(ccd)02d.fits
  jointcal_wcs:  # Astrometric calibration produced by meas_mosaic/jointcal
    template: jointcal-results/%(filter)s/%(tract)04d/jointcal_wcs-%(visit)d-%(ccd)02d.fits
  jointcal_photoCalib:  # Photometric calibration produced by meas_mosaic/jointcal
    template: jointcal-results/%(filter)s/%(tract)04d/jointcal_photoCalib-%(visit)d-%(ccd)02d.fits
  processCcd_metadata:
    template: metadata/%(runId)s/%(object)s/%(date)s/%(filter)s/MD-processCcd-%(visit)d-%(ccd)02d.yaml
  isr_config:
    python: lsst.obs.cfht.cfhtIsrTask.CfhtIsrTaskConfig
  isr_metadata:
    template: metadata/%(runId)s/%(object)s/%(date)s/%(filter)s/MD-isr-%(visit)d-%(ccd)02d.yaml
  characterizeImage_metadata:
    template: metadata/%(runId)s/%(object)s/%(date)s/%(filter)s/MD-characterizeImage-%(visit)d-%(ccd)02d.yaml
  calibrate_metadata:
    template: metadata/%(runId)s/%(object)s/%(date)s/%(filter)s/MD-calibrate-%(visit)d-%(ccd)02d.yaml
  deep_safeClipAssembleCoadd_config:
    python: lsst.pipe.tasks.assembleCoadd.AssembleCoaddConfig
  deep_makeCoaddTempExp_metadata:
    template: deep_makeCoaddTempExp_metadat/%(filter)s/%(tract)d/%(patch)s_metadata.yaml
  deep_safeClipAssembleCoadd_metadata:
    template: deep_assembleCoadd_metadata/%(filter)s/%(tract)d/%(patch)s_metadata.yaml
  forced_src:
    template: forced/%(runId)s/%(object)s/%(date)s/%(filter)s/%(tract)d/FORCEDSRC-%(visit)d-%(ccd)02d.fits
  forced_src_schema:
    template: schema/forced_src.fits
  apPipe_metadata:
    template: metadata/%(runId)s/%(object)s/%(date)s/%(filter)s/MD-apPipe-%(visit)d-%(ccd)02d.yaml

  # Detections on coadds

  # Merged detections on coadds

  # Measurements on coadds

  # Reference catalog for coadds

  singleFrameDriver_metadata:
    persistable: PropertySet
    python: lsst.daf.base.PropertySet
    storage: YamlStorage
    tables:
    - raw
    - raw_visit
    template: '%(pointing)05d/%(filter)s/singleFrameDriver_metadata/%(visit)07d.yaml'
