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

Classes

class  PersistenceType
 
class  BypassPersistenceType
 
class  ExposurePersistenceType
 
class  SkyMapPersistenceType
 
class  CatalogPersistenceType
 
class  SimpleCatalogPersistenceType
 
class  SourceCatalogPersistenceType
 
class  ExposureCatalogPersistenceType
 
class  PeakCatalogPersistenceType
 
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 436 of file simpleMapper.py.

437 def makeDataRepo(root):
438  """
439  Create a data repository for SimpleMapper and return a butler for it.
440 
441  Clobbers anything already in the given path.
442  """
443  if os.path.exists(root):
444  shutil.rmtree(root)
445  os.makedirs(root)
446  with open(os.path.join(root, "_mapper"), "w") as f:
447  f.write("lsst.pipe.tasks.mocks.SimpleMapper\n")
448  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 381 of file simpleMapper.py.

382 ):
383  """Create a camera
384 
385  @param[in] nx: number of detectors in x
386  @param[in] ny: number of detectors in y
387  @param[in] sizeX: detector size in x (pixels)
388  @param[in] sizeY: detector size in y (pixels)
389  @param[in] gapX: gap between detectors in x (mm)
390  @param[in] gapY: gap between detectors in y (mm)
391  @param[in] pixelSize: pixel size (mm) (a float)
392  @param[in] plateScale: plate scale in arcsec/mm; 20.0 is for LSST
393  @param[in] radialDistortion: radial distortion, in mm/rad^2
394  (the r^3 coefficient of the radial distortion polynomial
395  that converts PUPIL in radians to FOCAL_PLANE in mm);
396  0.925 is the value Dave Monet measured for lsstSim data
397 
398  Each detector will have one amplifier (with no raw information).
399  """
400  pScaleRad = lsst.afw.geom.arcsecToRad(plateScale)
401  radialDistortCoeffs = [0.0, 1.0/pScaleRad, 0.0, radialDistortion/pScaleRad]
402  focalPlaneToPupil = lsst.afw.geom.RadialXYTransform(radialDistortCoeffs)
403  nativeSys = lsst.afw.cameraGeom.FOCAL_PLANE
404  transforms = {
405  lsst.afw.cameraGeom.PUPIL: focalPlaneToPupil,
406  }
407  transformMap = lsst.afw.cameraGeom.CameraTransformMap(nativeSys, transforms)
408 
409  detectorList = []
411  for iY in range(nY):
412  cY = (iY - 0.5 * (nY - 1)) * (pixelSize * sizeY + gapY)
413  for iX in range(nX):
414  cX = (iX - 0.5 * (nX - 1)) * (pixelSize * sizeY + gapX)
415  fpPos = lsst.afw.geom.Point2D(cX, cY)
416  detectorName = "detector %d,%d" % (iX, iY)
417  detectorId = len(detectorList) + 1
418  detectorList.append(DetectorWrapper(
419  name = detectorName,
420  id = detectorId,
421  serial = detectorName + " serial",
422  bbox = ccdBBox,
423  ampExtent = ccdBBox.getDimensions(),
424  numAmps = 1,
425  pixelSize = lsst.afw.geom.Extent2D(pixelSize, pixelSize),
426  orientation = lsst.afw.cameraGeom.Orientation(fpPos),
427  plateScale = plateScale,
428  radialDistortion = radialDistortion,
429  ).detector)
430 
431  return lsst.afw.cameraGeom.Camera(
432  name = "Simple Camera",
433  detectorList = detectorList,
434  transformMap = transformMap,
435  )
A Detector and the data used to construct it.
Definition: testUtils.py:17
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 42 of file simpleMapper.py.