SurrogateFactory¶
- class kszx.SurrogateFactory(box, cosmo, randcat, ngal_mean, ngal_rms, ztrue_col='z', kernel='cubic')¶
Helper class for simulating surrogate fields defined on a random catalog.
Constructor arguments:
box(Box): defines pixel size, bounding box size, and location of observer.cosmo(Cosmology). Used to simulate linear densities/velocities.randcat(Catalog): random catalog, defines survey footprint and redshift distribution. The randcat must contain columnsra_deganddec_deg.surr_ngal_meanandsurr_ngal_rms(float): In the surrogate sims, I decided to allow \(N_{\rm gal}\) to vary from one surrogate sim to the next. (The idea is to make the surrogate sims more similar to mocks, where \(N_{\rm gal}\) varies between mocks. Indeed, I find that allowing \(N_{\rm gal}\) to vary in the surrogate sims does improve overall agreement with mocks.)In each surrogate sim, \(N_{\rm gal}\) is a Gaussian random variable with mean/rms given by the
surr_ngal_meanandsurr_ngal_rmsconstructor args. If mocks are available, then one way to get sensible values for these arguments is to use the mean/variance in the mocks. As a simple placeholder, you could also takesurr_ngal_rms=0(to disable varying \(N_{\rm gal}\) entirely) orsurr_ngal_rms = sqrt(surr_ngal_mean)(Poisson statistics).ztrue_col(string): name of the randcat column containing redshifts. (If the randcat is photometric, then these should be true redshifts, not observed redshifts.)kernel(string): either'cic'or'cubic'(more options will be defined later).
Most of the interesting members are computed in
simulate_surrogate(), but the constructor does computes a few useful members:self.D(1-d array of length nrand): growth function \(D(z)\) evaluated on random catalog, normalized to \(D=1\) at \(z=0\).self.faH(1-d array of length nrand): parameter combination \(f_{rsd}(z) H(z) / (1+z)\), evaluated on random catalog.self.sigma2(scalar): variance of linear density field at \(z=0\).
- simulate_surrogate()¶
Simulates linear density/velocity fields on the random catalog.
Initializes the following members:
self.ngal(integer): includes random scatter, see class docstring.self.delta(1-d array of length nrand): linear density field \(\delta(x)\) evaluated on random catalog.self.phi(1-d array of length nrand): field \(\phi(x) = \delta(x) / \alpha(x)\) evaluated on random catalog.self.vr(1-d array of length nrand): radial velocity field \(v_r(x)\) evaluated on random catalog.self.M(1-d array of length nrand): random array with \((N_{rand} - N_{gal})\) zeroes and \(N_{gal}\) ones.
Reminder: non-Gaussian galaxy bias takes the form \(\delta_g(x) = b_g \delta(x) + 2 f_{NL} \delta_c (b_g-1) \phi(x)\).