예제 #1
0
파일: rachel.py 프로젝트: esheldon/espy
    def __init__(self, pzrun, nchunk=50):
        """
        Take objects from the given pzrun and select:
            1) ones that are "recoverable"
            2) lie within the bounds of one of our test
            regions; these overlap spectroscopic regions.
        """

        self.pzrun=pzrun
        self.nchunk=nchunk
        self.conf = zphot.cascade_config(pzrun)
        self.wo = zphot.weighting.WeightedOutputs()

        # load columns
        self.procrun = self.conf['photo']['procrun']
        self.cols = sdssgal.open_columns(self.procrun)
예제 #2
0
def plot_lens_s2n_bysample(lens_sample, pzrun, cumulative=True):
    import zphot
    conf=lensing.files.read_config('lcat', lens_sample)
    zconf=zphot.cascade_config(pzrun)

    #
    # generate the expected n(z)
    #

    # read the weights and create weighted histogram
    wstruct = zphot.weighting.read_weights(zconf['pofz']['wrun'], 2)

    binsize=0.0314
    zmax=1.1
    hdict = eu.stat.histogram(wstruct['z'], binsize=binsize, weights=wstruct['weight'],max=zmax)

    zs = hdict['center']
    pzs = hdict['whist']

    # now read the zl
    data = lensing.files.read_original_catalog(type='lens',sample=lens_sample)

    return plot_lens_s2n(data['z'], hdict['low'], hdict['high'], pzs)