def redo(self):
        image = self.fitsimage.get_image()
        if (image is None) or (image == self.image):
            return True

        path = image.get('path', None)
        if path is None:
            self.fv.show_error("Cannot open image: no value for metadata key 'path'")
            return

        self.path = path

        name = image.get('name', self.fv.name_image_from_path(path))
        idx = image.get('idx', None)
        # remove index designation from root of name, if any
        match = re.match(r'^(.+)\[(.+)\]$', name)
        if match:
            name = match.group(1)
        self.name_pfx = name

        self.fits_f = pyfits.open(path, 'readonly')

        lower = 0
        upper = len(self.fits_f) - 1
        info = self.fits_f.info(output=False)
        self.prep_hdu_menu(self.w.hdu, info)
        self.num_hdu = upper
        self.logger.debug("there are %d hdus" % (upper+1))
        self.w.numhdu.set_text("%d" % (upper+1))

        if idx is not None:
            # set the HDU in the drop down if known
            info = self.hdu_db.get(idx, None)
            if info is not None:
                index = info.index
                self.w.hdu.set_index(index)
                self.set_hdu(index)

        self.w.hdu.set_enabled(len(self.fits_f) > 0)
Called when an image is set in the channel.
dataset/ETHPy150Open ejeschke/ginga/ginga/misc/plugins/MultiDim.py/MultiDim.redo