LSSTApplications  1.1.2+25,10.0+13,10.0+132,10.0+133,10.0+224,10.0+41,10.0+8,10.0-1-g0f53050+14,10.0-1-g4b7b172+19,10.0-1-g61a5bae+98,10.0-1-g7408a83+3,10.0-1-gc1e0f5a+19,10.0-1-gdb4482e+14,10.0-11-g3947115+2,10.0-12-g8719d8b+2,10.0-15-ga3f480f+1,10.0-2-g4f67435,10.0-2-gcb4bc6c+26,10.0-28-gf7f57a9+1,10.0-3-g1bbe32c+14,10.0-3-g5b46d21,10.0-4-g027f45f+5,10.0-4-g86f66b5+2,10.0-4-gc4fccf3+24,10.0-40-g4349866+2,10.0-5-g766159b,10.0-5-gca2295e+25,10.0-6-g462a451+1
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)