LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Classes | Functions
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 (nX, nY, sizeX, sizeY, gapX, gapY, pixelSize=1.0, plateScale=20.0, radialDistortion=0.925)
 
def makeDataRepo (root)
 

Function Documentation

◆ makeDataRepo()

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 499 of file simpleMapper.py.

499 def makeDataRepo(root):
500  """
501  Create a data repository for SimpleMapper and return a butler for it.
502 
503  Clobbers anything already in the given path.
504  """
505  if os.path.exists(root):
506  shutil.rmtree(root)
507  os.makedirs(root)
508  with open(os.path.join(root, "_mapper"), "w") as f:
509  f.write("lsst.pipe.tasks.mocks.SimpleMapper\n")
510  return lsst.daf.persistence.Butler(root=root)

◆ makeSimpleCamera()

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 FIELD_ANGLE 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 437 of file simpleMapper.py.

444 ):
445  """Create a camera
446 
447  @param[in] nx: number of detectors in x
448  @param[in] ny: number of detectors in y
449  @param[in] sizeX: detector size in x (pixels)
450  @param[in] sizeY: detector size in y (pixels)
451  @param[in] gapX: gap between detectors in x (mm)
452  @param[in] gapY: gap between detectors in y (mm)
453  @param[in] pixelSize: pixel size (mm) (a float)
454  @param[in] plateScale: plate scale in arcsec/mm; 20.0 is for LSST
455  @param[in] radialDistortion: radial distortion, in mm/rad^2
456  (the r^3 coefficient of the radial distortion polynomial
457  that converts FIELD_ANGLE in radians to FOCAL_PLANE in mm);
458  0.925 is the value Dave Monet measured for lsstSim data
459 
460  Each detector will have one amplifier (with no raw information).
461  """
462  pScaleRad = lsst.geom.arcsecToRad(plateScale)
463  radialDistortCoeffs = [0.0, 1.0/pScaleRad, 0.0, radialDistortion/pScaleRad]
464  focalPlaneToFieldAngle = lsst.afw.geom.makeRadialTransform(radialDistortCoeffs)
465 
466  ccdBBox = lsst.geom.Box2I(lsst.geom.Point2I(), lsst.geom.Extent2I(sizeX, sizeY))
467 
468  cameraBuilder = lsst.afw.cameraGeom.Camera.Builder("Simple Camera")
469 
470  detectorId = 0
471  for iY in range(nY):
472  cY = (iY - 0.5 * (nY - 1)) * (pixelSize * sizeY + gapY)
473  for iX in range(nX):
474  cX = (iX - 0.5 * (nX - 1)) * (pixelSize * sizeY + gapX)
475  fpPos = lsst.geom.Point2D(cX, cY)
476  detectorName = "detector %d,%d" % (iX, iY)
477 
478  detectorBuilder = cameraBuilder.add(detectorName, detectorId)
479  detectorBuilder.setSerial(detectorName + " serial")
480  detectorBuilder.setBBox(ccdBBox)
481  detectorBuilder.setOrientation(lsst.afw.cameraGeom.Orientation(fpPos))
482  detectorBuilder.setPixelSize(lsst.geom.Extent2D(pixelSize, pixelSize))
483 
485  ampName = "amp"
486  ampBuilder.setName(ampName)
487  ampBuilder.setBBox(ccdBBox)
488  ampBuilder.setGain(1.0)
489  ampBuilder.setReadNoise(5.0)
490 
491  detectorBuilder.append(ampBuilder)
492 
493  detectorId += 1
494 
495  cameraBuilder.setTransformFromFocalPlaneTo(lsst.afw.cameraGeom.FIELD_ANGLE, focalPlaneToFieldAngle)
496  return cameraBuilder.finish()
497 
498 
A mutable Amplifier subclass class that can be used to incrementally construct or modify Amplifiers.
Definition: Amplifier.h:305
A helper class for creating and modifying cameras.
Definition: Camera.h:208
Describe a detector's orientation in the focal plane.
Definition: Orientation.h:51
An integer coordinate rectangle.
Definition: Box.h:55
std::shared_ptr< TransformPoint2ToPoint2 > makeRadialTransform(std::vector< double > const &coeffs)
A purely radial polynomial distortion.
constexpr double arcsecToRad(double x) noexcept
Definition: Angle.h:55