LSSTApplications  17.0+10,17.0+51,17.0+88,18.0.0+10,18.0.0+15,18.0.0+34,18.0.0+4,18.0.0+6,18.0.0-2-ge43143a+6,18.1.0-1-g0001055+2,18.1.0-1-g0896a44+10,18.1.0-1-g1349e88+9,18.1.0-1-g2505f39+7,18.1.0-1-g380d4d4+9,18.1.0-1-g5e4b7ea+2,18.1.0-1-g7e8fceb,18.1.0-1-g85f8cd4+7,18.1.0-1-g9a6769a+3,18.1.0-1-ga1a4c1a+6,18.1.0-1-gc037db8+2,18.1.0-1-gd55f500+3,18.1.0-1-ge10677a+7,18.1.0-10-g73b8679e+12,18.1.0-12-gf30922b,18.1.0-13-g451e75588,18.1.0-13-gbfe7f7f,18.1.0-2-g31c43f9+7,18.1.0-2-g9c63283+9,18.1.0-2-gdf0b915+9,18.1.0-2-gf03bb23+2,18.1.0-3-g52aa583+3,18.1.0-3-g8f4a2b1+1,18.1.0-3-g9cb968e+8,18.1.0-4-g7bbbad0,18.1.0-5-g510c42a+8,18.1.0-5-ga46117f,18.1.0-5-gaeab27e+9,18.1.0-6-gdda7f3e+11,18.1.0-8-g4084bf03+1,w.2019.34
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