mocks
Seeded synthetic catalogues with a known, non-null intrinsic alignment signal. They need no
simulation or survey data, which makes them the quickest way to try MeasureIA out, and they are
what the validation comparisons and the examples/ scripts run on.
from measureia import MeasureIABox
from measureia.mocks import radial_alignment_box_mock
mock = radial_alignment_box_mock(n_centrals=600, n_sat=8)
data = {k: mock[k] for k in ("Position", "Position_shape_sample", "Axis_Direction", "q", "LOS")}
ia = MeasureIABox(data, "./out.hdf5", boxsize=mock["boxsize"], separation_limits=[0.3, 8.0])
ia.measure_xi_w("mock", "both", num_jk=27, temp_file_path="./")
measureia.mocks
Synthetic mock catalogues with a known, non-null intrinsic alignment signal.
The radial-alignment mock places centrals uniformly in a periodic box and scatters satellites around them with a Gaussian profile. Satellite projected major axes point at their own central (plus Gaussian angle noise), giving a strong, deterministic w_g+ signal on scales up to a few times the satellite profile scale, and the central-satellite clumps give a non-null w_gg.
All randomness is controlled by a single seed so that every caller sees
byte-identical catalogues: the validation scripts, the test suite, the examples
under examples/, and anyone who wants a catalogue to try MeasureIA on
without having simulation or survey data to hand.
radial_alignment_box_mock(n_centrals=300, n_sat=8, boxsize=205.0, sigma_sat=2.0, alignment_scatter=0.2, q_range=(0.3, 0.9), seed=42, margin=0.0, density_shapes=False)
Generate a periodic-box mock with radially aligned satellites.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in src/measureia/mocks.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |
halotools_inputs(mock, ellipticity='distortion')
Convert a radial-alignment mock to halotools ia_correlations inputs.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in src/measureia/mocks.py
127 128 129 130 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 | |
responsivity(mock, ellipticity='distortion')
Responsivity R = 1 -
measureia divides S+D by 2R; halotools does not, so w_g+^measureia * 2R = w_g+^halotools.
Source code in src/measureia/mocks.py
161 162 163 164 165 166 167 168 169 170 171 172 | |
radial_alignment_lightcone_mock(n_centrals=400, n_sat=8, ra_range=(40.0, 50.0), dec_range=(-5.0, 5.0), r_range=(2450.0, 2650.0), sigma_sat=2.0, alignment_scatter=0.2, q_range=(0.3, 0.9), n_randoms_factor=5, seed=4242, density_shapes=False)
Generate a lightcone mock with radially aligned satellites.
Centrals are uniform in comoving volume inside a cone section (RA/DEC window x comoving-distance shell); satellites get Gaussian 3D comoving offsets around their central. Satellite ellipticities e1/e2 follow the standard survey shear-catalogue convention that measureia (and TreeCorr) expect, with the major axis pointing at the satellite's own central plus Gaussian angle noise — i.e. radial alignment, giving e+ > 0 and w_g+ > 0 in the IA sign convention.
The position (density) sample is the centrals; the shape sample is the satellites, so the two samples are disjoint (no self-pair corrections). Distances are comoving; the caller converts r <-> redshift with their cosmology (see r_com entries).
density_shapes : bool, optional
If True, also give the density sample (the centrals) its own shapes,
as "e1_density_sample"/"e2_density_sample", which is what a shape-shape
('++') correlation between two different catalogues needs. Each central
is oriented radially about the cone axis, with the same
alignment_scatter, so the centrals carry a coherent large-scale
alignment that correlates with the satellites' radial one and gives the
cross correlation a real, non-degenerate II signal. Default False, which
leaves the catalogue byte-for-byte as before -- the extra random draws
happen after every existing one.
| Returns: |
|
|---|
Source code in src/measureia/mocks.py
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 | |
embed_box_mock_on_lightcone(mock, distance=3000.0, alpha0=45.0, delta0=0.0, n_randoms_factor=10, seed=777)
Embed a box mock at a large comoving distance on a lightcone.
The box is placed with its centre at comoving distance distance in the
direction (alpha0, delta0), with the box axes mapped as
x -> east, y -> north, z -> line of sight (matching the box LOS = 2
convention). Projected axis directions are converted to survey-convention
e1/e2 exactly, using each galaxy's own local (east, north) tangent frame,
so the only differences between MeasureIABox on mock and
MeasureIALightcone on the embedding are the plane-parallel approximation
itself and the randoms-based (rather than analytic) estimator.
Randoms are drawn uniformly in the FULL box cube and embedded the same way, mirroring the analytic-RR assumption of the box estimator. Use a mock generated with a margin >= the maximum measured separation so that no periodically wrapped pair contributes to the box measurement.
| Returns: |
|
|---|
Source code in src/measureia/mocks.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 | |
subbox_labels(positions, boxsize, L)
Subbox index (0..L^3-1) per position — the same partition the box jackknife uses, for supplying identical patches to the lightcone.
Source code in src/measureia/mocks.py
412 413 414 415 416 417 | |