LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Public Member Functions | Static Public 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__ (self, *args, **kwargs)
 
def runDataRef (self, dataRefList)
 
def getIdList (self, dataRefList)
 
def getDataList (self, dataRefList, datasetType)
 
def getMetadataItems (self, dataRefList, datasetType, nameList)
 

Static Public Attributes

 ConfigClass = pexConfig.Config
 
 RunnerClass = DataRefListRunner
 

Detailed Description

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

Definition at line 68 of file getRepositoryData.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 75 of file getRepositoryData.py.

75  def __init__(self, *args, **kwargs):
76  pipeBase.CmdLineTask.__init__(self, *args, **kwargs)
77 

Member Function Documentation

◆ getDataList()

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 108 of file getRepositoryData.py.

108  def getDataList(self, dataRefList, datasetType):
109  """Retrieve a list of data
110 
111  @param dataRefList: a list of data references
112  @param datasetType: datasetType of data to be retrieved
113  @return a list of data, one entry per dataRef in dataRefList (in order)
114  """
115  return [dataRef.get(datasetType=datasetType) for dataRef in dataRefList]
116 

◆ getIdList()

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 86 of file getRepositoryData.py.

86  def getIdList(self, dataRefList):
87  """Get a list of data IDs in a form that can be used as dictionary keys
88 
89  @param dataRefList: a list of data references
90  @return a pipe_base Struct with fields:
91  - idKeyTuple: a tuple of dataRef data ID keys
92  - idValList: a list of data ID value tuples, each tuple contains values in the order in idKeyTuple
93  """
94  if not dataRefList:
95  raise RuntimeError("No data refs")
96  idKeyTuple = tuple(sorted(dataRefList[0].dataId.keys()))
97 
98  idValList = []
99  for dataRef in dataRefList:
100  idValTuple = tuple(dataRef.dataId[key] for key in idKeyTuple)
101  idValList.append(idValTuple)
102 
103  return pipeBase.Struct(
104  idKeyTuple=idKeyTuple,
105  idValList=idValList,
106  )
107 

◆ getMetadataItems()

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;
    numeric and string values will be returned as arrays

Definition at line 117 of file getRepositoryData.py.

117  def getMetadataItems(self, dataRefList, datasetType, nameList):
118  """Retrieve a list of dictionaries of metadata
119 
120  @param dataRefList: a list of data references
121  @param datasetType: datasetType of metadata (or any object that supports get(name))
122  @return a list of dicts of metadata:
123  - each entry in the list corresponds to a dataRef in dataRefList
124  - each dict contains name: item of metadata, for each name in nameList;
125  numeric and string values will be returned as arrays
126  """
127  valList = []
128  for dataRef in dataRefList:
129  metadata = dataRef.get(datasetType=datasetType)
130  valList.append(dict((name, metadata.getArray(name)) for name in nameList))
131  return valList

◆ runDataRef()

def lsst.pipe.tasks.getRepositoryData.GetRepositoryDataTask.runDataRef (   self,
  dataRefList 
)
Get data from a repository for a collection of data references

@param dataRefList: a list of data references

Definition at line 79 of file getRepositoryData.py.

79  def runDataRef(self, dataRefList):
80  """Get data from a repository for a collection of data references
81 
82  @param dataRefList: a list of data references
83  """
84  raise NotImplementedError("subclass must specify a run method")
85 

Member Data Documentation

◆ ConfigClass

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

Definition at line 71 of file getRepositoryData.py.

◆ RunnerClass

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

Definition at line 72 of file getRepositoryData.py.


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