Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1from lsst.verify.tasks import MetricTask, MetricConfig, MetricConnections 

2import lsst.pipe.base as pipeBase 

3import lsst.pex.config as pexConfig 

4 

5from .BaseSubTasks import NumpySummaryTask 

6 

7__all__ = ('CatalogSummaryBaseTaskConnections', 'CatalogSummaryBaseTaskConfig', 'CatalogSummaryBaseTask') 

8 

9 

10# Dimensions of the Connections class define the iterations of runQuantum 

11class CatalogSummaryBaseTaskConnections(MetricConnections, 

12 defaultTemplates={'agg_name': None}, 

13 dimensions=("band", "tract", 

14 "instrument", "skymap")): 

15 # Make this an LSST verify Measurement 

16 measurement = pipeBase.connectionTypes.Output(doc="{agg_name} {package}_{metric}.", 

17 dimensions=("instrument", "tract", "band"), 

18 storageClass="MetricValue", 

19 name="metricvalue_{agg_name}_{package}_{metric}") 

20 

21 

22class CatalogSummaryBaseTaskConfig(MetricConfig, 

23 pipelineConnections=CatalogSummaryBaseTaskConnections): 

24 agg = pexConfig.ConfigurableField( 

25 # This task is meant to make measurements of various types. 

26 # The default task is, therefore, a bit of a place holder. 

27 # It is expected that this will be overridden in the pipeline 

28 # definition in most cases. 

29 target=NumpySummaryTask, 

30 doc="Numpy aggregation task") 

31 

32 

33class CatalogSummaryBaseTask(MetricTask): 

34 

35 ConfigClass = CatalogSummaryBaseTaskConfig 

36 _DefaultName = "catalogSummaryBaseTask" 

37 

38 def __init__(self, config, *args, **kwargs): 

39 super().__init__(*args, config=config, **kwargs) 

40 self.makeSubtask('agg') 

41 

42 def run(self, measurements): 

43 return self.agg.run(measurements, self.config.connections.agg_name, self.config.connections.package, 

44 self.config.connections.metric)