Example #1
0
 def _getCameraFromPath(path):
     """Return the camera geometry given solely the path to the location
     of that definition."""
     config = CameraConfig()
     config.load(os.path.join(path, "camera.py"))
     return makeCameraFromPath(
         cameraConfig=config,
         ampInfoPath=path,
         shortNameFunc=lambda name: name.replace(" ", "_"),
     )
Example #2
0
 def getCamera(self):
     "Grab camera information from camera/camera.py file."
     path = os.path.join(getPackageDir("obs_vista"), "camera")
     config = CameraConfig()
     config.load(os.path.join(path, "camera.py"))
     return makeCameraFromPath(
         cameraConfig=config,
         ampInfoPath=path,
         shortNameFunc=lambda name: name.replace(" ", "_"),
     )
Example #3
0
def loadCamera(repoDir):
    """Load a camera given the path to the repository (the directory that contains the 
    description directory).  I use this just in testing from the interpreter prompt.
    In general, it's probably best to do butler.get('camera')
    @param repoDir:  path to the root of the camera description tree
    """
    inputPath = os.path.join(repoDir, "description", "camera")
    camConfigPath = os.path.join(inputPath, "camera.py")
    camConfig = CameraConfig()
    camConfig.load(camConfigPath)
    lsstSimMapper = LsstSimMapper
    return makeCameraFromPath(camConfig, inputPath, lsstSimMapper.getShortCcdName)
Example #4
0
    def getCamera(self):
        """Retrieve the cameraGeom representation of HSC.

        This is a temporary API that should go away once obs_ packages have
        a standardized approach to writing versioned cameras to a Gen3 repo.
        """
        path = os.path.join(getPackageDir("obs_subaru"), "hsc", "camera")
        config = CameraConfig()
        config.load(os.path.join(path, "camera.py"))
        return makeCameraFromPath(
            cameraConfig=config,
            ampInfoPath=path,
            shortNameFunc=lambda name: name.replace(" ", "_"),
            pupilFactoryClass=HscPupilFactory)
Example #5
0
def loadCamera(repoDir):
    """Load a camera given the path to its description

    I use this just in testing from the interpreter prompt.
    In general, it's probably best to do butler.get('camera')
    @param repoDir:  path to the root of the camera description tree
    """
    inputPath = os.path.join(repoDir, "description", "camera")
    camConfigPath = os.path.join(inputPath, "camera.py")
    camConfig = CameraConfig()
    camConfig.load(camConfigPath)
    lsstSimMapper = LsstSimMapper
    return makeCameraFromPath(camConfig, inputPath,
                              lsstSimMapper.getShortCcdName)
    def getCamera(self):
        """Retrieve the cameraGeom representation of HSC.

        This is a temporary API that should go away once obs_ packages have
        a standardized approach to writing versioned cameras to a Gen3 repo.
        """
        path = os.path.join(getPackageDir("obs_subaru"), "hsc", "camera")
        config = CameraConfig()
        config.load(os.path.join(path, "camera.py"))
        return makeCameraFromPath(
            cameraConfig=config,
            ampInfoPath=path,
            shortNameFunc=lambda name: name.replace(" ", "_"),
            pupilFactoryClass=HscPupilFactory
        )