LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | Static Public Attributes | Static Private Attributes | List of all members
lsst.pipe.tasks.getRepositoryData.GetRepositoryDataTask Class Reference
Inheritance diagram for lsst.pipe.tasks.getRepositoryData.GetRepositoryDataTask:

Public Member Functions

def __init__
 
def run
 
def getIdList
 
def getDataList
 
def getMetadataItems
 

Static Public Attributes

 ConfigClass = pexConfig.Config
 
 RunnerClass = DataRefListRunner
 

Static Private Attributes

string _DefaultName = "getTaskData"
 

Detailed Description

Retrieve data from a repository, e.g. for plotting or analysis purposes

Definition at line 73 of file getRepositoryData.py.

Constructor & Destructor Documentation

def lsst.pipe.tasks.getRepositoryData.GetRepositoryDataTask.__init__ (   self,
  args,
  kwargs 
)

Definition at line 80 of file getRepositoryData.py.

80 
81  def __init__(self, *args, **kwargs):
82  pipeBase.CmdLineTask.__init__(self, *args, **kwargs)

Member Function Documentation

def lsst.pipe.tasks.getRepositoryData.GetRepositoryDataTask.getDataList (   self,
  dataRefList,
  datasetType 
)
Retrieve a list of data

@param dataRefList: a list of data references
@param datasetType: datasetType of data to be retrieved
@return a list of data, one entry per dataRef in dataRefList (in order)

Definition at line 113 of file getRepositoryData.py.

114  def getDataList(self, dataRefList, datasetType):
115  """Retrieve a list of data
116 
117  @param dataRefList: a list of data references
118  @param datasetType: datasetType of data to be retrieved
119  @return a list of data, one entry per dataRef in dataRefList (in order)
120  """
121  return [dataRef.get(datasetType=datasetType) for dataRef in dataRefList]
def lsst.pipe.tasks.getRepositoryData.GetRepositoryDataTask.getIdList (   self,
  dataRefList 
)
Get a list of data IDs in a form that can be used as dictionary keys

@param dataRefList: a list of data references
@return a pipe_base Struct with fields:
- idKeyTuple: a tuple of dataRef data ID keys
- idValList: a list of data ID value tuples, each tuple contains values in the order in idKeyTuple

Definition at line 91 of file getRepositoryData.py.

91 
92  def getIdList(self, dataRefList):
93  """Get a list of data IDs in a form that can be used as dictionary keys
94 
95  @param dataRefList: a list of data references
96  @return a pipe_base Struct with fields:
97  - idKeyTuple: a tuple of dataRef data ID keys
98  - idValList: a list of data ID value tuples, each tuple contains values in the order in idKeyTuple
99  """
100  if not dataRefList:
101  raise RuntimeError("No data refs")
102  idKeyTuple = tuple(sorted(dataRefList[0].dataId.keys()))
103 
104  idValList = []
105  for dataRef in dataRefList:
106  idValTuple = tuple(dataRef.dataId[key] for key in idKeyTuple)
107  idValList.append(idValTuple)
108 
109  return pipeBase.Struct(
110  idKeyTuple = idKeyTuple,
111  idValList = idValList,
112  )
def lsst.pipe.tasks.getRepositoryData.GetRepositoryDataTask.getMetadataItems (   self,
  dataRefList,
  datasetType,
  nameList 
)
Retrieve a list of dictionaries of metadata

@param dataRefList: a list of data references
@param datasetType: datasetType of metadata (or any object that supports get(name))
@return a list of dicts of metadata:
- each entry in the list corresponds to a dataRef in dataRefList
- each dict contains name: item of metadata, for each name in nameList

Definition at line 122 of file getRepositoryData.py.

123  def getMetadataItems(self, dataRefList, datasetType, nameList):
124  """Retrieve a list of dictionaries of metadata
125 
126  @param dataRefList: a list of data references
127  @param datasetType: datasetType of metadata (or any object that supports get(name))
128  @return a list of dicts of metadata:
129  - each entry in the list corresponds to a dataRef in dataRefList
130  - each dict contains name: item of metadata, for each name in nameList
131  """
132  valList = []
133  for dataRef in dataRefList:
134  metadata = dataRef.get(datasetType=datasetType)
135  valList.append(dict((name, metadata.get(name)) for name in nameList))
136  return valList
def lsst.pipe.tasks.getRepositoryData.GetRepositoryDataTask.run (   self,
  dataRefList 
)
Get data from a repository for a collection of data references
    
@param dataRefList: a list of data references

Definition at line 84 of file getRepositoryData.py.

84 
85  def run(self, dataRefList):
86  """Get data from a repository for a collection of data references
87 
88  @param dataRefList: a list of data references
89  """
90  raise NotImplementedError("subclass must specify a run method")

Member Data Documentation

string lsst.pipe.tasks.getRepositoryData.GetRepositoryDataTask._DefaultName = "getTaskData"
staticprivate

Definition at line 78 of file getRepositoryData.py.

lsst.pipe.tasks.getRepositoryData.GetRepositoryDataTask.ConfigClass = pexConfig.Config
static

Definition at line 76 of file getRepositoryData.py.

lsst.pipe.tasks.getRepositoryData.GetRepositoryDataTask.RunnerClass = DataRefListRunner
static

Definition at line 77 of file getRepositoryData.py.


The documentation for this class was generated from the following file: