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
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)