interface¶
interface
¶
Author: Corentin Ravoux
Description : Classes to return a Dachshund input based on data that can be treated via picca software.
parse_int_tuple
¶
parse_int_tuple(input)
Parse a config string into a tuple of ints.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
str
|
Comma-separated integers (e.g. |
required |
Returns:
| Type | Description |
|---|---|
|
tuple[int] | None: Tuple of ints, or |
Source code in lelantos/interface.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |
parse_float_tuple
¶
parse_float_tuple(input)
Parse a config string into a tuple of floats.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
str
|
Comma-separated floats (e.g. |
required |
Returns:
| Type | Description |
|---|---|
|
tuple[float] | None: Tuple of floats, or |
Source code in lelantos/interface.py
46 47 48 49 50 51 52 53 54 55 56 57 58 | |
parse_str_tuple
¶
parse_str_tuple(input)
Parse a config string into a tuple of stripped strings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
str
|
Comma-separated tokens (e.g. |
required |
Returns:
| Type | Description |
|---|---|
|
tuple[str] | None: Tuple of strings, or |
Source code in lelantos/interface.py
61 62 63 64 65 66 67 68 69 70 71 72 73 | |
parse_dict
¶
parse_dict(input)
Parse a config string into a Python dict.
Single quotes are normalised to double quotes and the value is evaluated
with :func:ast.literal_eval.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
str
|
Python-literal dict (e.g. |
required |
Returns:
| Type | Description |
|---|---|
|
dict | None: Parsed dict, or |
Source code in lelantos/interface.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
parse_float
¶
parse_float(input)
Parse a config string into a float.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
str
|
A float literal or |
required |
Returns:
| Type | Description |
|---|---|
|
float | None: The float, or |
Source code in lelantos/interface.py
95 96 97 98 99 100 101 102 103 104 105 106 107 | |
parse_int
¶
parse_int(input)
Parse a config string into an int.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
str
|
An integer literal or |
required |
Returns:
| Type | Description |
|---|---|
|
int | None: The int, or |
Source code in lelantos/interface.py
110 111 112 113 114 115 116 117 118 119 120 121 122 | |
parse_string
¶
parse_string(input)
Parse a config string, mapping the literal "None" to None.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
str
|
Any string, or |
required |
Returns:
| Type | Description |
|---|---|
|
str | None: The string, or |
Source code in lelantos/interface.py
125 126 127 128 129 130 131 132 133 134 135 136 137 | |
main
¶
main(input_file)
Run the full lelantos tomography pipeline from a config file.
Reads the .ini file, then executes each enabled stage in order:
delta transform, delta plot, delta convert, tomography launch, tomography
process, void find, void process, void stack, and the void/tomography/stack
plots. The set of stages is controlled by the boolean gates in the
[main] section. See scripts/interface_explanatory.ini for a full
description of every option.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_file
|
str
|
Path to the interface |
required |
Source code in lelantos/interface.py
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 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 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 | |
transform_delta
¶
transform_delta(delta_path, delta_transform_path, delta_transform_config, delta_config, main_config)
Shuffle and redshift-cut the delta files ([delta transform] stage).
Wraps :class:lelantos.cosmology.DeltaModifier to shuffle the deltas within
n_cut redshift chunks, optionally in lock-step with a second
(cross-correlation) delta set.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
delta_path
|
str
|
Input delta directory. |
required |
delta_transform_path
|
str
|
Output directory for the shuffled deltas. |
required |
delta_transform_config
|
|
required | |
delta_config
|
|
required | |
main_config
|
|
required |
Source code in lelantos/interface.py
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 | |
convert_delta
¶
convert_delta(pixel_path, delta_path, software_config, delta_config, main_config)
Convert delta files to solver pixel input ([delta convert] stage).
Wraps :class:lelantos.cosmology.DeltaConverter to apply the footprint /
redshift / sigma cuts, perform the sky->cartesian transform and write the
binary pixel file(s) and property file consumed by the tomographic solver.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pixel_path
|
str
|
Output directory for pixel/binary products. |
required |
delta_path
|
str
|
Input delta directory. |
required |
software_config
|
|
required | |
delta_config
|
|
required | |
main_config
|
|
required |
Source code in lelantos/interface.py
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 | |
plot_delta
¶
plot_delta(plot_delta_path, delta_path, delta_plot_config, delta_config, main_config)
Produce delta diagnostic plots ([delta plot] stage).
Wraps :class:lelantos.cosmology.DeltaAnalyzer to plot histograms, sky
scatter and redshift-dependence of the requested delta quantities, with an
optional comparison against a second delta set.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plot_delta_path
|
str
|
Output directory for the figures. |
required |
delta_path
|
str
|
Input delta directory. |
required |
delta_plot_config
|
|
required | |
delta_config
|
|
required | |
main_config
|
|
required |
Source code in lelantos/interface.py
405 406 407 408 409 410 411 412 413 414 415 416 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 | |
launch_tomography
¶
launch_tomography(tomo_path, pixel_path, software_config, tomography_config, main_config)
Run the tomographic solver ([tomography launching] stage).
Wraps :class:lelantos.task_manager.TomographyManager to launch the solver
(e.g. Dachshund) on the pixel file, wait for completion, copy the outputs
back and clean the temporary run directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tomo_path
|
str
|
Run/output directory for the solver. |
required |
pixel_path
|
str
|
Directory holding the pixel input and launch pickle. |
required |
software_config
|
|
required | |
tomography_config
|
|
required | |
main_config
|
|
required |
Source code in lelantos/interface.py
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 | |
process_tomography
¶
process_tomography(tomo_abs_path, pixel_path, tomography_process_config, delta_config, software_config, main_config)
Post-process solver output ([tomography process] stage).
Optionally merges the per-chunk solver outputs into a single reconstructed map and/or builds the voxel-to-nearest-line-of-sight distance map used for void cuts and plot masking.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tomo_abs_path
|
str
|
Absolute path to the tomography run directory. |
required |
pixel_path
|
str
|
Directory holding the pixel input and property file. |
required |
tomography_process_config
|
|
required | |
delta_config
|
|
required | |
software_config
|
|
required | |
main_config
|
|
required |
Source code in lelantos/interface.py
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 | |
find_void
¶
find_void(void_path, tomo_abs_path, pixel_path, void_finder_config, tomography_process_config, delta_config)
Run the void finder on the map ([void finder] stage).
Wraps :class:lelantos.voidfinder.VoidFinder to detect voids
(SPHERICAL or WATERSHED) on the reconstructed map and write a void catalog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
void_path
|
str
|
Output directory for the void catalog. |
required |
tomo_abs_path
|
str
|
Absolute path to the tomography directory (map). |
required |
pixel_path
|
str
|
Directory holding the pixel input and property file. |
required |
void_finder_config
|
|
required | |
tomography_process_config
|
|
required | |
delta_config
|
|
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
Path of the void catalog produced by the finder. |
Source code in lelantos/interface.py
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 | |
process_void
¶
process_void(void_path, tomo_abs_path, pixel_path, void_process_config, delta_config, tomography_process_config, software_config, void_catalog_name_default)
Post-process the void catalog ([void process] stage).
Optionally computes additional per-void statistics, applies the configured cuts (CROSSING / RADIUS / BORDER / DIST) writing a cut catalog, and emits a QSO-like catalog for cross-correlation tools.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
void_path
|
str
|
Void catalog directory. |
required |
tomo_abs_path
|
str
|
Absolute path to the tomography directory. |
required |
pixel_path
|
str
|
Directory holding the pixel input and property file. |
required |
void_process_config
|
|
required | |
delta_config
|
|
required | |
tomography_process_config
|
|
required | |
software_config
|
|
required | |
void_catalog_name_default
|
str | None
|
Catalog produced by |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
Path of the (possibly cut) void catalog to use downstream. |
Source code in lelantos/interface.py
587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 | |
stack_void
¶
stack_void(stack_void_path, tomo_abs_path, void_path, pixel_path, stack_void_config, tomography_process_config, delta_config, void_catalog_name_default)
Stack the map at catalog positions ([void stack] stage).
Wraps :class:lelantos.tomography.TomographyStack to stack map cut-outs at
each void/QSO/galaxy position and write the stack binary and its property
file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stack_void_path
|
str
|
Output directory for the stack products. |
required |
tomo_abs_path
|
str
|
Absolute path to the tomography directory (map). |
required |
void_path
|
str
|
Void catalog directory. |
required |
pixel_path
|
str
|
Directory holding the property file. |
required |
stack_void_config
|
|
required | |
tomography_process_config
|
|
required | |
delta_config
|
|
required | |
void_catalog_name_default
|
str | None
|
Catalog produced earlier. |
required |
Returns:
| Type | Description |
|---|---|
|
tuple[str, str]: |
Source code in lelantos/interface.py
650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 | |
plot_void
¶
plot_void(plot_void_path, void_path, void_plot_config, main_config, void_catalog_name_default)
Produce void-catalog diagnostic plots ([void plot] stage).
Wraps :class:lelantos.voidfinder.PlotVoid to plot histograms and
redshift-dependence of void quantities (radius, redshift, central value,
LOS distance), with an optional comparison catalog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plot_void_path
|
str
|
Output directory for the figures. |
required |
void_path
|
str
|
Void catalog directory. |
required |
void_plot_config
|
|
required | |
main_config
|
|
required | |
void_catalog_name_default
|
str | None
|
Catalog produced earlier. |
required |
Source code in lelantos/interface.py
709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 | |
plot_tomography
¶
plot_tomography(plot_tomography_path, tomo_abs_path, pixel_path, void_path, tomography_plot_config, tomography_process_config, software_config, delta_config, main_config, void_catalog_name_default)
Produce tomographic-map plots ([tomography plot] stage).
Wraps :class:lelantos.tomography.TomographyPlot to draw map slices with
optional QSO/void/galaxy overlays, delta histograms (single and comparison),
the redshift-integrated map, and catalog-centred maps, according to the
enabled plot_* flags.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plot_tomography_path
|
str
|
Output directory for the figures. |
required |
tomo_abs_path
|
str
|
Absolute path to the tomography directory (map). |
required |
pixel_path
|
str
|
Directory holding the pixel input and property file. |
required |
void_path
|
str
|
Void catalog directory. |
required |
tomography_plot_config
|
|
required | |
tomography_process_config
|
|
required | |
software_config
|
|
required | |
delta_config
|
|
required | |
main_config
|
|
required | |
void_catalog_name_default
|
str | None
|
Catalog produced earlier. |
required |
Source code in lelantos/interface.py
757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 | |
plot_stack_void
¶
plot_stack_void(plot_stack_void_path, stack_void_path, stack_void_plot_config, stack_void_name_default, property_stack_void_name_default)
Plot the void stack ([stack void plot] stage).
Wraps :meth:lelantos.tomography.TomographyStack.plot_stack to plot the
stacked map, optionally with an ellipticity fit and QSO-distance overlay.
Note
This stage reads the keys stack_name and property_stack_name,
which differ from the name_stack / property_file_stack keys
written by the [void stack] stage (see interface_explanatory.ini).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plot_stack_void_path
|
str
|
Output directory for the figures. |
required |
stack_void_path
|
str
|
Directory holding the stack products. |
required |
stack_void_plot_config
|
|
required | |
stack_void_name_default
|
str | None
|
Stack binary produced earlier. |
required |
property_stack_void_name_default
|
str | None
|
Stack property file produced earlier. |
required |
Source code in lelantos/interface.py
894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 | |
print_approximate_shape_size_from_interface_file
¶
print_approximate_shape_size_from_interface_file(input_file)
Estimate and log the map shape/size implied by a config file.
Reads the [delta convert] geometry (footprint, redshift window,
Omega_m, chunking, overlap, sub-map shape) and calls
:func:lelantos.cosmology.compute_shape_size_parallel_from_interface to
report the approximate full-map pixel shape, physical size (Mpc.h^-1) and
the Mpc-per-pixel / pixel-per-Mpc resolution. Useful to size a run before
launching it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_file
|
str
|
Path to the interface |
required |
Source code in lelantos/interface.py
948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 | |