5.9. hedit

Edits the header of the given files.


FitsArray.hedit(self, keys: str | List[str], values: str | int | float | bool | List[str | int | float | bool] | None = None, comments: str | List[str] | None = None, delete: bool = False, value_is_key: bool = False) Self

Edits the header of the given files.

Parameters

keysUnion[str, List[str]]

Keys to be altered.

valuesOptional[Union[str, int, float, bool, List[Union[str, int, float, bool]]], optional

Values to be added or set. This will be ignored if delete is True.

commentsOptional[Union[str, List[str]]], optional

Comments to be added. This will be ignored if delete is True.

deletebool, optional

If set to True, deletes the key from the header.

value_is_keybool, optional

If set to True, adds the value of the key given in values. This will be ignored if delete is True.

Returns

FitsArray

The same FitsArray object after editing the headers.


5.9.1. Example:

from myraflib import FitsArray

fa = FitsArray.sample()
fa.hedit("MYRAF", "value")