Ejemplo n.º 1
0
 def check(self, patchRef, selectData, doesOverlap):
     config = CoaddBaseTask.ConfigClass()
     config.select.retarget(WcsSelectImagesTask)
     task = CoaddBaseTask(config=config, name="CoaddBase")
     dataRefList = task.selectExposures(patchRef, selectDataList=[selectData])
     numExpected = 1 if doesOverlap else 0
     self.assertEqual(len(dataRefList), numExpected)
Ejemplo n.º 2
0
 def check(self, patchRef, selectData, doesOverlap):
     config = CoaddBaseTask.ConfigClass()
     config.select.retarget(WcsSelectImagesTask)
     task = CoaddBaseTask(config=config, name="CoaddBase")
     dataRefList = task.selectExposures(patchRef,
                                        selectDataList=[selectData])
     numExpected = 1 if doesOverlap else 0
     self.assertEqual(len(dataRefList), numExpected)
Ejemplo n.º 3
0
    def __init__(self, schema=None, *args, **kwargs):
        CoaddBaseTask.__init__(self, *args, **kwargs)

        # ---------------------------------------------------------- #
        # for Galactic extinction until https://hsc-jira.astro.princeton.edu/jira/browse/HSC-1350 is fixed
        # ---------------------------------------------------------- #
        from astropy.io import ascii, fits
        import astropy.wcs as wcs

        sFile = fits.open(self.config.dustSgpFileName)
        nFile = fits.open(self.config.dustNgpFileName)

        self.dustMap.sMap = sFile[0].data
        self.dustMap.nMap = nFile[0].data

        self.dustMap.sWcs = wcs.WCS(sFile[0].header)
        self.dustMap.nWcs = wcs.WCS(nFile[0].header)
Ejemplo n.º 4
0
    def __init__(self, schema=None, *args, **kwargs):
        CoaddBaseTask.__init__(self,  *args, **kwargs)

        if schema is None:
            schema = afwTable.SourceTable.makeMinimalSchema()
        self.schema = schema

        self.makeSubtask("setPrimaryFlags", schema=self.schema)

        self.depthMap.map = None

        if self.config.depthMapFileName != "":
            """healpix map
            """

            self.depthMap.nest = True
            self.depthMap.map, h = healpy.fitsfunc.read_map(self.config.depthMapFileName, nest=self.depthMap.nest, h=True)
            self.depthMap.header = dict(h)
            self.depthMap.nside = self.depthMap.header['NSIDE']
Ejemplo n.º 5
0
    def __init__(self, schema=None, *args, **kwargs):
        CoaddBaseTask.__init__(self,  *args, **kwargs)

        if len(self.config.dustCoefs.split("^")) !=  len(self.config.filters.split("^")):
                raise ArgumentError(None, "filters and dustCoefs must have the same number of elements")

        # ---------------------------------------------------------- #
        # for Galactic extinction until https://hsc-jira.astro.princeton.edu/jira/browse/HSC-1350 is fixed
        # ---------------------------------------------------------- #
        from   astropy.io        import ascii,fits
        import astropy.wcs       as wcs

        sFile = fits.open(self.config.dustSgpFileName)
        nFile = fits.open(self.config.dustNgpFileName)

        self.dustMap.sMap  = sFile[0].data
        self.dustMap.nMap  = nFile[0].data

        self.dustMap.sWcs = wcs.WCS(sFile[0].header)
        self.dustMap.nWcs = wcs.WCS(nFile[0].header)
Ejemplo n.º 6
0
    def __init__(self, *args, **kwargs):

        CoaddBaseTask.__init__(self, *args, **kwargs)

        self.schema = afwTable.SourceTable.makeMinimalSchema()
        self.algMetadata = dafBase.PropertyList()

        self.makeSubtask("charImage")

        # we don't perform any calibration (yet)
        #self.makeSubtask("calibrate")

        if self.config.doMaskBrightObjects:
            mask = afwImage.Mask()
            try:
                self.brightObjectBitmask = 1 << mask.addMaskPlane(
                    self.config.brightObjectMaskName)
            except pexExceptions.LsstCppException:
                raise RuntimeError(
                    "Unable to define mask plane for bright objects; \
                    planes used are %s" % mask.getMaskPlaneDict().keys())
            del mask
Ejemplo n.º 7
0
    def __init__(self, *args, **kwargs):

        CoaddBaseTask.__init__(self, *args, **kwargs)

        self.schema = afwTable.SourceTable.makeMinimalSchema()
        self.algMetadata = dafBase.PropertyList()

        self.makeSubtask("charImage")

        # we don't perform any calibration (yet)
        #self.makeSubtask("calibrate")

        if self.config.doMaskBrightObjects:
            mask = afwImage.Mask()
            try:
                self.brightObjectBitmask = 1 << mask.addMaskPlane(
                    self.config.brightObjectMaskName)
            except pexExceptions.LsstCppException:
                raise RuntimeError(
                    "Unable to define mask plane for bright objects; \
                    planes used are %s" % mask.getMaskPlaneDict().keys())
            del mask