| | |
Methods defined here:
- __del__(self)
- __getitem__(self, key)
- __init__(self, filename=None, extension=0)
- Create a new header object
If filename is not None, the the header will be read
If the extension is not 0, the header will be read from
the specified extension.
If no filename is specidied this will be an empty header object
- __setitem__(self, key, val)
- add(self, key, val, comment)
- Add a new key-value-comment tuple to the header
It is assumed that the key is not presently in the header.
The item will be added in the appropriate section of the header
(main, hierarch eso sections, comments, history).
- add_after(self, after_key, key, val, comment)
- Add a new key-value-comment tuple after an existing key
- append(self, key, val, comment)
- Append a new key-value-comment tuple to the end of the header
WARNING. This will most likely write key-value-comment tuples
after the END key. This will invalidate the header. Only use this to
append values to header initialized with the new() method
- copy(self)
- Make a copy of the header
Returns a new header object containing the same values as this
headerr object
- default(self)
- Create a default header object
Make this header into a default header.
A default header defines the keywords SIMPLE and END
- dump(self)
- get_commentstr(self, key)
- get_valstr(self, key)
- get_value(self, key)
- merge(self, other)
- Merge this header with another header
Returns a new heade combining the values of this headr with
those of another header
- modify(self, key, val, comment)
- Modidfy the value and/or comment of an existing key
- new(self)
- Create a new header empty object
WARNING: This returns an invalid(empty) header object. To
make this a valid header, make sure you first append either
SIMPLE or XTENSION, and then append END. Other operations on a
non-valid header are not defined
|