halocat.xi_hh_rebin¶
xi_hh_rebin
¶
Threshold→bin rebinning of the halo–halo 2PCF.
Convert ξ_hh measured from cumulative mass-threshold samples,
ξ_AB(r; x, y) := ξ_hh(r | n_h(>=x), n_h(>=y)), x = log10 M
into the bin-averaged differential
ξ_hh^bin(r; x_c, y_c)
:= ξ_hh(r | x_c ± dlogM/2, y_c ± dlogM/2)
via the exact closed-form mixed-difference identity
Dn(x_c) Dn(y_c) [1 + ξ_hh^bin(r; x_c, y_c)]
= F(x-, y-) - F(x-, y+) - F(x+, y-) + F(x+, y+),
with F(x, y; r) := n_h(>=x) n_h(>=y) [1 + ξ_AB(r; x, y)] and
Dn(x_c) := n_h(>=x-) - n_h(>=x+). The identity is exact given F;
numerical error enters only through interpolation of F to the four bin
edges. There is no derivative approximation.
The submodule is split into three layers:
- physics — :func:
_mixed_difference, the closed-form algebra on already-evaluated F arrays. - numerics — :func:
_interp_nh_cum, :func:_interp_xi_AB_at_edges, the interpolation of n_h(>=) and ξ_AB onto bin edges. - driver — :func:
cumulative_to_binned_xi_hh(raw arrays) and :func:rebin_xi_hh_record(halocat-nativeXiHHRecordwrapper).
cumulative_to_binned_xi_hh
¶
cumulative_to_binned_xi_hh(logM_in, nh_cum, xi_AB, logM_out, dlogM, *, interp_method: Literal['linear', 'cubic'] = 'linear', symmetrize_input: bool = True, symmetrize_output: bool = True, asymmetry_atol: float = 0.001, asymmetry_policy: _AsymmetryPolicy = 'warn') -> tuple[np.ndarray, np.ndarray]
Rebin ξ_hh from cumulative threshold samples to differential bins.
Implements the closed-form mixed-difference identity
.. math::
\Delta n(x_c) \Delta n(y_c) [1 + \xi^{bin}{hh}(r; x_c, y_c)] = F(x-, y_-) - F(x_-, y_+) - F(x_+, y_-) + F(x_+, y_+),
with F(x, y; r) = n_h(>=x) n_h(>=y) [1 + \xi_{AB}(r; x, y)].
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
logM_in
|
array_like
|
Shape |
required |
nh_cum
|
array_like
|
Shape |
required |
xi_AB
|
array_like
|
Shape |
required |
logM_out
|
array_like
|
Shape |
required |
dlogM
|
float
|
Output bin full width (dex). The bin around |
required |
interp_method
|
('linear', 'cubic')
|
Method used to interpolate ξ_AB onto the bin edges via
:class: |
'linear'
|
symmetrize_input
|
bool
|
If True, replace |
True
|
symmetrize_output
|
bool
|
Apply the same symmetrisation to the returned |
True
|
asymmetry_atol
|
float
|
Absolute tolerance on |
0.001
|
asymmetry_policy
|
('warn', 'error', 'ignore')
|
Action when |
'warn'
|
Returns:
| Name | Type | Description |
|---|---|---|
logM_out |
ndarray
|
Shape |
xi_bin |
ndarray
|
Shape |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Notes
The r-axis is never interpolated by this function. Only the two mass axes are rebinned.
The implementation is exact in the closed form: the only numerical approximation is the interpolation of F to the four bin edges.
See Also
rebin_xi_hh_record :
halocat-native wrapper that takes an XiHHRecord and returns
another XiHHRecord.
Source code in halocat/xi_hh_rebin.py
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 326 327 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 | |
rebin_xi_hh_record
¶
rebin_xi_hh_record(xi_threshold_rec: XiHHRecord, logM_out, dlogM, *, interp_method: Literal['linear', 'cubic'] = 'linear', symmetrize_input: bool = True, symmetrize_output: bool = True, asymmetry_atol: float = 0.001, asymmetry_policy: _AsymmetryPolicy = 'warn') -> XiHHRecord
Rebin a threshold-style XiHHRecord into a differential one.
halocat-native wrapper around :func:cumulative_to_binned_xi_hh.
Densifies the input record's pair-sparse storage into a ξ_AB
cube, recovers n_h(>=) from the auto-pair halo counts n1,
runs the closed-form rebin, then repackages the result into a new
XiHHRecord with the standard pair-sparse layout. Never writes
to disk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xi_threshold_rec
|
XiHHRecord
|
Record measured with threshold-style mass bins. Each row of
|
required |
logM_out
|
array_like
|
Shape |
required |
dlogM
|
float
|
Output bin full width (dex). |
required |
interp_method
|
('linear', 'cubic')
|
Forwarded to :func: |
'linear'
|
symmetrize_input
|
bool
|
Forwarded. Default True for both. |
True
|
symmetrize_output
|
bool
|
Forwarded. Default True for both. |
True
|
asymmetry_atol
|
float
|
Forwarded. Default |
0.001
|
asymmetry_policy
|
('warn', 'error', 'ignore')
|
Forwarded. Default |
'warn'
|
Returns:
| Name | Type | Description |
|---|---|---|
rebinned |
XiHHRecord
|
New record with:
|
Raises:
| Type | Description |
|---|---|
ValueError
|
Same conditions as :func: |
See Also
cumulative_to_binned_xi_hh : underlying raw-array driver.
Source code in halocat/xi_hh_rebin.py
417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 | |