Description Usage Arguments Value Author(s) See Also Examples
This function produces a mock survey with observed log-masses x.obs
with Gaussian uncertainties and distances r
, using a custom mass function (MF) and selection function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
n |
Number of objects (galaxies) to be generated. If |
seed |
An interger number used as seed for the random number generator. If you wish to generate different realizations, with the same survey specifications, it suffices to vary this number. |
veff |
is the effective volume function |
f |
is the selection function |
dVdr |
is the function |
gdf |
is the 'generative distribution function', i.e. the underlying mass function, from which the galaxies are drawn. This function is a function of log-mass |
g |
function of distance |
sigma |
Gaussian observing errors in log-mass |
rmin, rmax |
Minimum and maximum distance of the survey. Outside these limits the function |
xmin, xmax |
Minimum and maximum log-mass in the survey. For optimal performance, specify these boubdaries in such a way that they certainly contain all sources generated by the survey, but don't span a much larger range. |
shot.noise |
Logical flag. If set to |
verbose |
Logical flag. If set to |
dfmockdata
returns a list of arrays and scalars:
x |
Array of observed log-mass. |
x.err |
Gaussian uncertainties on x. |
x.true |
Array of true log-masses, i.e. the values of |
r |
Array of comoving distances, only available if a function |
f |
Selection function provided as input argument. |
g |
Cosmic LSS function provided as input argument. |
dVdr |
Derivative of survey volume provided as input argument, but rescaled to the requested number of galaxies |
veff |
Function returning the effective volume as a function of log-mass |
veff.values |
Array of effective volumes for each galaxy. |
scd |
Function returning the expected source count density as a function of log-mass |
rmin,rmax |
Range of comoving distances |
xmin,xmax |
Range of log-masses |
rescaling.factor |
Value of rescaling factor applied to the cosmic volume to match the requested number of galaxies |
Danail Obreschkow
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | # draw 1000 galaxies with mass errors of 0.3 dex from a Schechter function
# with parameters (-2,11,-1.3) and a preset selection function
mock = dfmockdata(sigma = 0.3)
# plot the distance-log(mass) relation of observed data, true data, and approximate survey limit
plot(mock$r,mock$x,col='blue')
points(mock$r,mock$x.true,pch=20)
x = seq(5,11,0.01)
lines(1e-2*sqrt(10^x),x,col='red')
# These data can then be used to fit a MF in several ways. For instance,
# assuming that the effective volume function Veff(x) is known:
selection = mock$veff
survey = dffit(mock$x, selection, mock$x.err)
# or assuming that Veff is known only on a galaxy-by-galaxy basis
selection = mock$veff.values
dffit(mock$x, selection, mock$x.err)
# or assuming that Veff is known on a galaxy-by-balaxy basis, but approximate analytically
# outside the range of observed galaxy masses
selection = list(mock$veff.values, mock$veff)
dffit(mock$x, selection, mock$x.err)
# or assuming that the full selection function f(x,r) and the observing volume
# derivative dVdr(r) are known
selection = list(mock$f, mock$dVdr, mock$rmin,mock$rmax)
dffit(mock$x, selection, mock$x.err)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.