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.pipe.tasks.mocks.simpleMapper Namespace Reference

Classes

class  PersistenceType
 
class  BypassPersistenceType
 
class  ExposurePersistenceType
 
class  SkyMapPersistenceType
 
class  CatalogPersistenceType
 
class  SimpleCatalogPersistenceType
 
class  SourceCatalogPersistenceType
 
class  ExposureCatalogPersistenceType
 
class  SimpleMapping
 
class  RawMapping
 
class  SkyMapping
 
class  TempExpMapping
 
class  ForcedSrcMapping
 
class  MapperMeta
 
class  SimpleMapper
 

Functions

def makeSimpleCamera
 
def makeDataRepo
 

Variables

tuple __all__ = ("SimpleMapper", "makeSimpleCamera", "makeDataRepo")
 

Function Documentation

def lsst.pipe.tasks.mocks.simpleMapper.makeDataRepo (   root)
Create a data repository for SimpleMapper and return a butler for it.

Clobbers anything already in the given path.

Definition at line 408 of file simpleMapper.py.

409 def makeDataRepo(root):
410  """
411  Create a data repository for SimpleMapper and return a butler for it.
412 
413  Clobbers anything already in the given path.
414  """
415  if os.path.exists(root):
416  shutil.rmtree(root)
417  os.makedirs(root)
418  with open(os.path.join(root, "_mapper"), "w") as f:
419  f.write("lsst.pipe.tasks.mocks.SimpleMapper\n")
420  return lsst.daf.persistence.Butler(root=root)
def lsst.pipe.tasks.mocks.simpleMapper.makeSimpleCamera (   nX,
  nY,
  sizeX,
  sizeY,
  gapX,
  gapY,
  pixelSize = 1.0,
  plateScale = 20.0,
  radialDistortion = 0.925 
)
Create a camera

@param[in] nx: number of detectors in x
@param[in] ny: number of detectors in y
@param[in] sizeX: detector size in x (pixels)
@param[in] sizeY: detector size in y (pixels)
@param[in] gapX: gap between detectors in x (mm)
@param[in] gapY: gap between detectors in y (mm)
@param[in] pixelSize: pixel size (mm) (a float)
@param[in] plateScale: plate scale in arcsec/mm; 20.0 is for LSST
@param[in] radialDistortion: radial distortion, in mm/rad^2
    (the r^3 coefficient of the radial distortion polynomial
    that converts PUPIL in radians to FOCAL_PLANE in mm);
    0.925 is the value Dave Monet measured for lsstSim data

Each detector will have one amplifier (with no raw information).

Definition at line 353 of file simpleMapper.py.

354 ):
355  """Create a camera
356 
357  @param[in] nx: number of detectors in x
358  @param[in] ny: number of detectors in y
359  @param[in] sizeX: detector size in x (pixels)
360  @param[in] sizeY: detector size in y (pixels)
361  @param[in] gapX: gap between detectors in x (mm)
362  @param[in] gapY: gap between detectors in y (mm)
363  @param[in] pixelSize: pixel size (mm) (a float)
364  @param[in] plateScale: plate scale in arcsec/mm; 20.0 is for LSST
365  @param[in] radialDistortion: radial distortion, in mm/rad^2
366  (the r^3 coefficient of the radial distortion polynomial
367  that converts PUPIL in radians to FOCAL_PLANE in mm);
368  0.925 is the value Dave Monet measured for lsstSim data
369 
370  Each detector will have one amplifier (with no raw information).
371  """
372  pScaleRad = lsst.afw.geom.arcsecToRad(plateScale)
373  radialDistortCoeffs = [0.0, 1.0/pScaleRad, 0.0, radialDistortion/pScaleRad]
374  focalPlaneToPupil = lsst.afw.geom.RadialXYTransform(radialDistortCoeffs)
375  nativeSys = lsst.afw.cameraGeom.FOCAL_PLANE
376  transforms = {
377  lsst.afw.cameraGeom.PUPIL: focalPlaneToPupil,
378  }
379  transformMap = lsst.afw.cameraGeom.CameraTransformMap(nativeSys, transforms)
380 
381  detectorList = []
383  for iY in range(nY):
384  cY = (iY - 0.5 * (nY - 1)) * (pixelSize * sizeY + gapY)
385  for iX in range(nX):
386  cX = (iX - 0.5 * (nX - 1)) * (pixelSize * sizeY + gapX)
387  fpPos = lsst.afw.geom.Point2D(cX, cY)
388  detectorName = "detector %d,%d" % (iX, iY)
389  detectorId = len(detectorList) + 1
390  detectorList.append(DetectorWrapper(
391  name = detectorName,
392  id = detectorId,
393  serial = detectorName + " serial",
394  bbox = ccdBBox,
395  ampExtent = ccdBBox.getDimensions(),
396  numAmps = 1,
397  pixelSize = lsst.afw.geom.Extent2D(pixelSize, pixelSize),
398  orientation = lsst.afw.cameraGeom.Orientation(fpPos),
399  plateScale = plateScale,
400  radialDistortion = radialDistortion,
401  ).detector)
402 
403  return lsst.afw.cameraGeom.Camera(
404  name = "Simple Camera",
405  detectorList = detectorList,
406  transformMap = transformMap,
407  )
An integer coordinate rectangle.
Definition: Box.h:53
A purely radial polynomial distortion, up to 6th order.
Definition: XYTransform.h:186
double arcsecToRad(double x)
Definition: Angle.h:41

Variable Documentation

tuple lsst.pipe.tasks.mocks.simpleMapper.__all__ = ("SimpleMapper", "makeSimpleCamera", "makeDataRepo")

Definition at line 41 of file simpleMapper.py.