LSSTApplications  8.0.0.0+107,8.0.0.1+13,9.1+18,9.2,master-g084aeec0a4,master-g0aced2eed8+6,master-g15627eb03c,master-g28afc54ef9,master-g3391ba5ea0,master-g3d0fb8ae5f,master-g4432ae2e89+36,master-g5c3c32f3ec+17,master-g60f1e072bb+1,master-g6a3ac32d1b,master-g76a88a4307+1,master-g7bce1f4e06+57,master-g8ff4092549+31,master-g98e65bf68e,master-ga6b77976b1+53,master-gae20e2b580+3,master-gb584cd3397+53,master-gc5448b162b+1,master-gc54cf9771d,master-gc69578ece6+1,master-gcbf758c456+22,master-gcec1da163f+63,master-gcf15f11bcc,master-gd167108223,master-gf44c96c709
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 193 of file diaSourceAnalysis.py.

194 def main():
195  """Main program"""
196  options, args = parseOptions()
197  (crDiffSourceFile, crDiffExposureFile) = args
198 
199  crDiffSources = readSourceSet(crDiffSourceFile)
200  crDiffExposure = afwImage.ExposureF(crDiffExposureFile)
201  #import pdb; pdb.set_trace()
202 
203  analyst = DiaSourceAnalyst()
204 
205  expX0 = crDiffExposure.getX0()
206  expY0 = crDiffExposure.getY0()
207  expX1 = expX0 + crDiffExposure.getWidth() - 1
208  expY1 = expY0 + crDiffExposure.getHeight() - 1
209 
210  for i in range(crDiffSources.size()):
211  crDiffSource = crDiffSources[i]
212 
213  # This segfaults; revisit once the stack stabilizes
214  #footprint = crDiffSource.getFootprint()
215  #bbox = footprint.getBBox()
216 
217  xAstrom = crDiffSource.getXAstrom()
218  yAstrom = crDiffSource.getYAstrom()
219  Ixx = max(1.0, crDiffSource.getIxx())
220  Iyy = max(1.0, crDiffSource.getIyy())
221  x0 = max(expX0, int(xAstrom - scaling * Ixx))
222  x1 = min(expX1, int(xAstrom + scaling * Ixx))
223  y0 = max(expY0, int(yAstrom - scaling * Iyy))
224  y1 = min(expY1, int(yAstrom + scaling * Iyy))
225  bbox = afwGeom.Box2I(afwGeom.Point2I(x0, y0),
226  afwGeom.Point2I(x1, y1))
227  subExp = afwImage.ExposureF(crDiffExposure, bbox)
228  subMi = subExp.getMaskedImage()
229  imArr, maArr, varArr = subMi.getArrays()
230 
231  if analyst.testSource(crDiffSource, subMi):
232  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 41 of file diaSourceAnalysis.py.

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

Definition at line 52 of file diaSourceAnalysis.py.

52 
53 def readSourceSet(boostFile):
54  loc = dafPersist.LogicalLocation(boostFile)
55  storageList = dafPersist.StorageList()
56  additionalData = dafBase.PropertySet()
57  persistence = dafPersist.Persistence.getPersistence(pexPolicy.Policy())
58  storageList.append(persistence.getRetrieveStorage("BoostStorage", loc))
59  psvptr = persistence.unsafeRetrieve("PersistableSourceVector", storageList, additionalData)
60  psv = afwDet.PersistableSourceVector.swigConvert(psvptr)
61  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 39 of file diaSourceAnalysis.py.