# 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__

class DuplicatableConfig(object):
    """
    Class to hold instances of variables that need to be duplicated for parallelism.
    """

    def __init__(self, config):
        """
        Instantiate a DuplicatableConfig.

        Parameters
        ----------
        config: `redmapper.Configuration`
           Configuration struct to copy values from

        """
        self.outbase = config.outbase
        self.hpix = config.hpix
        self.nside = config.nside


class Configuration(object):
    """
    Configuration class for redmapper.

    This class holds all the relevant configuration information, and had
    convenient methods for validating parameters as well as generating
    filenames, etc.

    """

# 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__


class DuplicatableConfig(object):
    """
    Class to hold instances of variables that need to be duplicated for parallelism.
    """

    def __init__(self, config):
        """
        Instantiate a DuplicatableConfig.

        Parameters
        ----------
        config: `redmapper.Configuration`
           Configuration struct to copy values from

        """
        self.outbase = config.outbase
        self.hpix = config.hpix
        self.nside = config.nside


class Configuration(object):
    """
    Configuration class for redmapper.

    This class holds all the relevant configuration information, and had
    convenient methods for validating parameters as well as generating
    filenames, etc.

    """

    version = ConfigField(default=__version__, required=True)