LSSTApplications  1.1.2+25,10.0+13,10.0+132,10.0+133,10.0+224,10.0+41,10.0+8,10.0-1-g0f53050+14,10.0-1-g4b7b172+19,10.0-1-g61a5bae+98,10.0-1-g7408a83+3,10.0-1-gc1e0f5a+19,10.0-1-gdb4482e+14,10.0-11-g3947115+2,10.0-12-g8719d8b+2,10.0-15-ga3f480f+1,10.0-2-g4f67435,10.0-2-gcb4bc6c+26,10.0-28-gf7f57a9+1,10.0-3-g1bbe32c+14,10.0-3-g5b46d21,10.0-4-g027f45f+5,10.0-4-g86f66b5+2,10.0-4-gc4fccf3+24,10.0-40-g4349866+2,10.0-5-g766159b,10.0-5-gca2295e+25,10.0-6-g462a451+1
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
double min
Definition: attributes.cc:216
double max
Definition: attributes.cc:218
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.