LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Classes | Functions | Variables
lsst.ip.diffim.diaSourceAnalysis Namespace Reference

Classes

class  DiaSourceAnalystConfig
 
class  DiaSourceAnalyst
 

Functions

def parseOptions
 
def readSourceSet
 
def main
 

Variables

int scaling = 5
 

Function Documentation

def lsst.ip.diffim.diaSourceAnalysis.main ( )
Main program
Examples:
footprintFunctor.cc, forEachPixel.cc, image1.cc, image2.cc, imageStatistics.cc, maskedImage1.cc, maskedImage2.cc, spatialCellExample.cc, splineInterpolate.cc, and statistics.cc.

Definition at line 192 of file diaSourceAnalysis.py.

193 def main():
194  """Main program"""
195  options, args = parseOptions()
196  (crDiffSourceFile, crDiffExposureFile) = args
197 
198  crDiffSources = readSourceSet(crDiffSourceFile)
199  crDiffExposure = afwImage.ExposureF(crDiffExposureFile)
200  #import pdb; pdb.set_trace()
201 
202  analyst = DiaSourceAnalyst()
203 
204  expX0 = crDiffExposure.getX0()
205  expY0 = crDiffExposure.getY0()
206  expX1 = expX0 + crDiffExposure.getWidth() - 1
207  expY1 = expY0 + crDiffExposure.getHeight() - 1
208 
209  for i in range(crDiffSources.size()):
210  crDiffSource = crDiffSources[i]
211 
212  # This segfaults; revisit once the stack stabilizes
213  #footprint = crDiffSource.getFootprint()
214  #bbox = footprint.getBBox()
215 
216  xAstrom = crDiffSource.getXAstrom()
217  yAstrom = crDiffSource.getYAstrom()
218  Ixx = max(1.0, crDiffSource.getIxx())
219  Iyy = max(1.0, crDiffSource.getIyy())
220  x0 = max(expX0, int(xAstrom - scaling * Ixx))
221  x1 = min(expX1, int(xAstrom + scaling * Ixx))
222  y0 = max(expY0, int(yAstrom - scaling * Iyy))
223  y1 = min(expY1, int(yAstrom + scaling * Iyy))
224  bbox = afwGeom.Box2I(afwGeom.Point2I(x0, y0),
225  afwGeom.Point2I(x1, y1))
226  subExp = afwImage.ExposureF(crDiffExposure, bbox)
227  subMi = subExp.getMaskedImage()
228  imArr, maArr, varArr = subMi.getArrays()
229 
230  if analyst.testSource(crDiffSource, subMi):
231  ds9.mtv(subExp, frame=1)
raw_input('Next: ')
An integer coordinate rectangle.
Definition: Box.h:53
def lsst.ip.diffim.diaSourceAnalysis.parseOptions ( )
Parse the command line options.

Definition at line 40 of file diaSourceAnalysis.py.

40 
41 def parseOptions():
42  """Parse the command line options."""
43  parser = OptionParser(
44  usage="""%prog cdDiffSources crDiffExposure
45 
46 Read in sources and test for junk""")
47  options, args = parser.parse_args()
48  if len(args) != 2:
49  parser.error("incorrect number of arguments")
50  return options, args
def lsst.ip.diffim.diaSourceAnalysis.readSourceSet (   boostFile)

Definition at line 51 of file diaSourceAnalysis.py.

51 
52 def readSourceSet(boostFile):
53  loc = dafPersist.LogicalLocation(boostFile)
54  storageList = dafPersist.StorageList()
55  additionalData = dafBase.PropertySet()
56  persistence = dafPersist.Persistence.getPersistence(pexPolicy.Policy())
57  storageList.append(persistence.getRetrieveStorage("BoostStorage", loc))
58  psvptr = persistence.unsafeRetrieve("PersistableSourceVector", storageList, additionalData)
59  psv = afwDet.PersistableSourceVector.swigConvert(psvptr)
60  return psv.getSources()
Class for logical location of a persisted Persistable instance.
a container for holding hierarchical configuration data in memory.
Definition: Policy.h:169
Class for storing generic metadata.
Definition: PropertySet.h:82

Variable Documentation

int lsst.ip.diffim.diaSourceAnalysis.scaling = 5

Definition at line 38 of file diaSourceAnalysis.py.