lsst.synpipe  20.0.0+19
Functions | Variables
lsst.synpipe.matchFakes Namespace Reference

Functions

def combineWithForce (meas, force)
 
def getMag (flux, fluxerr, zeropoint)
 
def getEllipse (quad)
 
def matchToFakeCatalog (sources, fakeCatalog)
 
def getFakeMatchesHeader (cal_md, sources, tol=1.0)
 
def getFakeMatchesRaDec (sources, radecCatFile, bbox, wcs, tol=1.0, reffMatch=False, pix=0.168, minRad=None, raCol='RA', decCol='Dec')
 
def getFakeSources (butler, dataId, tol=1.0, extraCols=('zeropoint', 'visit', 'ccd'), includeMissing=False, footprints=False, radecMatch=None, multiband=False, reffMatch=False, pix=0.168, minRad=None, raCol='RA', decCol='Dec')
 
def getAstroTable (src, mags=True)
 
def returnMatchSingle (butler, slist, visit, ccd, filt=None, tol=1.0, pix=0.168, fakeCat=None, pixMatch=False, multiband=False, reffMatch=False, includeMissing=True, minRad=None, raCol='RA', decCol='Dec')
 
def returnMatchTable (rootDir, visit, ccdList, outfile=None, fakeCat=None, overwrite=False, filt=None, tol=1.0, pixMatch=False, multiband=False, reffMatch=False, pix=0.168, multijobs=1, includeMissing=True, minRad=None, raCol='RA', decCol='Dec')
 

Variables

 NO_FOOTPRINT = lsst.afw.table.SOURCE_IO_NO_FOOTPRINTS
 
 parser = argparse.ArgumentParser()
 
 help
 
 type
 
 dest
 
 default
 
 nargs
 
 False
 
 action
 
 float
 
 args = parser.parse_args()
 
 fakeCat
 
 overwrite
 
 ow
 
 filt
 
 tol
 
 multiband
 
 reffMatch
 
 multijobs
 
 minRad
 
 raCol
 
 decCol
 

Detailed Description

matchFakes.py.

Matches fakes based on position stored in the calibrated exposure image header

Function Documentation

◆ combineWithForce()

def lsst.synpipe.matchFakes.combineWithForce (   meas,
  force 
)
Combine the meas and forced_src catalogs.

Definition at line 23 of file matchFakes.py.

◆ getAstroTable()

def lsst.synpipe.matchFakes.getAstroTable (   src,
  mags = True 
)
Return an astropy table with all the src entries.

if the entries are complex objects, it breaks them down:
  ellipse entries are broken into
       ellipse_a = semi-major axis
       ellipse_q = axis ratio (always < 1)
       ellipse_theta = rotation of semi-major axis
                       from chip x-axis in degrees
if mags is True, returns the magnitudes for all the flux columns

Definition at line 393 of file matchFakes.py.

◆ getEllipse()

def lsst.synpipe.matchFakes.getEllipse (   quad)
Return the Re, b/a and PA for a given quadrupole moment.

Definition at line 88 of file matchFakes.py.

◆ getFakeMatchesHeader()

def lsst.synpipe.matchFakes.getFakeMatchesHeader (   cal_md,
  sources,
  tol = 1.0 
)
Return the fake matches based on the information in the header.

returns a tuple with:
the positions in pixels of the fake sources added to the chip
the match is in a dictionary of the form:
    {fakeid:[ind_of_match_in_sources,...],...}

look within a tolerance of 1 pixel in each direction

Definition at line 116 of file matchFakes.py.

◆ getFakeMatchesRaDec()

def lsst.synpipe.matchFakes.getFakeMatchesRaDec (   sources,
  radecCatFile,
  bbox,
  wcs,
  tol = 1.0,
  reffMatch = False,
  pix = 0.168,
  minRad = None,
  raCol = 'RA',
  decCol = 'Dec' 
)
Return the fake matches based on an radec match.

Args:
    sources: source table object
    radecCatFile: filename for fits file of fake object table,
                  including ra/dec
    bbox: Bounding Box of exposure (ccd or patch) within which
          to match fakes
    wcs: Wcs of source image

KeywordArgs:
    tol: tolerance within which to match sources, given in PIXELS

Returns:
    fakeXY: set of pixel positions of fake sources
    srcIdx: matches to fake sources in a dictionary of the form
    {fakeid:[ind_of_match_in_sources,...],...}

Raise:
    IOError: couldn't open radecCatFile

Definition at line 146 of file matchFakes.py.

◆ getFakeSources()

def lsst.synpipe.matchFakes.getFakeSources (   butler,
  dataId,
  tol = 1.0,
  extraCols = ('zeropoint', 'visit', 'ccd'),
  includeMissing = False,
  footprints = False,
  radecMatch = None,
  multiband = False,
  reffMatch = False,
  pix = 0.168,
  minRad = None,
  raCol = 'RA',
  decCol = 'Dec' 
)
Get list of sources which agree in pixel position with fake ones with tol.

This returns a sourceCatalog of all the matched fake objects,
note, there will be duplicates in this list, since I haven't
checked deblend.nchild, and I'm only doing a tolerance match,
which could include extra sources

The outputs can include extraCols as long as they are one of:
    zeropoint, visit, ccd, thetaNorth, pixelScale

If includeMissing is true, then the pipeline looks at the fake sources
added in the header and includes an entry in the table for sources without
any measurements, specifically the 'id' column will be 0

radecMatch is the fakes table. if it's not None(default), then do an ra/dec
match with the input catalog instead of looking in the header for where the
sources where added

Definition at line 215 of file matchFakes.py.

◆ getMag()

def lsst.synpipe.matchFakes.getMag (   flux,
  fluxerr,
  zeropoint 
)
Return the magnitude and error.

Definition at line 81 of file matchFakes.py.

◆ matchToFakeCatalog()

def lsst.synpipe.matchFakes.matchToFakeCatalog (   sources,
  fakeCatalog 
)
Match to the fake catalog and append those columns to the source table.

this assumes the sources are an astropy table
or it will throw a TypeError

Definition at line 100 of file matchFakes.py.

◆ returnMatchSingle()

def lsst.synpipe.matchFakes.returnMatchSingle (   butler,
  slist,
  visit,
  ccd,
  filt = None,
  tol = 1.0,
  pix = 0.168,
  fakeCat = None,
  pixMatch = False,
  multiband = False,
  reffMatch = False,
  includeMissing = True,
  minRad = None,
  raCol = 'RA',
  decCol = 'Dec' 
)
Return matched catalog for each CCD or Patch.

Definition at line 469 of file matchFakes.py.

◆ returnMatchTable()

def lsst.synpipe.matchFakes.returnMatchTable (   rootDir,
  visit,
  ccdList,
  outfile = None,
  fakeCat = None,
  overwrite = False,
  filt = None,
  tol = 1.0,
  pixMatch = False,
  multiband = False,
  reffMatch = False,
  pix = 0.168,
  multijobs = 1,
  includeMissing = True,
  minRad = None,
  raCol = 'RA',
  decCol = 'Dec' 
)
Driver (main function) for return match to fakes.

INPUT: rootDir = rerun directory
       visit = visit id (int) (or tracts)
       ccdList = list of ccds to look at (or patches)
       outdir = output directory for matched file,
                None means no output written
       fakeCat = fake catalog to match to,
                 None means the fake sources are just
                 extracted from the header of the CCDs based on
                 position but no matching is done
       overwrite = whether to overwrite the existing output file,
                   default is False
       pixMatch = do pixel matching instead of ra/dec matching
                  even if there is a catalog supplied
       multiband = whether match to forced photometry catalogs
                   from multiband process
       reffMatch = whether match fake sources in pixel radius
                   or using tol x Reff (Only for Ra, Dec match)
OUTPUT: returns an astropy.table.Table with all the entries
        from the source catalog for objects which match in pixel
        position to the fake sources

Definition at line 511 of file matchFakes.py.

Variable Documentation

◆ action

lsst.synpipe.matchFakes.action

Definition at line 626 of file matchFakes.py.

◆ args

lsst.synpipe.matchFakes.args = parser.parse_args()

Definition at line 647 of file matchFakes.py.

◆ decCol

lsst.synpipe.matchFakes.decCol

Definition at line 655 of file matchFakes.py.

◆ default

lsst.synpipe.matchFakes.default

Definition at line 619 of file matchFakes.py.

◆ dest

lsst.synpipe.matchFakes.dest

Definition at line 617 of file matchFakes.py.

◆ fakeCat

lsst.synpipe.matchFakes.fakeCat

Definition at line 650 of file matchFakes.py.

◆ False

lsst.synpipe.matchFakes.False

Definition at line 626 of file matchFakes.py.

◆ filt

lsst.synpipe.matchFakes.filt

Definition at line 650 of file matchFakes.py.

◆ float

lsst.synpipe.matchFakes.float

Definition at line 635 of file matchFakes.py.

◆ help

lsst.synpipe.matchFakes.help

Definition at line 613 of file matchFakes.py.

◆ minRad

lsst.synpipe.matchFakes.minRad

Definition at line 654 of file matchFakes.py.

◆ multiband

lsst.synpipe.matchFakes.multiband

Definition at line 651 of file matchFakes.py.

◆ multijobs

lsst.synpipe.matchFakes.multijobs

Definition at line 653 of file matchFakes.py.

◆ nargs

lsst.synpipe.matchFakes.nargs

Definition at line 620 of file matchFakes.py.

◆ NO_FOOTPRINT

lsst.synpipe.matchFakes.NO_FOOTPRINT = lsst.afw.table.SOURCE_IO_NO_FOOTPRINTS

Definition at line 20 of file matchFakes.py.

◆ overwrite

lsst.synpipe.matchFakes.overwrite

Definition at line 650 of file matchFakes.py.

◆ ow

lsst.synpipe.matchFakes.ow

Definition at line 650 of file matchFakes.py.

◆ parser

lsst.synpipe.matchFakes.parser = argparse.ArgumentParser()

Definition at line 612 of file matchFakes.py.

◆ raCol

lsst.synpipe.matchFakes.raCol

Definition at line 655 of file matchFakes.py.

◆ reffMatch

lsst.synpipe.matchFakes.reffMatch

Definition at line 652 of file matchFakes.py.

◆ tol

lsst.synpipe.matchFakes.tol

Definition at line 651 of file matchFakes.py.

◆ type

lsst.synpipe.matchFakes.type

Definition at line 616 of file matchFakes.py.