catl_clean_nmin¶
-
sdss_catl_utils.mocks_manager.catl_utils.catl_clean_nmin(catl_pd, catl_kind, catl_info='memb', reindex=True, nmin=1, perf_opt=False)[source] [edit on github]¶ Cleans and removed the
badrows withfailedvalues, i.e. those that containfailedentries. This method also includes galaxies from groups above thenmingalaxy number threshold.Parameters: - catl_pd :
pandas.DataFrame DataFrame containing the information about galaxies or galaxy groups.
- catl_kind : {
data,mocks}str, optional Type of the catalogue being analyzed. This variable corresponds to whether a
realorsynthetic/mockcatalogue is being read/analyzed.- Options:
data: Catalogue(s) from the SDSSrealcataloguesmocks: Catalogue(s) from themockcatalogues.
- catl_info : {
memb,groups}bool, optional Option for which type of catalogue is being analyzed. This variable correspondos to whether a
galaxy-catalogue or agroup-catalogue is being analyzed. This variable is set tomembby default.- Options:
memb: Galaxy catalogue with themembergalaxies of groups.groups: Catalogues withgroupinformation.
- reindex :
bool, optional If
True, the output catalogue is reindexed from the original dataframecatl_pd. This variable is set toTrueby default.- nmin :
int, optional Minimum group richness to have in the (galaxy) group catalogue. This variable is set to
1by default, and must be larger than1.- perf_opt :
bool, optional Option for using a
perfectmock catalogue. This variable is set toFalseby default.
Returns: - catl_pd_mod :
pandas.DataFrame Version of
catl_pdafter having removed thefailedvalues ofsSFRandMstar, and also after having chosen only galaxies and groups with group richnesses larger thannmin.
Raises: - SDSSCatlUtils_Error : Exception from
SDSSCatlUtils_Error Program exception if input parameters are
notaccepted.
Examples
Before using this function, one needs to have read one of the (galaxy) group catalogues. If for example, one wants to create a new object from the
datarealSDSS catalogue with galaxies from groups withn > 10, one can do:>>> from cosmo_utils.utils import file_readers as cfr >>> from sdss_catl_utils.mocks_manager.catl_utils import catl_clean_nmin >>> nmin = 10 # Minimum number of galaxies in file >>> catl_pd = cfr.read_hdf5_file_to_pandas_DF('/path/to/file') # doctest: +SKIP >>> catl_mod = catl_clean_nmin(catl_pd, 'data', nmin=nmin) # doctest: +SKIP
Now, the resulting catalogue will only include galaxies from groups with
n > 10.- catl_pd :