code: def close(self):
          
          if hasattr(self, '_FITS'):
              if self._FITS is not None:
                  self._FITS.close()
                  self._FITS = None
          self._filename = None
          self.mode = None
          self.charmode = None
          self.intmode = None
          self.hdu_list = None
          self.hdu_map = None
docs: Close the fits file and set relevant metadata to None