def _parse(self, roi=None, filenames=None):
        """        
        Parse catalog FITS files into recarray.

        Parameters:
        -----------
        roi : The region of interest; if 'roi=None', read all catalog files

        Returns:
        --------
        None
        """
        if (roi is not None) and (filenames is not None):
            msg = "Cannot take both roi and filenames"
            raise Exception(msg)

        if roi is not None:
            pixels = roi.getCatalogPixels()
            filenames = self.config.getFilenames()['catalog'][pixels]
        elif filenames is None:
            filenames = self.config.getFilenames()['catalog'].compressed()
        else:
            filenames = np.atleast_1d(filenames)

        if len(filenames) == 0:
            msg = "No catalog files found."
            raise Exception(msg)

        # Load the data
        self.data = load_infiles(filenames)

        # Apply a selection cut
        self._applySelection()

        # Cast data to recarray (historical reasons)
        self.data = self.data.view(np.recarray)
Parse catalog FITS files into recarray.

        Parameters:
        -----------
        roi : The region of interest; if 'roi=None', read all catalog files

        Returns:
        --------
        None