clevar.match.membership module¶
- class clevar.match.membership.MembershipMatch[source]¶
Bases:
clevar.match.parent.Match
Adds shared members dicts and nmem to mt_input in catalogs.
- Parameters
cat1 (clevar.ClCatalog) – Cluster catalog with members attribute.
cat2 (clevar.ClCatalog) – Cluster catalog with members attribute.
- load_matched_members(filename)[source]¶
Load matching results of members
- Parameters
filename (str) – Name of file with matching results
Load dictionaries of shared members
- Parameters
cat1 (clevar.ClCatalog) – Base catalog
cat2 (clevar.ClCatalog) – Target catalog
filename (str) – Prefix of files name
- match_from_config(cat1, cat2, match_config, cosmo=None)[source]¶
Make matching of catalogs based on a configuration dictionary
- Parameters
cat1 (clevar.ClCatalog) – ClCatalog 1
cat2 (clevar.ClCatalog) – ClCatalog 2
mem1 (clevar.ClCatalog) – Members of base catalog
mem2 (clevar.ClCatalog) – Members of target catalog
match_config (dict) –
Dictionary with the matching configuration. Keys must be:
type - type of matching, can be: cat1, cat2, cross.
preference - Preference to set best match, can be: more_massive, angular_proximity, redshift_proximity, shared_member_fraction (default).
minimum_share_fraction1 - Minimum share fraction of catalog 1 to consider in matches (default=0).
minimum_share_fraction2 - Minimum share fraction of catalog 2 to consider in matches (default=0).
match_members - Match the members catalogs (default=`True`).
match_members_kwargs - kwargs used in match_members(mem1, mem2, **kwargs), needed if match_members=True.
match_members_save - saves file with matched members (default=`False`).
match_members_load - load matched members (default=`False`), if True skips matching (and save) of members.
match_members_file - file to save matching of members, needed if match_members_save or match_members_load is True.
shared_members_fill - Adds shared members dicts and nmem to mt_input in catalogs (default=`True`).
shared_members_save - saves files with shared members (default=`False`).
shared_members_load - load files with shared members (default=`False`), if True skips matching (and save) of members and fill (and save) of shared members.
shared_members_file - Prefix of file names to save shared members, needed if shared_members_save or shared_members_load is True.
verbose: Print result for individual matches (default=`True`).
- match_members(mem1, mem2, method='id', radius=None, cosmo=None)[source]¶
Match member catalogs. Adds array with indices of matched members (ind1, ind2) to self.matched_mems.
- Parameters
mem1 (clevar.ClCatalog) – Members of base catalog
mem2 (clevar.ClCatalog) – Members of target catalog
method (str) – Method for matching. Options are id or angular_distance.
radius (str, None) – For method=’angular_distance’. Radius for matching, with format ‘value unit’ - used fixed value (ex: 1 arcsec, 1 Mpc).
cosmo (clevar.Cosmology, None) – For method=’angular_distance’. Cosmology object for when radius has physical units.
- multiple(cat1, cat2, verbose=True)[source]¶
Make the one way multiple matching
- Parameters
cat1 (clevar.ClCatalog) – Base catalog with members attribute.
cat2 (clevar.ClCatalog) – Target catalog with members attribute.
verbose (bool) – Print result for individual matches.
- save_matched_members(filename, overwrite=False)[source]¶
Saves the matching results of members
- Parameters
filename (str) – Name of file
overwrite (bool) – Overwrite saved files
Saves dictionaries of shared members
- Parameters
cat1 (clevar.ClCatalog) – Cluster catalog with members attribute.
cat2 (clevar.ClCatalog) – Cluster catalog with members attribute.
fileprefix (str) – Prefix for name of files
overwrite (bool) – Overwrite saved files