class WorkflowConfig(pexConfig.Config): # name of this workflow shortName = pexConfig.Field("name of this workflow", str) # platform configuration file platform = pexConfig.ConfigField("platform configuration file", plat.PlatformConfig) # plugin type configurationType = pexConfig.Field("plugin type", str) # plugin class name configurationClass = pexConfig.Field("orca plugin class", str) # configuration configuration = pexConfig.ConfigChoiceField("configuration", typemap) # this usually isn't used, but is here because the design calls for this # possibility. # database name database = pexConfig.ConfigChoiceField( "database", fake.FakeTypeMap(data.DatabaseConfig)) # task task = pexConfig.ConfigChoiceField("task", fake.FakeTypeMap(task.TaskConfig)) # monitor configuration monitor = pexConfig.ConfigField("monitor configuration", mon.MonitorConfig)
class Complex(pexConfig.Config): c = pexConfig.ConfigField("an inner config", InnerConfig) r = pexConfig.ConfigChoiceField("a registry field", typemap=GLOBAL_REGISTRY, default="AAA", optional=False) p = pexConfig.ConfigChoiceField("another registry", typemap=GLOBAL_REGISTRY, default="BBB", optional=True)
class Config3(pexConfig.Config): a = pexConfig.ConfigChoiceField(doc="single non-optional", typemap=TYPEMAP, default="AAA", multi=False, optional=False) b = pexConfig.ConfigChoiceField(doc="single optional", typemap=TYPEMAP, default="AAA", multi=False, optional=True) c = pexConfig.ConfigChoiceField(doc="multi non-optional", typemap=TYPEMAP, default=["AAA"], multi=True, optional=False) d = pexConfig.ConfigChoiceField(doc="multi optional", typemap=TYPEMAP, default=["AAA"], multi=True, optional=True)
class ImagePsfMatchConfig(pexConfig.Config): """Configuration for image-to-image Psf matching. """ kernel = pexConfig.ConfigChoiceField( doc="kernel type", typemap=dict(AL=PsfMatchConfigAL, DF=PsfMatchConfigDF), default="AL", ) selectDetection = pexConfig.ConfigurableField( target=SourceDetectionTask, doc="Initial detections used to feed stars to kernel fitting", ) selectMeasurement = pexConfig.ConfigurableField( target=SingleFrameMeasurementTask, doc="Initial measurements used to feed stars to kernel fitting", ) def setDefaults(self): # High sigma detections only self.selectDetection.reEstimateBackground = False self.selectDetection.thresholdValue = 10.0 # Minimal set of measurments for star selection self.selectMeasurement.algorithms.names.clear() self.selectMeasurement.algorithms.names = ('base_SdssCentroid', 'base_PsfFlux', 'base_PixelFlags', 'base_SdssShape', 'base_GaussianFlux', 'base_SkyCoord') self.selectMeasurement.slots.modelFlux = None self.selectMeasurement.slots.apFlux = None self.selectMeasurement.slots.calibFlux = None
class SnapPsfMatchConfig(ImagePsfMatchConfig): kernel = pexConfig.ConfigChoiceField( doc="kernel type", typemap=dict(AL=SnapPsfMatchConfigAL, DF=SnapPsfMatchConfigDF), default="AL", ) doWarping = pexConfig.Field(dtype=bool, doc="Warp the snaps?", default=False) def setDefaults(self): ImagePsfMatchConfig.setDefaults(self) # No spatial variation in model self.kernel.active.spatialKernelOrder = 0 # Don't fit for differential background self.kernel.active.fitForBackground = False # Small kernel size self.kernel.active.kernelSize = 7 # With zero spatial order don't worry about spatial clipping self.kernel.active.spatialKernelClipping = False
class ProductionConfig(pexConfig.Config): # production configuration production = pexConfig.ConfigField("production configuration", Production) # database configuration database = pexConfig.ConfigChoiceField("database information", fake.FakeTypeMap(db.DatabaseConfig)) # workflow configuration workflow = pexConfig.ConfigChoiceField( "workflow", fake.FakeTypeMap(work.WorkflowConfig)) # config check configCheckCare = pexConfig.Field("config check care", int, default=-1) # class that handles production configuration configurationClass = pexConfig.Field("configuration class", str)
class DatabaseConfig(pexConfig.Config): # database name name = pexConfig.Field("database name", str) # database system configuration system = pexConfig.ConfigField("database system info", DatabaseSystem) # class used to configure database configurationClass = pexConfig.Field("database configuration class", str) # type of database configuration configuration = pexConfig.ConfigChoiceField("configuration", dbTypemap)
class TaskConfig(pexConfig.Config): # script directory scriptDir = pexConfig.Field("script directory", str) # pre script (run before any jobs) preScript = pexConfig.ConfigField("pre script", ScriptConfig) # pre job script (run before each job) preJob = pexConfig.ConfigField("pre job", JobTemplateConfig) # post job script (run after each job) postJob = pexConfig.ConfigField("post job", JobTemplateConfig) # worker job configuration workerJob = pexConfig.ConfigField("worker job", JobTemplateConfig) # DAG generator script to use to create DAG submission file generator = pexConfig.ConfigChoiceField("generator", typemap)
class ModelPsfMatchConfig(pexConfig.Config): """!Configuration for model-to-model Psf matching""" kernel = pexConfig.ConfigChoiceField( doc="kernel type", typemap=dict(AL=PsfMatchConfigAL, ), default="AL", ) doAutoPadPsf = pexConfig.Field( dtype=bool, doc= ("If too small, automatically pad the science Psf? " "Pad to smallest dimensions appropriate for the matching kernel dimensions, " "as specified by autoPadPsfTo. If false, pad by the padPsfBy config." ), default=True, ) autoPadPsfTo = pexConfig.RangeField( dtype=float, doc= ("Minimum Science Psf dimensions as a fraction of matching kernel dimensions. " "If the dimensions of the Psf to be matched are less than the " "matching kernel dimensions * autoPadPsfTo, pad Science Psf to this size. " "Ignored if doAutoPadPsf=False."), default=1.4, min=1.0, max=2.0) padPsfBy = pexConfig.Field( dtype=int, doc= "Pixels (even) to pad Science Psf by before matching. Ignored if doAutoPadPsf=True", default=0, ) def setDefaults(self): # No sigma clipping self.kernel.active.singleKernelClipping = False self.kernel.active.kernelSumClipping = False self.kernel.active.spatialKernelClipping = False self.kernel.active.checkConditionNumber = False # Variance is ill defined self.kernel.active.constantVarianceWeighting = True # Do not change specified kernel size self.kernel.active.scaleByFwhm = False
class ModelPsfMatchConfig(pexConfig.Config): """!Configuration for model-to-model Psf matching""" kernel = pexConfig.ConfigChoiceField( doc="kernel type", typemap=dict(AL=PsfMatchConfigAL, ), default="AL", ) def setDefaults(self): # No sigma clipping self.kernel.active.singleKernelClipping = False self.kernel.active.kernelSumClipping = False self.kernel.active.spatialKernelClipping = False self.kernel.active.checkConditionNumber = False # Variance is ill defined self.kernel.active.constantVarianceWeighting = True # Psfs are typically small; reduce the kernel size self.kernel.active.kernelSizeMin = 11 self.kernel.active.kernelSize = 11
class Config2(pexConf.Config): c = pexConf.ConfigField(dtype=Config1, doc="holder for Config1") b = pexConf.ConfigChoiceField(typemap=typemap, doc="choice holder for Config1")
class Config2(pexConf.Config): r = pexConf.ConfigChoiceField("Config2.r", {"c1": Config1}, default="c1")
class Config3(pexConf.Config): r = pexConf.ConfigChoiceField("Config3.r", { "c1": Config1, "c2": Config2 }, default="c1")
class CondorInfoConfig(pexConfig.Config): """A pex_config file describing the platform specific information about remote user logins. """ platform = pexConfig.ConfigChoiceField("platform info", FakeTypeMap(UserConfig))
class AuthDatabaseConfig(pexConfig.Config): # authorization configuration authInfo = pexConfig.ConfigChoiceField("auth info", fake.FakeTypeMap(AuthInfoConfig))