Exemple #1
0
    def __init__(self, butler=None, schema=None, **kwargs):
        """Initialize the task.

        BaseReferencesTask and its subclasses take two keyword arguments beyond the usual Task arguments:
         - schema: the Schema of the reference catalog
         - butler: a butler that will allow the task to load its Schema from disk.
        At least one of these arguments must be present; if both are, schema takes precedence.
        """
        Task.__init__(self, **kwargs)
    def __init__(self, butler=None, refObjLoader=None, **kwargs):
        Task.__init__(self, **kwargs)
        if not refObjLoader:
            if butler:
                if not isinstance(self.config, DirectMatchConfig):
                    raise RuntimeError("DirectMatchTask must be initialized with DirectMatchConfig "
                                       "if a refObjLoader is not supplied at initialization")
                self.makeSubtask("refObjLoader", butler=butler)
            else:
                self.refObjLoader = None

        else:
            self.refObjLoader = refObjLoader
        self.makeSubtask("sourceSelection")
        self.makeSubtask("referenceSelection")
 def __init__(self, schema, **kwargs):
     Task.__init__(self, **kwargs)
     self.schema = schema
     self.isPatchInnerKey = self.schema.addField(
         "detect.is-patch-inner", type="Flag",
         doc="true if source is in the inner region of a coadd patch",
     )
     self.isTractInnerKey = self.schema.addField(
         "detect.is-tract-inner", type="Flag",
         doc="true if source is in the inner region of a coadd tract",
     )
     self.isPrimaryKey = self.schema.addField(
         "detect.is-primary", type="Flag",
         doc="true if source has no children and is in the inner region of a coadd patch " \
             + "and is in the inner region of a coadd tract",
     )
 def __init__(self, schema, **kwargs):
     Task.__init__(self, **kwargs)
     self.schema = schema
     self.isPatchInnerKey = self.schema.addField(
         "detect_isPatchInner", type="Flag", doc="true if source is in the inner region of a coadd patch"
     )
     self.isTractInnerKey = self.schema.addField(
         "detect_isTractInner", type="Flag", doc="true if source is in the inner region of a coadd tract"
     )
     self.isPrimaryKey = self.schema.addField(
         "detect_isPrimary",
         type="Flag",
         doc="true if source has no children and is in the inner region of a coadd patch "
         + "and is in the inner region of a coadd tract "
         'and is not "detected" in a pseudo-filter (see config.pseudoFilterList)',
     )
    def __init__(self, schema, **kwds):
        """!Construct a MeasureApCorrTask

        For every name in lsst.meas.base.getApCorrNameSet():
        - If the corresponding flux fields exist in the schema:
            - Add a new field apcorr_{name}_used
            - Add an entry to the self.toCorrect dict
        - Otherwise silently skip the name
        """
        Task.__init__(self, **kwds)
        self.refFluxKeys = FluxKeys(self.config.refFluxName, schema)
        self.toCorrect = {}  # dict of flux field name prefix: FluxKeys instance
        for name in getApCorrNameSet():
            try:
                self.toCorrect[name] = FluxKeys(name, schema)
            except KeyError:
                # if a field in the registry is missing, just ignore it.
                pass
        self.makeSubtask("sourceSelector")
Exemple #6
0
 def __init__(self, *args, **kwargs):
     Task.__init__(self, *args, **kwargs)
     self.makeSubtask("stats")
 def __init__(self, schema, **kwargs):
     Task.__init__(self, **kwargs)
     self.schema = schema
     self._keys = dict((f, self.schema.addField(f, type="Flag", doc="Propagated from visits")) for
                       f in self.config.flags)
 def __init__(self, columnName=None, schema=None, doc=None, **kwargs):
     Task.__init__(self, **kwargs)
     assert columnName is not None, "columnName not provided"
     assert schema is not None, "schema not provided"
     self.columnName = columnName
     self.key = schema.addField(self.columnName + "_reserved", type="Flag", doc=doc)