astropy 5.0

ParametersRaisesReturns
index_of(self, key)

Parameters

key : int, str, tuple of (string, int) or BaseHDU

The key identifying the HDU. If key is a tuple, it is of the form (name, ver) where ver is an EXTVER value that must match the HDU being searched for.

If the key is ambiguous (e.g. there are multiple 'SCI' extensions) the first match is returned. For a more precise match use the (name, ver) pair.

If even the (name, ver) pair is ambiguous (it shouldn't be but it's not impossible) the numeric index must be used to index the duplicate HDU.

When key is an HDU object, this function returns the index of that HDU object in the HDUList .

Raises

ValueError

If key is an HDU object and it is not found in the HDUList .

KeyError

If an HDU specified by the key that is an extension number, extension name, or a tuple of extension name and version is not found in the HDUList .

Returns

index : int

The index of the HDU in the HDUList .

Get the index of an HDU from the HDUList .

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /astropy/io/fits/hdu/hdulist.py#692
type: <class 'function'>
Commit: