|
lsst.daf.base g9acbc9a64b+25ce2dec9e
|
Public Member Functions | |
| get (self, name, default=None) | |
| getArray (self, name) | |
| getScalar (self, name) | |
| set (self, name, value, comment=None) | |
| add (self, name, value, comment=None) | |
| setComment (self, name, comment) | |
| "PropertyList" | from_astropy_header (cls, astropy.io.fits.Header header) |
| astropy.io.fits.Header | to_astropy_header (self) |
| toList (self) | |
| toOrderedDict (self) | |
| __eq__ (self, other) | |
| __copy__ (self) | |
| __deepcopy__ (self, memo) | |
| __iter__ (self) | |
| __setitem__ (self, name, value) | |
| __reduce__ (self) | |
| NestedMetadataDict | get_dict (self, str key) |
| None | set_dict (self, str key, NestedMetadataDict value) |
Static Public Attributes | |
| str | COMMENTSUFFIX = "#COMMENT" |
| toDict = toOrderedDict | |
Static Protected Attributes | |
| dict | _typeMenu |
Definition at line 853 of file propertyContainerContinued.py.
| lsst.daf.base.propertyContainer.propertyContainerContinued.PropertyList.__copy__ | ( | self | ) |
Definition at line 1135 of file propertyContainerContinued.py.
| lsst.daf.base.propertyContainer.propertyContainerContinued.PropertyList.__deepcopy__ | ( | self, | |
| memo ) |
Definition at line 1142 of file propertyContainerContinued.py.
| lsst.daf.base.propertyContainer.propertyContainerContinued.PropertyList.__eq__ | ( | self, | |
| other ) |
Definition at line 1122 of file propertyContainerContinued.py.
| lsst.daf.base.propertyContainer.propertyContainerContinued.PropertyList.__iter__ | ( | self | ) |
Definition at line 1147 of file propertyContainerContinued.py.
| lsst.daf.base.propertyContainer.propertyContainerContinued.PropertyList.__reduce__ | ( | self | ) |
Definition at line 1181 of file propertyContainerContinued.py.
| lsst.daf.base.propertyContainer.propertyContainerContinued.PropertyList.__setitem__ | ( | self, | |
| name, | |||
| value ) |
Assigns the supplied value to the container.
Parameters
----------
name : `str`
Name of item to update. If the name ends with
`PropertyList.COMMENTSUFFIX`, the comment is updated rather
than the value.
value : Value to assign
Can be any value supported by the container's ``set()``
method. `~collections.abc.Mapping` are converted to
`PropertySet` before assignment.
Notes
-----
Uses `PropertySet.set`, overwriting any previous value.
Definition at line 1151 of file propertyContainerContinued.py.
| lsst.daf.base.propertyContainer.propertyContainerContinued.PropertyList.add | ( | self, | |
| name, | |||
| value, | |||
| comment = None ) |
Append one or more values to a given item, which need not exist
If the item exists then the new value(s) are appended;
otherwise it is like calling `set`
Parameters
----------
name : `str`
Name of item
value : any supported type
Value of item; may be a scalar or array
Notes
-----
If `value` is an `lsst.daf.base.PropertySet` items are added
using dotted names (e.g. if name="a" and value contains
an item "b" which is another PropertySet and contains an
item "c" which is numeric or string, then the value of "c"
is added as "a.b.c", appended to the existing values of
"a.b.c" if any (in which case the types must be compatible).
Raises
------
lsst::pex::exceptions::TypeError
Raise if the type of ``value`` is incompatible with the existing
value of the item.
Definition at line 957 of file propertyContainerContinued.py.
| "PropertyList" lsst.daf.base.propertyContainer.propertyContainerContinued.PropertyList.from_astropy_header | ( | cls, | |
| astropy.io.fits.Header | header ) |
Convert an `astropy.io.fits.Header` into a `PropertyList`.
Parameters
----------
header : `astropy.io.fits.Header`
FITS header to convert.
Returns
-------
propertyList : `PropertyList`
Equivalent legacy metadata. Blank (keyword-less) cards and
cards whose values Astropy cannot parse (e.g. from unterminated
quoted strings in real raw headers) are skipped. Cards with
`astropy.io.fits.card.Undefined` values (e.g. ``SEEING =``) are
stored as undefined properties (``TYPE_Undef``), preserving any
comment text. COMMENT and HISTORY cards hold their text as
string values, as they do both in FITS convention and when read
back by `lsst.afw.fits.readMetadata`.
Notes
-----
Comments on cards are preserved via `PropertyList.add`, and so are
keyed by name: cards that repeat a keyword share that keyword's
comment slot.
Definition at line 1010 of file propertyContainerContinued.py.
| lsst.daf.base.propertyContainer.propertyContainerContinued.PropertyList.get | ( | self, | |
| name, | |||
| default = None ) |
Return an item as a scalar, else default.
Identical to `getScalar` except that a default value is returned
if the requested key is not present. If an array item is requested
the final value in the array will be returned.
Parameters
----------
name : ``str``
Name of item
default : `object`, optional
Default value to use if the named item is not present.
Returns
-------
value : any type supported by container
Single value of any type supported by the container, else the
default value if the requested item is not present in the
container. For array items the most recently added value is
returned.
Definition at line 869 of file propertyContainerContinued.py.
| NestedMetadataDict lsst.daf.base.propertyContainer.propertyContainerContinued.PropertyList.get_dict | ( | self, | |
| str | key ) |
Return a possibly-hierarchical nested `dict`.
This implements the `lsst.pipe.base.GetDictMetadata` protocol for
consistency with `lsst.pipe.base.TaskMetadata` and `PropertySet`.
Parameters
----------
key : `str`
String key associated with the mapping. May not have a ``.``
character.
Returns
-------
value : `~collections.abc.Mapping`
Possibly-nested mapping, with `str` keys and values that are `int`,
`float`, `str`, `bool`, or another `dict` with the same key and
value types. Will be empty if ``key`` does not exist.
Definition at line 1189 of file propertyContainerContinued.py.
| lsst.daf.base.propertyContainer.propertyContainerContinued.PropertyList.getArray | ( | self, | |
| name ) |
Return an item as a list.
Parameters
----------
name : `str`
Name of item
Returns
-------
values : `list` of values
The contents of the item, guaranteed to be returned as a `list.`
Raises
------
KeyError
Raised if the item does not exist.
Definition at line 896 of file propertyContainerContinued.py.
| lsst.daf.base.propertyContainer.propertyContainerContinued.PropertyList.getScalar | ( | self, | |
| name ) |
Return an item as a scalar
If the item has more than one value then the last value is returned.
Parameters
----------
name : `str`
Name of item.
Returns
-------
value : scalar item
Value stored in the item. If the item refers to an array the
most recently added value is returned.
Raises
------
KeyError
Raised if the item does not exist.
Definition at line 916 of file propertyContainerContinued.py.
| lsst.daf.base.propertyContainer.propertyContainerContinued.PropertyList.set | ( | self, | |
| name, | |||
| value, | |||
| comment = None ) |
Set the value of an item
If the item already exists it is silently replaced; the types
need not match.
Parameters
----------
name : `str`
Name of item
value : any supported type
Value of item; may be a scalar or array
Definition at line 939 of file propertyContainerContinued.py.
| None lsst.daf.base.propertyContainer.propertyContainerContinued.PropertyList.set_dict | ( | self, | |
| str | key, | ||
| NestedMetadataDict | value ) |
Assign a possibly-hierarchical nested `dict`.
This implements the `lsst.pipe.base.SetDictMetadata` protocol for
consistency with `lsst.pipe.base.TaskMetadata` and `PropertySet`.
Parameters
----------
key : `str`
String key associated with the mapping. May not have a ``.``
character.
value : `~collections.abc.Mapping`
Possibly-nested mapping, with `str` keys and values that are `int`,
`float`, `str`, `bool`, or another `dict` with the same key and
value types. Nested keys may not have a ``.`` character.
Definition at line 1219 of file propertyContainerContinued.py.
| lsst.daf.base.propertyContainer.propertyContainerContinued.PropertyList.setComment | ( | self, | |
| name, | |||
| comment ) |
Set the comment for an existing entry.
Parameters
----------
name : `str`
Name of the key to receive updated comment.
comment : `comment`
New comment string.
Definition at line 990 of file propertyContainerContinued.py.
| astropy.io.fits.Header lsst.daf.base.propertyContainer.propertyContainerContinued.PropertyList.to_astropy_header | ( | self | ) |
Convert this `PropertyList` into an `astropy.io.fits.Header`.
Returns
-------
header : `astropy.io.fits.Header`
FITS header with one card per stored value, in insertion order.
Undefined properties become cards with no value
(`astropy.io.fits.card.Undefined`); string values stored under
the COMMENT and HISTORY keywords render as bare comment cards
(``COMMENT text``) rather than ``COMMENT = 'text'``. Comments
set via `PropertyList.add` or `setComment` are restored.
Definition at line 1053 of file propertyContainerContinued.py.
| lsst.daf.base.propertyContainer.propertyContainerContinued.PropertyList.toList | ( | self | ) |
Return a list of tuples of name, value, comment for each property
in the order that they were inserted.
Returns
-------
ret : `list` of `tuple`
Tuples of name, value, comment for each property in the order
in which they were inserted.
Definition at line 1078 of file propertyContainerContinued.py.
| lsst.daf.base.propertyContainer.propertyContainerContinued.PropertyList.toOrderedDict | ( | self | ) |
Return an ordered dictionary with all properties in the order that
they were inserted.
Returns
-------
d : `dict`
Ordered dictionary with all properties in the order that they
were inserted. Comments are not included.
Notes
-----
As of Python 3.6 dicts retain their insertion order.
Definition at line 1100 of file propertyContainerContinued.py.
|
staticprotected |
Definition at line 855 of file propertyContainerContinued.py.
|
static |
Definition at line 865 of file propertyContainerContinued.py.
|
static |
Definition at line 1120 of file propertyContainerContinued.py.