Beispiel #1
0
    def __init__(self, inputPolicy=None, **kwargs):
        policyFile = pexPolicy.DefaultPolicyFile(self.packageName,
                                                 "ctio0m9Mapper.paf", "policy")
        policy = pexPolicy.Policy(policyFile)

        CameraMapper.__init__(self, policy, policyFile.getRepositoryPath(),
                              **kwargs)
        filter_pairings = [
            'NONE+SEMROCK',  # list of all filter pairings found in data
            'NONE+RONCHI200',
            'RONCHI200+SEMROCK',
            'NONE+NONE',
            'NONE+g',
            'NONE+r',
            'NONE+i',
            'NONE+z',
            'RONCHI200+z',
            'RONCHI200+g',
            'FGB37+RONCHI200',
            'NONE+RONCHI400',
            'FGC715S+RONCHI400',
            'FGC715S+RONCHI200'
        ]

        # default no-filter name used for biases and darks - must appear
        afwImageUtils.defineFilter('NONE', 0.0, alias=[])

        for pairing in filter_pairings:
            afwImageUtils.defineFilter(pairing, 0.0, alias=[])
Beispiel #2
0
    def __init__(self, inputPolicy=None, **kwargs):
        """Initialization for the T80cam Mapper."""
        policyFile = dafPersist.Policy.defaultPolicyFile(self.packageName, "t80camMapper.yaml", "policy")
        policy = dafPersist.Policy(policyFile)

        CameraMapper.__init__(self, policy, os.path.dirname(policyFile), **kwargs)
        #
        # The composite objects don't seem to set these
        #
        for d in (self.mappings, self.exposures):
            d['raw'] = d['_raw']

        afwImageUtils.defineFilter('NONE', 0.0, alias=['no_filter', 'OPEN', 'empty'])
        afwImageUtils.defineFilter('c', 0.0, alias=[])
        afwImageUtils.defineFilter('o', 0.0, alias=[])
        afwImageUtils.defineFilter('t', 0.0, alias=[])
        afwImageUtils.defineFilter('B', 0.0, alias=[])
        afwImageUtils.defineFilter('V', 0.0, alias=[])
        afwImageUtils.defineFilter('R', 0.0, alias=[])
        afwImageUtils.defineFilter('I', 0.0, alias=[])
        afwImageUtils.defineFilter('u', 0.0, alias=[])
        afwImageUtils.defineFilter('v', 0.0, alias=[])
        afwImageUtils.defineFilter('g', 0.0, alias=[])
        afwImageUtils.defineFilter('r', 0.0, alias=[])
        afwImageUtils.defineFilter('i', 0.0, alias=[])
        afwImageUtils.defineFilter('z', 0.0, alias=[])
        afwImageUtils.defineFilter('h', 0.0, alias=[])
        afwImageUtils.defineFilter('oiii', 0.0, alias=[])
    def __init__(self, inputPolicy=None, **kwargs):
        policyFile = pexPolicy.DefaultPolicyFile(self.packageName, "monocamMapper.paf", "policy")
        policy = pexPolicy.Policy(policyFile)

        CameraMapper.__init__(self, policy, policyFile.getRepositoryPath(), **kwargs)

        # Ensure each dataset type of interest knows about the full range of keys available from the registry
        keys = {'visit': int,
                'ccd': int,
                'filter': str,
                'date': str,
                'expTime': float,
                'object': str,
                'imageType': str,
                }
        for name in ("raw", "raw_amp",
                     # processCcd outputs
                     "postISRCCD", "calexp", "postISRCCD", "src", "icSrc", "srcMatch",
                     ):
            self.mappings[name].keyDict.update(keys)

        # @merlin, you should swap these out for the filters you actually intend to use.
        self.filterIdMap = {'u': 0, 'g': 1, 'r': 2, 'i': 3, 'z': 4, 'y': 5}

        # The LSST Filters from L. Jones 04/07/10
        afwImageUtils.defineFilter('u', 364.59)
        afwImageUtils.defineFilter('g', 476.31, alias=["SDSSG"])
        afwImageUtils.defineFilter('r', 619.42, alias=["SDSSR"])
        afwImageUtils.defineFilter('i', 752.06, alias=["SDSSI"])
        afwImageUtils.defineFilter('z', 866.85, alias=["SDSSZ"])
        afwImageUtils.defineFilter('y', 971.68, alias=['y4'])  # official y filter
        afwImageUtils.defineFilter('NONE', 0.0, alias=['no_filter', "OPEN"])
Beispiel #4
0
    def __init__(self, inputPolicy=None, **kwargs):
        policyFilePath = dafPersist.Policy.defaultPolicyFile(
            self.packageName, "testMapper.yaml", "policy")
        policy = dafPersist.Policy(policyFilePath)

        self.doFootprints = False
        if inputPolicy is not None:
            for kw in inputPolicy.paramNames(True):
                if kw == "doFootprints":
                    self.doFootprints = True
                else:
                    kwargs[kw] = inputPolicy.get(kw)

        CameraMapper.__init__(self, policy, policyFilePath, **kwargs)
        self.filterIdMap = {
            'u': 0,
            'g': 1,
            'r': 2,
            'i': 3,
            'z': 4,
            'y': 5,
            'i2': 5
        }

        # The LSST Filters from L. Jones 04/07/10
        afwImageUtils.defineFilter('u', 364.59)
        afwImageUtils.defineFilter('g', 476.31)
        afwImageUtils.defineFilter('r', 619.42)
        afwImageUtils.defineFilter('i', 752.06)
        afwImageUtils.defineFilter('z', 866.85)
        afwImageUtils.defineFilter('y', 971.68,
                                   alias=['y4'])  # official y filter
Beispiel #5
0
    def __init__(self, inputPolicy=None, **kwargs):
        policyFile = pexPolicy.DefaultPolicyFile(self.packageName, "comCamMapper.paf", "policy")
        policy = pexPolicy.Policy(policyFile)

        CameraMapper.__init__(self, policy, policyFile.getRepositoryPath(), **kwargs)
        #
        # The composite objects don't seem to set these
        #
        for d in (self.mappings, self.exposures):
            d['raw'] = d['_raw']

        #self.filterIdMap = {}           # where is this used?  Generating objIds??

        afwImageUtils.defineFilter('NONE', 0.0, alias=['no_filter', "OPEN"])
        afwImageUtils.defineFilter('275CutOn', 0.0, alias=[])
        afwImageUtils.defineFilter('550CutOn', 0.0, alias=[])
Beispiel #6
0
    def __init__(self, inputPolicy=None, **kwargs):
        """Initialization for the ComCam Mapper."""
        policyFile = dafPersist.Policy.defaultPolicyFile(self.packageName, "comCamMapper.yaml", "policy")
        policy = dafPersist.Policy(policyFile)

        CameraMapper.__init__(self, policy, os.path.dirname(policyFile), **kwargs)
        #
        # The composite objects don't seem to set these
        #
        for d in (self.mappings, self.exposures):
            d['raw'] = d['_raw']

        # self.filterIdMap = {}           # where is this used?  Generating objIds??

        afwImageUtils.defineFilter('NONE', 0.0, alias=['no_filter', "OPEN"])
        afwImageUtils.defineFilter('275CutOn', 0.0, alias=[])
        afwImageUtils.defineFilter('550CutOn', 0.0, alias=[])
Beispiel #7
0
    def __init__(self, inputPolicy=None, **kwargs):
        """Initialization for the AuxTel Mapper."""
        policyFile = dafPersist.Policy.defaultPolicyFile(self.packageName, "auxTelMapper.yaml", "policy")
        policy = dafPersist.Policy(policyFile)

        CameraMapper.__init__(self, policy, os.path.dirname(policyFile), **kwargs)
        #
        # The composite objects don't seem to set these
        #
        for d in (self.mappings, self.exposures):
            d['raw'] = d['_raw']

        afwImageUtils.defineFilter('NONE', 0.0, alias=['no_filter', 'OPEN', 'empty'])
        afwImageUtils.defineFilter('275CutOn', 0.0, alias=[])
        afwImageUtils.defineFilter('550CutOn', 0.0, alias=[])
        afwImageUtils.defineFilter('green', 0.0, alias=[])
        afwImageUtils.defineFilter('blue', 0.0, alias=[])
Beispiel #8
0
    def __init__(self, outputRoot=None, **kwargs):
        policyFile = dafPersist.Policy.defaultPolicyFile(
            self.packageName, "WhircMapper.yaml", "policy")
        policy = dafPersist.Policy(policyFile)

        CameraMapper.__init__(self, policy, os.path.dirname(policyFile),
                              **kwargs)

        afwImageUtils.defineFilter('OPAQUE', lambdaEff=0)  # nm
        afwImageUtils.defineFilter('OPEN', lambdaEff=1750)  # nm
        afwImageUtils.defineFilter('J', lambdaEff=1250)
        afwImageUtils.defineFilter('H', lambdaEff=1650)
        afwImageUtils.defineFilter('KS', lambdaEff=2175, alias=['Ks'])

        self._nbit_tract = 8
        self._nbit_patch = 8
        self._nbit_filter = 8

        self._nbit_id = 64 - (self._nbit_tract + 2*self._nbit_patch + self._nbit_filter)
Beispiel #9
0
    def _makeCamera(self, *args, **kwargs):
        """Make the camera object

        This implementation layers a cache over the parent class'
        implementation. Caching the camera improves the instantiation
        time for the HscMapper because parsing the camera's Config
        involves a lot of 'stat' calls (through the tracebacks).
        """
        if not self._cameraCache:
            self._cameraCache = CameraMapper._makeCamera(self, *args, **kwargs)
        return self._cameraCache
    def _makeCamera(self, *args, **kwargs):
        """Make the camera object

        This implementation layers a cache over the parent class'
        implementation. Caching the camera improves the instantiation
        time for the HscMapper because parsing the camera's Config
        involves a lot of 'stat' calls (through the tracebacks).
        """
        if not self._cameraCache:
            self._cameraCache = CameraMapper._makeCamera(self, *args, **kwargs)
        return self._cameraCache
Beispiel #11
0
    def __init__(self, inputPolicy=None, **kwargs):
        policyFilePath = dafPersist.Policy.defaultPolicyFile(self.packageName, "testMapper.yaml", "policy")
        policy = dafPersist.Policy(policyFilePath)

        self.doFootprints = False
        if inputPolicy is not None:
            for kw in inputPolicy.paramNames(True):
                if kw == "doFootprints":
                    self.doFootprints = True
                else:
                    kwargs[kw] = inputPolicy.get(kw)

        CameraMapper.__init__(self, policy, policyFilePath, **kwargs)
        self.filterIdMap = {
            'u': 0, 'g': 1, 'r': 2, 'i': 3, 'z': 4, 'y': 5, 'i2': 5}

        # The LSST Filters from L. Jones 04/07/10
        afwImageUtils.defineFilter('u', 364.59)
        afwImageUtils.defineFilter('g', 476.31)
        afwImageUtils.defineFilter('r', 619.42)
        afwImageUtils.defineFilter('i', 752.06)
        afwImageUtils.defineFilter('z', 866.85)
        afwImageUtils.defineFilter('y', 971.68, alias=['y4'])  # official y filter
 def _transformId(self, dataId):
     copyId = CameraMapper._transformId(self, dataId)
     if "ccd" in copyId:
         copyId.setdefault("ccdnum", copyId["ccd"])
     return copyId
Beispiel #13
0
 def __init__(self, root):
     CameraMapper.__init__(self,
                           policy=dafPersist.Policy(BaseMapper.policy),
                           repositoryDir=root,
                           root=root)
Beispiel #14
0
    def __init__(self, inputPolicy=None, **kwargs):
        policyFile = Policy.defaultPolicyFile(self.packageName,
                                              "ctio0m9Mapper.yaml", "policy")
        policy = Policy(policyFile)
        CameraMapper.__init__(self, policy, os.path.dirname(policyFile),
                              **kwargs)
        filter_pairings = [
            'NONE+SEMROCK',  # list of all filter pairings found in data
            'NONE+RONCHI200',
            'RONCHI200+SEMROCK',
            'NONE+NONE',
            'NONE+g',
            'NONE+r',
            'NONE+i',
            'NONE+z',
            'RONCHI200+z',
            'RONCHI200+g',
            'FGB37+RONCHI200',
            'NONE+RONCHI400',
            'FGC715S+RONCHI400',
            'FGC715S+RONCHI200',
            'RONCHI400+ZG',
            'Thor300+ZG',
            'HoloPhP+ZG',
            'HoloPhAg+ZG',
            'HoloAmAg+ZG',
            'HoloPhAg+NONE',
            'Halfa+RONCHI400',
            'Halfa+Thor300',
            'Halfa+HoloPhP',
            'Halfa+HoloPhAg',
            'Halfa+HoloAmAg',
            'HoloAmAg+NONE',
            'FGB37+RONCHI400',
            'FGB37+HoloPhP',
            'FGB37+Thor300',
            'FGB37+HoloPhAg',
            'FGB37+HoloAmAg',
            'NONE+Thor300',
            'HoloPhP+NONE',
            'HoloPhAg+RG715',
            'RG715+Thor300',
            'HoloPhP+RG715',
            'RG715+RONCHI400',
            'HoloAmAg+RG715',
            'NONE+cb',
            'NONE+RG715',
            'FGB37+NONE',
            'NONE+ZG',
            'NONE+Halfa',
            'NONE+z',
            'NONE+f5025/1023',
            'RG715+RONCHI200',
            'FGB37+RONCHI200'
        ]

        # default no-filter name used for biases and darks - must appear
        afwImageUtils.defineFilter('NONE', 0.0, alias=[])

        for pairing in filter_pairings:
            afwImageUtils.defineFilter(pairing, 0.0, alias=[])
Beispiel #15
0
    def __init__(self, inputPolicy=None, **kwargs):
        #
        # Merge the list of .yaml files
        #
        policy = None
        for yamlFile in self.yamlFileList:
            policyFile = dafPersist.Policy.defaultPolicyFile(
                self.packageName, yamlFile, "policy")
            npolicy = dafPersist.Policy(policyFile)

            if policy is None:
                policy = npolicy
            else:
                policy.merge(npolicy)
        #
        # Look for the calibrations root "root/CALIB" if not supplied
        #
        if kwargs.get("root", None) and not kwargs.get("calibRoot", None):
            calibSearch = [os.path.join(kwargs["root"], "CALIB")]
            if "repositoryCfg" in kwargs:
                calibSearch += [
                    os.path.join(cfg.root, "CALIB")
                    for cfg in kwargs["repositoryCfg"].parents
                    if hasattr(cfg, "root")
                ]
                calibSearch += [
                    cfg.root for cfg in kwargs["repositoryCfg"].parents
                    if hasattr(cfg, "root")
                ]
            for calibRoot in calibSearch:
                if os.path.exists(
                        os.path.join(calibRoot, "calibRegistry.sqlite3")):
                    kwargs["calibRoot"] = calibRoot
                    break
            if not kwargs.get("calibRoot", None):
                lsst.log.Log.getLogger("LsstCamMapper").warning(
                    "Unable to find valid calib root directory")

        CameraMapper.__init__(self, policy, os.path.dirname(policyFile),
                              **kwargs)
        #
        # The composite objects don't seem to set these
        #
        for d in (self.mappings, self.exposures):
            d["raw"] = d["_raw"]

        LsstCamMapper._nbit_tract = 16  # These have been set to mimic the Gen3 version
        LsstCamMapper._nbit_patch = 9
        LsstCamMapper._nbit_filter = 5

        LsstCamMapper._nbit_id = 64 - (LsstCamMapper._nbit_tract +
                                       2 * LsstCamMapper._nbit_patch +
                                       LsstCamMapper._nbit_filter)

        baseFilters = set()
        baseBands = set()
        self.bandToIdNumDict = {
        }  # this is to get rid of afwFilter.getId calls
        filterNum = -1
        for filterDef in self.filterDefinitions:
            band = filterDef.band
            physical_filter = filterDef.physical_filter
            baseFilters.add(physical_filter)
            baseBands.add(band)
            if physical_filter not in self.bandToIdNumDict:
                filterNum += 1
                self.bandToIdNumDict[physical_filter] = filterNum
            if band not in self.bandToIdNumDict:
                self.bandToIdNumDict[band] = filterNum

        nFilter = len(baseBands)
        if nFilter >= 2**LsstCamMapper._nbit_filter:
            raise RuntimeError(
                "You have more filters (%d) defined than fit into the %d bits allocated"
                % (nFilter, LsstCamMapper._nbit_filter))