{ } Raw JSON

bundles / astropy latest / astropy / io / fits / hdu / hdulist / HDUList / pop

function

astropy.io.fits.hdu.hdulist:HDUList.pop

source: /astropy/io/fits/hdu/hdulist.py :632

Signature

def   pop ( self index = -1 )

Summary

Remove an item from the list and return it.

Parameters

index : int, str, tuple of (string, int), optional

An integer value of index indicates the position from which pop() removes and returns an HDU. A string value or a tuple of (string, int) functions as a key for identifying the HDU to be removed and returned. If key is a tuple, it is of the form (key, 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 the numeric index must be used to index the duplicate HDU.

Returns

hdu : BaseHDU

The HDU object at position indicated by index or having name and version specified by index.

Aliases

  • astropy.io.fits.HDUList.pop