def load_existing_catalog(self, cat, **kwargs):
        """Load sources from an existing catalog object.

        Parameters
        ----------
        cat : `~fermipy.catalog.Catalog`
            Catalog object.

        """
        coordsys = kwargs.get('coordsys', 'CEL')
        extdir = kwargs.get('extdir', self.extdir)
        srcname = kwargs.get('srcname', None)

        m0 = get_skydir_distance_mask(cat.skydir, self.skydir,
                                      self.config['src_radius'])
        m1 = get_skydir_distance_mask(cat.skydir, self.skydir,
                                      self.config['src_radius_roi'],
                                      square=True, coordsys=coordsys)
        m = (m0 & m1)
        if srcname is not None:
            m &= utils.find_rows_by_string(cat.table, [srcname],
                                           self.src_name_cols)

        offset = self.skydir.separation(cat.skydir).deg
        offset_cel = wcs_utils.sky_to_offset(self.skydir,
                                             cat.radec[:, 0], cat.radec[:, 1],
                                             'CEL')
        offset_gal = wcs_utils.sky_to_offset(self.skydir,
                                             cat.glonlat[
                                                 :, 0], cat.glonlat[:, 1],
                                             'GAL')

        for i, (row, radec) in enumerate(zip(cat.table[m],
                                             cat.radec[m])):
            catalog_dict = catalog.row_to_dict(row)
            src_dict = {'catalog': catalog_dict}
            src_dict['Source_Name'] = row['Source_Name']
            src_dict['SpectrumType'] = row['SpectrumType']

            if row['extended']:
                src_dict['SourceType'] = 'DiffuseSource'
                src_dict['SpatialType'] = str(row['Spatial_Function'])
                src_dict['SpatialModel'] = str(row['Spatial_Function'])

                search_dirs = []
                if extdir is not None:
                    search_dirs += [extdir, os.path.join(extdir, 'Templates')]

                search_dirs += [row['extdir'],
                                os.path.join(row['extdir'], 'Templates')]

                if src_dict['SpatialType'] == 'SpatialMap':
                    src_dict['Spatial_Filename'] = utils.resolve_file_path(
                        row['Spatial_Filename'],
                        search_dirs=search_dirs)

            else:
                src_dict['SourceType'] = 'PointSource'
                src_dict['SpatialType'] = 'SkyDirFunction'
                src_dict['SpatialModel'] = 'PointSource'

            src_dict['spectral_pars'] = spectral_pars_from_catalog(
                catalog_dict)
            src_dict['spatial_pars'] = spatial_pars_from_catalog(catalog_dict)

            src = Source(src_dict['Source_Name'], src_dict, radec=radec)
            src.data['offset'] = offset[m][i]
            src.data['offset_ra'] = offset_cel[:, 0][m][i]
            src.data['offset_dec'] = offset_cel[:, 1][m][i]
            src.data['offset_glon'] = offset_gal[:, 0][m][i]
            src.data['offset_glat'] = offset_gal[:, 1][m][i]
            self.load_source(src, False,
                             merge_sources=self.config['merge_sources'])

        self._build_src_index()
Load sources from an existing catalog object.

        Parameters
        ----------
        cat : `~fermipy.catalog.Catalog`
            Catalog object.