LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Classes | Functions
lsst.afw.cameraGeom.fitsUtils Namespace Reference

Classes

class  HeaderMap
 
class  HeaderAmpMap
 
class  HeaderDetectorMap
 
class  DetectorBuilder
 

Functions

def getByKey
 
def setByKey
 

Function Documentation

def lsst.afw.cameraGeom.fitsUtils.getByKey (   metadata,
  key 
)
Wrapper for getting a value from a metadata object by key.
   @param[in] metadata  metadata object to query for value
   @param[in] key       key to use for value lookup
   @returns value associated with key, None if key does not exist

Definition at line 7 of file fitsUtils.py.

7 
8 def getByKey(metadata, key):
9  """Wrapper for getting a value from a metadata object by key.
10  @param[in] metadata metadata object to query for value
11  @param[in] key key to use for value lookup
12  @returns value associated with key, None if key does not exist
13  """
14  mdKeys = metadata.paramNames()
15  if key in mdKeys:
16  return metadata.get(key)
17  else:
18  return None
def lsst.afw.cameraGeom.fitsUtils.setByKey (   metadata,
  key,
  value,
  clobber 
)
Wrapper for setting a value in a metadata object.  Deals with case
   where the key already exists.
   @param[in, out] metadata  metadata object ot modify in place.
   @param[in] key       key to associate with value
   @param[in] value     value to assign in the metadata object
   @param[in] clobber   Clobber the value if the key already exisists?

Definition at line 19 of file fitsUtils.py.

19 
20 def setByKey(metadata, key, value, clobber):
21  """Wrapper for setting a value in a metadata object. Deals with case
22  where the key already exists.
23  @param[in, out] metadata metadata object ot modify in place.
24  @param[in] key key to associate with value
25  @param[in] value value to assign in the metadata object
26  @param[in] clobber Clobber the value if the key already exisists?
27  """
28  mdKeys = metadata.paramNames()
29  if key not in mdKeys or (key in mdKeys and clobber):
30  metadata.set(key, value)