def METHOD_NAME(self, cache=False, **kwargs):
    if not _fits:
        load_lib()
    hdulist = _fits.open(self.request.get_file(), cache=cache, **kwargs)
    self._index = []
    allowed_hdu_types = (_fits.ImageHDU, _fits.PrimaryHDU, _fits.CompImageHDU)
    for n, hdu in zip(range(len(hdulist)), hdulist):
        if isinstance(hdu, allowed_hdu_types):
            # Ignore (primary) header units with no data (use '.size'
            # rather than '.data' to avoid actually loading the image):
            if hdu.size > 0:
                self._index.append(n)
    self._hdulist = hdulist