Skip to content

model

photXclus.model

NFW_r(r, rx, integr_c)

Evaluate the Navarro-Frank-White (NFW) model at given physical radii

Parameters:

Name Type Description Default
r array_like

Array of physical radii

required
rx float

Scale radius of the model

required
integr_c float

Integral of the model

required

Returns:

Name Type Description
NFW_model array_like

Array of the Navarro-Frank-White model evaluated at the input physical radii

Source code in photXclus/model.py
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
@nb.njit()
def NFW_r(r, rx, integr_c):
    """
    Evaluate the Navarro-Frank-White (NFW) model at given physical radii

    Parameters
    ----------
    r : array_like
        Array of physical radii
    rx : float
        Scale radius of the model
    integr_c : float
        Integral of the model

    Returns
    -------
    NFW_model : array_like
        Array of the Navarro-Frank-White model evaluated at the input physical radii
    """
    rs = rx/3.
    return integr_c * psi_r_cut(r, rs)

clus_field_zr(z, r, ngal_c, muz_c, bin_zc, sigz_z, ngal_f, binz_ampl_f, bin_z, C_Omega, rx, deltac)

Evaluate the total model at given redshifts and physical radii

Parameters:

Name Type Description Default
z array_like

Array of redshifts

required
r array_like

Array of physical radii

required
ngal_c float

Number of galaxies in the cluster

required
muz_c float

Mean of the cluster redshift distribution

required
bin_zc array_like

Array of redshift bins

required
sigz_z array_like

Array of standard deviation of the galaxy photometric redshift (sigma_zphot(z))

required
ngal_f float

Number density of galaxies in the field in degrees^-2

required
binz_ampl_f array_like

Amplitude of the field model at each redshift bin

required
bin_z array_like

Array of redshift bins

required
C_Omega float

Area of the field of view in degrees^-2

required
rx float

Scale radius of the cluster model

required
deltac float

Delta parameter for the field model

required

Returns:

Name Type Description
total_model array_like

Array of the total model evaluated at the input redshifts and physical radii

Source code in photXclus/model.py
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
@nb.njit()
def clus_field_zr(z, r, ngal_c, 
                  muz_c, bin_zc, sigz_z, 
                  ngal_f, 
                  binz_ampl_f, bin_z, C_Omega, rx, deltac):
    """
    Evaluate the total model at given redshifts and physical radii

    Parameters
    ----------
    z : array_like
        Array of redshifts
    r : array_like
        Array of physical radii
    ngal_c : float
        Number of galaxies in the cluster
    muz_c : float
        Mean of the cluster redshift distribution
    bin_zc : array_like
        Array of redshift bins
    sigz_z : array_like
        Array of standard deviation of the galaxy photometric redshift (sigma_zphot(z))
    ngal_f : float
        Number density of galaxies in the field in degrees^-2
    binz_ampl_f : array_like
        Amplitude of the field model at each redshift bin
    bin_z : array_like
        Array of redshift bins
    C_Omega : float
        Area of the field of view in degrees^-2
    rx : float
        Scale radius of the cluster model
    deltac : float
        Delta parameter for the field model

    Returns
    -------
    total_model : array_like
        Array of the total model evaluated at the input redshifts and physical radii
    """
    if deltac == 1:
        pclus = clus_z(z, muz_c, bin_zc, sigz_z) * clus_r(r, rx)
        pfield = field_z(z, binz_ampl_f, bin_z, sigz_z) * field_r(r, C_Omega)
        ptot = ngal_c * pclus + C_Omega * ngal_f * pfield
    else:
        pfield = field_z(z, binz_ampl_f, bin_z, sigz_z)
        ptot = C_Omega * ngal_f * pfield
    return ptot

clus_r(r, rx, integr_c=1.0, model='Plummer')

Evaluate the cluster radial model at given physical radii

Parameters:

Name Type Description Default
r array_like

Array of physical radii

required
rx float

Scale radius of the cluster model

required
integr_c float

Integral of the cluster model, used for the NFW model

1.0
model str

Model to be used, either 'Plum' or 'NFW'

'Plummer'

Returns:

Name Type Description
clus_model array_like

Array of the cluster model evaluated at the input physical radii

Source code in photXclus/model.py
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
@nb.njit()
def clus_r(r, rx, integr_c = 1., model='Plummer'):
    """
    Evaluate the cluster radial model at given physical radii

    Parameters
    ----------
    r : array_like
        Array of physical radii
    rx : float
        Scale radius of the cluster model
    integr_c : float, optional
        Integral of the cluster model, used for the NFW model
    model : str, optional
        Model to be used, either 'Plum' or 'NFW'

    Returns
    -------
    clus_model : array_like
        Array of the cluster model evaluated at the input physical radii
    """
    if model == 'Plummer':
        return plum_r(r, rx)
    elif model == 'NFW':
        return NFW_r(r, rx, integr_c)
    else:
        raise NotImplementedError(f"{model} radial model not implemented")

clus_z(z, muz_c, z_binc, sigz_z)

Evaluate the cluster redshift model at given redshifts

Parameters:

Name Type Description Default
z array_like

Array of redshifts

required
muz_c float

Mean of the cluster redshift distribution

required
z_binc array_like

Array of redshift bins

required
sigz_z array_like

Array of standard deviation of the galaxy photometric redshift (sigma_zphot(z))

required

Returns:

Name Type Description
clus_model array_like

Array of the cluster model evaluated at the input redshifts

Source code in photXclus/model.py
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
@nb.njit()
def clus_z(z, muz_c, z_binc, sigz_z ):
    """
    Evaluate the cluster redshift model at given redshifts

    Parameters
    ----------
    z : array_like
        Array of redshifts
    muz_c : float
        Mean of the cluster redshift distribution
    z_binc : array_like
        Array of redshift bins
    sigz_z : array_like
        Array of standard deviation of the galaxy photometric redshift (sigma_zphot(z))

    Returns
    -------
    clus_model : array_like
        Array of the cluster model evaluated at the input redshifts
    """
    sigz_c = np.interp(muz_c, z_binc, sigz_z)
    res =  (1./(sigz_c * np.sqrt(2 * np.pi))) * np.exp(-0.5*((z-muz_c)/sigz_c)**2)
    return res

clus_zr(z, r, muz_c, bin_zc, sigz_z, rx)

Evaluate the cluster model at given redshifts and physical radii

Parameters:

Name Type Description Default
z array_like

Array of redshifts

required
r array_like

Array of physical radii

required
muz_c float

Mean of the cluster redshift distribution

required
bin_zc array_like

Array of redshift bins

required
sigz_z array_like

Array of standard deviation of the galaxy photometric redshift (sigma_zphot(z))

required
rx float

Scale radius of the cluster model

required

Returns:

Name Type Description
clus_model array_like

Array of the cluster model evaluated at the input redshifts and physical radii

Source code in photXclus/model.py
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
@nb.njit()
def clus_zr(z, r, muz_c, bin_zc, sigz_z, rx):
    """
    Evaluate the cluster model at given redshifts and physical radii

    Parameters
    ----------
    z : array_like
        Array of redshifts
    r : array_like
        Array of physical radii
    muz_c : float
        Mean of the cluster redshift distribution
    bin_zc : array_like
        Array of redshift bins
    sigz_z : array_like
        Array of standard deviation of the galaxy photometric redshift (sigma_zphot(z))
    rx : float
        Scale radius of the cluster model

    Returns
    -------
    clus_model : array_like
        Array of the cluster model evaluated at the input redshifts and physical radii
    """
    res = clus_z(z, muz_c, bin_zc, sigz_z) * clus_r(r, rx)
    return res

field_r(r, C_Omega)

Evaluate the field radial model at given physical radii

Parameters:

Name Type Description Default
r array_like

Array of physical radii

required
C_Omega float

Area of the field of view in degrees^-2

required

Returns:

Name Type Description
field_model array_like

Array of the field model evaluated at the input physical radii

Source code in photXclus/model.py
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
@nb.njit()
def field_r(r, C_Omega):
    """
    Evaluate the field radial model at given physical radii

    Parameters
    ----------
    r : array_like
        Array of physical radii
    C_Omega : float
        Area of the field of view in degrees^-2

    Returns
    -------
    field_model : array_like
        Array of the field model evaluated at the input physical radii
    """
    return 2*np.pi*r / C_Omega 

field_z(z, binz_ampl_f, bin_z, sigz_z)

Evaluate the field redshift model at given redshifts

Parameters:

Name Type Description Default
z array_like

Array of redshifts

required
binz_ampl_f array_like

Amplitude of the field model at each redshift bin

required
bin_z array_like

Array of redshift bins

required
sigz_z array_like

Array of standard deviation of the galaxy photometric redshift (sigma_zphot(z))

required

Returns:

Name Type Description
field_model array_like

Array of the field model evaluated at the input redshifts

Source code in photXclus/model.py
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
@nb.njit()
def field_z(z, binz_ampl_f, bin_z, sigz_z):
    """
    Evaluate the field redshift model at given redshifts

    Parameters
    ----------
    z : array_like
        Array of redshifts
    binz_ampl_f : array_like
        Amplitude of the field model at each redshift bin
    bin_z : array_like
        Array of redshift bins
    sigz_z : array_like
        Array of standard deviation of the galaxy photometric redshift (sigma_zphot(z))

    Returns
    -------
    field_model : array_like
        Array of the field model evaluated at the input redshifts
    """
    iz = np.digitize(z,bin_z)-1
    return binz_ampl_f[iz]

plum_r(r, rx)

Evaluate the Plum model at given physical radii

Parameters:

Name Type Description Default
r array_like

Array of physical radii

required
rx float

Scale radius of the model

required

Returns:

Name Type Description
plum_model array_like

Array of the Plum model evaluated at the input physical radii

Source code in photXclus/model.py
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
@nb.njit()
def plum_r(r, rx):
    """
    Evaluate the Plum model at given physical radii

    Parameters
    ----------
    r : array_like
        Array of physical radii
    rx : float
        Scale radius of the model

    Returns
    -------
    plum_model : array_like
        Array of the Plum model evaluated at the input physical radii
    """
    rs = rx/10.
    res =  ( 1 / np.sqrt(1 + (r/rs)**2) ) - (1 / np.sqrt(1 + (10)**2))
    return res

psi_r(r, rs)

Evaluate the dimensionless potential at given physical radii

Parameters:

Name Type Description Default
r array_like

Array of physical radii

required
rs float

Scale radius of the potential

required

Returns:

Name Type Description
psi array_like

Array of the dimensionless potential evaluated at the input physical radii

Source code in photXclus/model.py
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
@nb.njit()
def psi_r(r, rs):    
    """
    Evaluate the dimensionless potential at given physical radii

    Parameters
    ----------
    r : array_like
        Array of physical radii
    rs : float
        Scale radius of the potential

    Returns
    -------
    psi : array_like
        Array of the dimensionless potential evaluated at the input physical radii
    """
    denom = r/rs * (1 + r/rs)**2
    return 1. / denom

psi_r_cut(r, rs)

Evaluate the dimensionless potential at given physical radii, cut off at a certain radius

Parameters:

Name Type Description Default
r array_like

Array of physical radii

required
rs float

Scale radius of the potential

required

Returns:

Name Type Description
psi array_like

Array of the dimensionless potential evaluated at the input physical radii, cut off at a certain radius

Source code in photXclus/model.py
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
@nb.njit()
def psi_r_cut(r, rs):    
    """
    Evaluate the dimensionless potential at given physical radii, cut off at a certain radius

    Parameters
    ----------
    r : array_like
        Array of physical radii
    rs : float
        Scale radius of the potential

    Returns
    -------
    psi : array_like
        Array of the dimensionless potential evaluated at the input physical radii, cut off at a certain radius
    """
    rcut = 0.01*3*rs
    sigma0 = psi_r(rcut, rs) / (2*np.pi*rcut)
    res = psi_r(r, rs)
    i = 0
    while r[i] < rcut:
        res[i] = 2*np.pi*r[i]*sigma0
        i += 1
    return res