Exemple #1
0
 def __init__(self, config, name, schema, metadata, logName=None):
     SingleFramePlugin.__init__(self, config, name, schema, metadata, logName=logName)
     flagDefs = FlagDefinitionList()
     self.FAILURE = flagDefs.addFailureFlag()
     self.CONTAINS_NAN = flagDefs.add("flag_containsNan", "Measurement area contains a nan")
     self.flagHandler = FlagHandler.addFields(schema, name, flagDefs)
     self.instFluxKey = schema.addField(name + "_instFlux", "F", doc="flux")
Exemple #2
0
    def __init__(self, config, name, schema, metadata):
        SingleFramePlugin.__init__(self, config, name, schema, metadata)
        self.bfd = BFDConfig(use_conc=self.config.use_conc, use_mag=self.config.use_mag)
        self.n_even = self.bfd.BFDConfig.MSIZE
        self.n_odd = self.bfd.BFDConfig.XYSIZE

        self.moment = schema.addField('bfd_moments', type="ArrayF",
                                      size=self.n_even, doc="Even Bfd moments")
        self.failed_moment = schema.addField('failed_moments', type="ArrayF",
                                      size=self.n_even, doc="Even Bfd moments")
        self.odd = schema.addField('bfd_odd', type="ArrayF",
                                   size=self.n_odd, doc="odd moments")
        self.failed_odd = schema.addField('failed_odd', type="ArrayF",
                                   size=self.n_odd, doc="odd moments")
        self.shift = schema.addField('bfd_shift', type="ArrayF",
                                     size=2, doc="amount shifted to null moments")
        self.cov_even = schema.addField('bfd_cov_even', type="ArrayF",
                                        size=self.n_even*(self.n_even+1)//2,
                                        doc="even moment covariance matrix")
        self.cov_odd = schema.addField('bfd_cov_odd', type="ArrayF",
                                       size=self.n_odd*(self.n_odd+1)//2,
                                       doc="odd moment covariance matrix")
        self.flag = schema.addField('bfd_flag', type="Flag", doc="Set to 1 for any fatal failure")
        self.centroid_flag = schema.addField('bfd_flag_centroid', type="Flag",
                                             doc="Set to 1 for any fatal failure of centroid")

        self.weight = KSigmaWeightF(self.config.weight_sigma, self.config.weight_n)
Exemple #3
0
    def __init__(self, config, name, schema, metadata):
        SingleFramePlugin.__init__(self, config, name, schema, metadata)
        self.moment = schema.addField('bfd_moments',
                                      type="ArrayF",
                                      size=NMoment,
                                      doc="Even Bfd moments")
        self.xy = schema.addField('bfd_xy',
                                  type="ArrayF",
                                  size=2,
                                  doc="xy shift")
        self.cov_even = schema.addField('bfd_cov_even',
                                        type="ArrayF",
                                        size=NMoment * (NMoment + 1) // 2,
                                        doc="even moment covariance matrix")
        self.cov_odd = schema.addField('bfd_cov_odd',
                                       type="ArrayF",
                                       size=3,
                                       doc="odd moment covariance matrix")
        self.flag = schema.addField('bfd_flag',
                                    type="Flag",
                                    doc="Set to 1 for any fatal failure")
        self.centroid_flag = schema.addField(
            'bfd_flag_centroid',
            type="Flag",
            doc="Set to 1 for any fatal failure of centroid")

        self.weight = bfd.KSigmaWeight(self.config.weight_n,
                                       self.config.weight_sigma)
Exemple #4
0
 def __init__(self, config, name, schema, metadata):
     SingleFramePlugin.__init__(self, config, name, schema, metadata)
     flagDefs = FlagDefinitionList()
     self.FAILURE = flagDefs.addFailureFlag()
     self.CONTAINS_NAN = flagDefs.add("flag_containsNan", "Measurement area contains a nan")
     self.EDGE = flagDefs.add("flag_edge", "Measurement area over edge")
     self.flagHandler = FlagHandler.addFields(schema, name, flagDefs)
     self.centroidExtractor = lsst.meas.base.SafeCentroidExtractor(schema, name)
     self.instFluxKey = schema.addField(name + "_instFlux", "F", doc="flux")
     self.magKey = schema.addField(name + "_mag", "F", doc="mag")
Exemple #5
0
 def __init__(self, config, name, schema, metadata):
     SingleFramePlugin.__init__(self, config, name, schema, metadata)
     flagDefs = FlagDefinitionList()
     self.FAILURE = flagDefs.addFailureFlag()
     self.CONTAINS_NAN = flagDefs.add("flag_containsNan",
                                      "Measurement area contains a nan")
     self.EDGE = flagDefs.add("flag_edge", "Measurement area over edge")
     self.flagHandler = FlagHandler.addFields(schema, name, flagDefs)
     self.centroidExtractor = lsst.meas.base.SafeCentroidExtractor(
         schema, name)
     self.fluxKey = schema.addField(name + "_flux", "F", doc="flux")
     self.magKey = schema.addField(name + "_mag", "F", doc="mag")
Exemple #6
0
 def __init__(self, config, name, schema, metadata, logName=None):
     SingleFramePlugin.__init__(self,
                                config,
                                name,
                                schema,
                                metadata,
                                logName=logName)
     flagDefs = FlagDefinitionList()
     self.FAILURE = flagDefs.addFailureFlag()
     self.CONTAINS_NAN = flagDefs.add("flag_containsNan",
                                      "Measurement area contains a nan")
     self.flagHandler = FlagHandler.addFields(schema, name, flagDefs)
     self.fluxKey = schema.addField(name + "_flux", "F", doc="flux")
    def __init__(self, config, name, schema, metadata):
        SingleFramePlugin.__init__(self, config, name, schema, metadata)

        flagDefs = FlagDefinitionList()
        flagDefs.add("flag", "General Failure error")
        flagDefs.add("test_flag", "second flag")
        self.flagHandler = FlagHandler.addFields(schema, name, flagDefs)
        self.xKey = schema.addField(schema.join(name, "x"), type=np.float64)
        self.yKey = schema.addField(schema.join(name, "y"), type=np.float64)
        if self.config.dist is None:
            self.centroidChecker = lsst.meas.base.CentroidChecker(schema, name)
        else:
            self.centroidChecker = lsst.meas.base.CentroidChecker(
                schema, name, True, self.config.dist)
Exemple #8
0
    def __init__(self, config, name, schema, metadata):
        SingleFramePlugin.__init__(self, config, name, schema, metadata)

        self.iterKey = schema.addField(name + '_iterations', type=int, doc="number of iterations run")
        self.fdiffKey = schema.addField(name + '_fdiff', type=float, doc="fit difference")

        # Add ShapeletFunction keys for the number of Gaussians requested
        self.keys = []
        for i in range(config.nGauss):
            key = lsst.shapelet.ShapeletFunctionKey.addFields(schema,
                                                             "%s_%d"%(name, i),
                                                             "ngmix EM gaussian", "pixels", "",
                                                              0, lsst.shapelet.HERMITE)
            self.keys.append(key)
        self.msfKey = lsst.shapelet.MultiShapeletFunctionKey(self.keys)
Exemple #9
0
    def __init__(self, config, name, schema, metadata):
        SingleFramePlugin.__init__(self, config, name, schema, metadata)

        self.xKey = schema.addField(name + "_x",
                                    type="D",
                                    doc="x centroid of model fit",
                                    units="")
        self.yKey = schema.addField(name + "_y",
                                    type="D",
                                    doc="y centroid of model fit",
                                    units="")
        self.fluxKey = schema.addField(name + "_flux",
                                       type="D",
                                       doc="flux of model fit",
                                       units="")
        self.sigmaKey = schema.addField(name + "_sigma",
                                        type="D",
                                        doc="sigma(width) of model fit",
                                        units="")
        self.TKey = schema.addField(name + "_T",
                                    type="D",
                                    doc="composite moment of model fit",
                                    units="")
        self.e1Key = schema.addField(name + "_e1",
                                     type="D",
                                     doc="e1 of model fit",
                                     units="")
        self.e2Key = schema.addField(name + "_e2",
                                     type="D",
                                     doc="e2 of model fit",
                                     units="")
        # Add ShapeletFunction keys for the number of Gaussians required
        self.keys = []
        self.nGauss = self.getModelInfo(self.config.model)["nGauss"]
        #   Add a 0th order shapelet for every Gaussian to be returned
        for i in range(self.nGauss):
            key = ShapeletFunctionKey.addFields(schema, "%s_%d" % (name, i),
                                                "ngmix Shape gaussian",
                                                "pixels", "", 0, HERMITE)
            self.keys.append(key)
        #   If the psfName is specified, it means to we can get the psfApprox from it
        self.multiShapeletFunctionKey = MultiShapeletFunctionKey(self.keys)
        if self.config.psfName is not None:
            self.psfMsfKey = MultiShapeletFunctionKey(
                schema[self.config.psfName], HERMITE)
        else:
            self.psfMsfKey = None
        self.name = name
Exemple #10
0
    def __init__(self, config, name, schema, metadata):
        SingleFramePlugin.__init__(self, config, name, schema, metadata)

        flagDefs = FlagDefinitionList()
        flagDefs.add("flag", "General Failure error")
        flagDefs.add("test_flag", "second flag")
        self.flagHandler = FlagHandler.addFields(schema, name, flagDefs)

        if self.config.setErrors:
            uncertainty = lsst.meas.base.UncertaintyEnum.SIGMA_ONLY
        else:
            uncertainty = lsst.meas.base.UncertaintyEnum.NO_UNCERTAINTY

        self.centroidKey = lsst.meas.base.CentroidResultKey.addFields(schema, name, name, uncertainty)

        if self.config.dist is None:
            self.centroidChecker = lsst.meas.base.CentroidChecker(schema, name)
        else:
            self.centroidChecker = lsst.meas.base.CentroidChecker(schema, name, True, self.config.dist)
Exemple #11
0
    def __init__(self, config, name, schema, metadata):
        SingleFramePlugin.__init__(self, config, name, schema, metadata)


        self.bfd_config = BFDConfig(use_mag=True, use_conc=True)

        NMoment = self.bfd_config.MSIZE
        self.moment = schema.addField('moment', type="ArrayF", size=NMoment, doc="Even Bfd moments")
        self.sheared_moment = schema.addField('sheared_moment', type="ArrayF", size=NMoment, doc="Sheared Even Bfd moments")
        self.flag = schema.addField('bfd.flags', type="Flag", doc="Set to 1 for any fatal failure")
        self.flag_sat = schema.addField('bfd.flags.saturated.center', type="Flag", doc="Set to 1 for any fatal failure")
        self.flag_parent = schema.addField('bfd.flags.parent', type="Flag", doc="Set to 1 for any fatal failure")
        self.centroid_flag = schema.addField('bfd_flag_centroid', type="Flag", doc="Set to 1 for any fatal failure of centroid")

        self.g1 = schema.addField('g1', type=float, doc="g1")
        self.g2 = schema.addField('g2', type=float, doc="g2")
        self.mu = schema.addField('mu', type=float, doc="mu")
        self.dx = schema.addField('dx', type=float, doc="dx")
        self.dy = schema.addField('dy', type=float, doc="dy")

        self.weight = bfd.KSigmaWeightF(float(self.config.weight_sigma), int(self.config.weight_n))