LSSTApplications  17.0+115,17.0+12,17.0+65,18.0.0+14,18.0.0+29,18.0.0+6,18.0.0+70,18.0.0-4-g68ffd23+1,18.1.0-1-g0001055+9,18.1.0-1-g03d53ef+2,18.1.0-1-g1349e88+44,18.1.0-1-g2505f39+35,18.1.0-1-g5315e5e+2,18.1.0-1-g5e4b7ea+11,18.1.0-1-g7e8fceb+2,18.1.0-1-g85f8cd4+38,18.1.0-1-gd55f500+25,18.1.0-13-gfe4edf0b,18.1.0-14-g259bd21+9,18.1.0-14-gd04256d+35,18.1.0-2-g4903023+12,18.1.0-2-g5f9922c+13,18.1.0-2-gd3b74e5+3,18.1.0-2-gfbf3545+22,18.1.0-2-gfefb8b5+34,18.1.0-22-g936f6a9b4,18.1.0-23-g364d03b8,18.1.0-23-g52ab674,18.1.0-3-g52aa583+17,18.1.0-3-g8f4a2b1+32,18.1.0-3-gb69f684+30,18.1.0-4-g1ee41a7+2,18.1.0-5-g6dbcb01+31,18.1.0-5-gc286bb7+4,18.1.0-6-g857e778+4,18.1.0-7-gae09a6d+18,18.1.0-8-g42b2ab3+10,18.1.0-8-gc69d46e+17,18.1.0-9-gee19f03+2,w.2019.44
LSSTDataManagementBasePackage
Classes | Functions
lsst.afw.cameraGeom.fitsUtils Namespace Reference

Classes

class  DetectorBuilder
 
class  HeaderAmpMap
 
class  HeaderDetectorMap
 
class  HeaderMap
 

Functions

def getByKey (metadata, key)
 
def setByKey (metadata, key, value, clobber)
 

Function Documentation

◆ getByKey()

def lsst.afw.cameraGeom.fitsUtils.getByKey (   metadata,
  key 
)
Wrapper for getting a value from a metadata object by key.

Parameters
----------
metadata : `lsst.daf.base.PropertySet`
    Metadata object to query for value.
key : `str`
    Key to use for value lookup.

   Returns
   -------
   value : `object`
   Value associated with key, None if key does not exist.

Definition at line 36 of file fitsUtils.py.

36 def getByKey(metadata, key):
37  """Wrapper for getting a value from a metadata object by key.
38 
39  Parameters
40  ----------
41  metadata : `lsst.daf.base.PropertySet`
42  Metadata object to query for value.
43  key : `str`
44  Key to use for value lookup.
45 
46  Returns
47  -------
48  value : `object`
49  Value associated with key, None if key does not exist.
50  """
51  mdKeys = metadata.paramNames()
52  if key in mdKeys:
53  return metadata.getScalar(key)
54  else:
55  return None
56 
57 
def getByKey(metadata, key)
Definition: fitsUtils.py:36

◆ setByKey()

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.

Parameters
----------
metadata : `lsst.daf.base.PropertySet`
    Metadata object ot modify in place.
key : `str`
    Key to associate with value.
value : `object`
    Value to assign in the metadata object.
clobber : `bool`
    Clobber the value if the key already exists?

Definition at line 58 of file fitsUtils.py.

58 def setByKey(metadata, key, value, clobber):
59  """Wrapper for setting a value in a metadata object. Deals with case
60  where the key already exists.
61 
62  Parameters
63  ----------
64  metadata : `lsst.daf.base.PropertySet`
65  Metadata object ot modify in place.
66  key : `str`
67  Key to associate with value.
68  value : `object`
69  Value to assign in the metadata object.
70  clobber : `bool`
71  Clobber the value if the key already exists?
72  """
73  mdKeys = metadata.paramNames()
74  if key not in mdKeys or (key in mdKeys and clobber):
75  metadata.set(key, value)
76 
77 
def setByKey(metadata, key, value, clobber)
Definition: fitsUtils.py:58