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)
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 | |
halotools_inputs(mock, ellipticity='distortion')
Convert a radial-alignment mock to halotools ia_correlations inputs.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in src/measureia/mocks.py
101 102 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 130 131 132 | |
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
135 136 137 138 139 140 141 142 143 144 145 146 | |
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)
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).
| Returns: |
|
|---|
Source code in src/measureia/mocks.py
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 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 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 | |
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
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 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | |
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
350 351 352 353 354 355 | |