# Path: redmapper/cluster.py
# class Cluster(Entry):
# class ClusterCatalog(Catalog):
#     def __init__(self, cat_vals=None, r0=None, beta=None, config=None, zredstr=None, bkg=None, cbkg=None, neighbors=None, zredbkg=None, dtype=None):
#     def reset(self):
#     def set_neighbors(self, neighbors):
#     def find_neighbors(self, radius, galcat, megaparsec=False, maxmag=None):
#     def update_neighbors_dist(self):
#     def clear_neighbors(self):
#     def _calc_radial_profile(self, idx=None, rscale=0.15):
#     def _calc_luminosity(self, normmag, idx=None):
#     def calc_bkg_density(self, r, chisq, refmag):
#     def calc_cbkg_density(self, r, col_index, col, refmag):
#     def calc_zred_bkg_density(self, r, zred, refmag):
#     def compute_bkg_local(self, mask, depth):
#     def calc_richness(self, mask, calc_err=True, index=None):
#     def calc_lambdacerr(self, maskgals, mstar, lam, rlam, pmem, cval, gamma):
#     def calc_richness_fit(self, mask, col_index, centcolor_in=None, rcut=0.5, mingal=5, sigint=0.05, calc_err=False):
#     def redshift(self):
#     def redshift(self, value):
#     def mstar(self):
#     def _update_mstar(self):
#     def mpc_scale(self):
#     def _update_mpc_scale(self):
#     def _compute_neighbor_r(self):
#     def copy(self):
#     def __copy__(self):
#     def __init__(self, array, **kwargs):
#     def from_catfile(cls, filename, **kwargs):
#     def zeros(cls, size, **kwargs):
#     def __getitem__(self, key):
# 
# Path: redmapper/_version.py



import yaml
import fitsio
import copy
import numpy as np
import re
import os
import logging
from esutil.cosmology import Cosmo
from .cluster import cluster_dtype_base, member_dtype_base
from ._version import __version__
                raise RuntimeError("You must set a config file area if no depthfile is present and you are running a sub-region")
        self._set_vars_from_dict(gal_stats, check_none=True)

        if self.limmag_catalog is None:
            self.limmag_catalog = self.limmag_ref

        # Get wcen numbers if available
        self.set_wcen_vals()

        # Set some defaults
        if self.specfile_train is None:
            self.specfile_train = self.specfile

        # Record the cluster dtype for convenience
        self.cluster_dtype = copy.copy(cluster_dtype_base)
        self.cluster_dtype.extend([('MAG', 'f4', self.nmag),
                                   ('MAG_ERR', 'f4', self.nmag),
                                   ('PZBINS', 'f4', self.npzbins),
                                   ('PZ', 'f4', self.npzbins),
                                   ('RA_CENT', 'f8', self.percolation_maxcen),
                                   ('DEC_CENT', 'f8', self.percolation_maxcen),
                                   ('ID_CENT', 'i8', self.percolation_maxcen),
                                   ('LAMBDA_CENT', 'f4', self.percolation_maxcen),
                                   ('ZLAMBDA_CENT', 'f4', self.percolation_maxcen),
                                   ('P_CEN', 'f4', self.percolation_maxcen),
                                   ('Q_CEN', 'f4', self.percolation_maxcen),
                                   ('P_FG', 'f4', self.percolation_maxcen),
                                   ('Q_MISS', 'f4'),
                                   ('P_SAT', 'f4', self.percolation_maxcen),
                                   ('P_C', 'f4', self.percolation_maxcen)])

# Path: redmapper/cluster.py
# class Cluster(Entry):
# class ClusterCatalog(Catalog):
#     def __init__(self, cat_vals=None, r0=None, beta=None, config=None, zredstr=None, bkg=None, cbkg=None, neighbors=None, zredbkg=None, dtype=None):
#     def reset(self):
#     def set_neighbors(self, neighbors):
#     def find_neighbors(self, radius, galcat, megaparsec=False, maxmag=None):
#     def update_neighbors_dist(self):
#     def clear_neighbors(self):
#     def _calc_radial_profile(self, idx=None, rscale=0.15):
#     def _calc_luminosity(self, normmag, idx=None):
#     def calc_bkg_density(self, r, chisq, refmag):
#     def calc_cbkg_density(self, r, col_index, col, refmag):
#     def calc_zred_bkg_density(self, r, zred, refmag):
#     def compute_bkg_local(self, mask, depth):
#     def calc_richness(self, mask, calc_err=True, index=None):
#     def calc_lambdacerr(self, maskgals, mstar, lam, rlam, pmem, cval, gamma):
#     def calc_richness_fit(self, mask, col_index, centcolor_in=None, rcut=0.5, mingal=5, sigint=0.05, calc_err=False):
#     def redshift(self):
#     def redshift(self, value):
#     def mstar(self):
#     def _update_mstar(self):
#     def mpc_scale(self):
#     def _update_mpc_scale(self):
#     def _compute_neighbor_r(self):
#     def copy(self):
#     def __copy__(self):
#     def __init__(self, array, **kwargs):
#     def from_catfile(cls, filename, **kwargs):
#     def zeros(cls, size, **kwargs):
#     def __getitem__(self, key):
# 
# Path: redmapper/_version.py



# Path: redmapper/configuration.py
import yaml
import fitsio
import copy
import numpy as np
import re
import os
import logging
from esutil.cosmology import Cosmo
from .cluster import cluster_dtype_base, member_dtype_base
from ._version import __version__

                raise RuntimeError("You must set a config file area if no depthfile is present and you are running a sub-region")
        self._set_vars_from_dict(gal_stats, check_none=True)

        if self.limmag_catalog is None:
            self.limmag_catalog = self.limmag_ref

        # Get wcen numbers if available
        self.set_wcen_vals()

        # Set some defaults
        if self.specfile_train is None:
            self.specfile_train = self.specfile

        # Record the cluster dtype for convenience
        self.cluster_dtype = copy.copy(cluster_dtype_base)
        self.cluster_dtype.extend([('MAG', 'f4', self.nmag),
                                   ('MAG_ERR', 'f4', self.nmag),
                                   ('PZBINS', 'f4', self.npzbins),
                                   ('PZ', 'f4', self.npzbins),
                                   ('RA_CENT', 'f8', self.percolation_maxcen),
                                   ('DEC_CENT', 'f8', self.percolation_maxcen),
                                   ('ID_CENT', 'i8', self.percolation_maxcen),
                                   ('LAMBDA_CENT', 'f4', self.percolation_maxcen),
                                   ('ZLAMBDA_CENT', 'f4', self.percolation_maxcen),
                                   ('P_CEN', 'f4', self.percolation_maxcen),
                                   ('Q_CEN', 'f4', self.percolation_maxcen),
                                   ('P_FG', 'f4', self.percolation_maxcen),
                                   ('Q_MISS', 'f4'),
                                   ('P_SAT', 'f4', self.percolation_maxcen),
                                   ('P_C', 'f4', self.percolation_maxcen)])

        self.member_dtype = copy.copy(member_dtype_base)