redshift boundary tolerance is now user-selectable

This commit is contained in:
Paul M. Sutter 2024-06-07 11:58:36 +02:00
parent c0a69c4536
commit 7e5a51d931
8 changed files with 26 additions and 20 deletions

View file

@ -25,6 +25,7 @@ import numpy as np
import os
import pylab as plt
import backend.cosmologyTools as vp
import backend.surveyTools as sp
from voidUtil import getArray, shiftPart, getVoidPart
def fill_between(x, y1, y2=0, ax=None, **kwargs):
@ -77,17 +78,18 @@ def plotNumberFunction(catalogList,
if sample.dataType == "observation":
maskFile = sample.maskFile
boxVol = vp.getSurveyProps(maskFile,
boxVol = sp.getSurveyProps(maskFile,
sample.zBoundary[0], sample.zBoundary[1],
sample.zRange[0], sample.zRange[1], "all",
selectionFuncFile=sample.selFunFile)[0]
selectionFuncFile=sample.selFunFile,
omegaM=sample.omegaM)[0]
else:
boxVol = sample.boxLen*sample.boxLen*(sample.zBoundaryMpc[1] -
sample.zBoundaryMpc[0])
boxVol *= 1.e-9 # Mpc->Gpc
bins = 100./binWidth
bins = int(100./binWidth)
hist, binEdges = np.histogram(data, bins=bins, range=(0., 100.))
binCenters = 0.5*(binEdges[1:] + binEdges[:-1])