Multiband surveys
mlpoppyns.simulator.multiband_surveys.survey_radio
Model for the pulsar radio surveys.
We consider the following surveys:
1) PMPS: the Parks Multibeam Pulsar Survey (see Manchester et al. 2001, Lorimer et al. 2006) 2) SMPS: the Swinburne Parkes Multibeam Pulsar Survey (see Edwards et al. 2001, Jacoby et al. 2009) 3) HTRU: the High Time Resolution Universe Survey (see Keith et al. 2010)
Authors:
Michele Ronchi (ronchi@ice.csic.es)
Celsa Pardo Araujo (pardo@ice.csic.es)
SurveyRadio
Class for any radio survey with a Gaussian telescope beam pattern.
Source code in mlpoppyns/simulator/multiband_surveys/survey_radio.py
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 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 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 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 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 648 649 650 651 652 | |
__init__(parameters_path)
Radio survey initialization. The parameters for the survey are imported from a JSON file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parameters_path
|
str
|
Path to the survey_parameter.json file containing the parameters of the radio survey. The file must include:
|
required |
Source code in mlpoppyns/simulator/multiband_surveys/survey_radio.py
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 | |
aperture_array_factor(DEC)
Computes the aperture array sensitivity correction factor as a function of declination for each pulsar. Args: DEC (np.ndarray): Declination in [deg] defined between [-90, 90] deg in ICRS frame. Returns: (np.ndarray): Correction factor emulating the sensitivity of an aperture array for different declinations.
Source code in mlpoppyns/simulator/multiband_surveys/survey_radio.py
412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 | |
detected_radio_population(w_int_s, DM, P, intercepted_radio, coverage, l_gal, b_gal, DEC, S_radio_bol, spectral_index, tau_sc)
Compute the pulsars detected by each survey.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
w_int_s
|
ndarray
|
Intrinsic pulse widths in [s] |
required |
DM
|
ndarray
|
Dispersion measure in [pc cm^-3]. |
required |
P
|
ndarray
|
Array of spin periods of the pulsars in [s]. |
required |
intercepted_radio
|
ndarray
|
(np.ndarray) Array of boolean variables where True values represent stars whose beam crosses our line of sight. |
required |
coverage
|
ndarray
|
Array of boolean variables indicating the pulsars within the sky coverage. |
required |
l_gal
|
ndarray
|
Galactic longitude in [deg] defined between [-180, 180] deg. |
required |
b_gal
|
ndarray
|
Galactic latitude in [deg] defined between [-90, 90] deg. |
required |
DEC
|
ndarray
|
Declination in [deg] defined between [-90, 90] deg in ICRS frame. |
required |
S_radio_bol
|
ndarray
|
Pulsar bolometric radio flux in [erg s^(-1) cm^(-2)]. |
required |
spectral_index
|
ndarray
|
Spectral indexes. |
required |
tau_sc
|
ndarray
|
Scattering timescale in [s]. |
required |
Returns:
| Type | Description |
|---|---|
Tuple[ndarray, ndarray, ndarray, ndarray]
|
Tuple consisting of the following arrays:
|
Source code in mlpoppyns/simulator/multiband_surveys/survey_radio.py
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 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 648 649 650 651 652 | |
detection_offset(n_detection)
Generating a random offset with respect to the beam center for the detections. A Gaussian beam pattern is assumed to account for sensitivity decay for off-center detections. See Lorimer et al. (1993) and the paragraph following eq. (29) in Bates et al. (2014).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_detection
|
int
|
Number of detections to simulate. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Square of the offset from the beam center for each detection in [arcmin^2] . |
Source code in mlpoppyns/simulator/multiband_surveys/survey_radio.py
381 382 383 384 385 386 387 388 389 390 391 392 393 394 | |
fft_search_efficiency(duty_cycle)
Compute the efficiency factor from Morello et al. (2020) (see eq. 44) to account for incoherent FFT search.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
duty_cycle
|
ndarray
|
duty cycle of pulsars. |
required |
Returns: (np.ndarray): Correction factor emulating the sensitivity of an incoherent FFT search.
Source code in mlpoppyns/simulator/multiband_surveys/survey_radio.py
430 431 432 433 434 435 436 437 438 439 440 441 442 | |
gain_gaussian_beam(offset2)
This method simulates the gain pattern of a receiver. A Gaussian beam pattern is assumed to account for sensitivity decay for off-center detections. See Lorimer et al. (1993) and the paragraph following eq. (29) in Bates et al. (2014).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
offset2
|
ndarray
|
Squared offset from the beam center in [arcmin^2]. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Gain of the telescope for the given offset in [K Jy^(-1)]. |
Source code in mlpoppyns/simulator/multiband_surveys/survey_radio.py
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 | |
radiometer_equation(S_radio_obs_mean, G, w_eff, P, T_sky)
Radiometer equation used to compute the signal-to-noise ratio of each pulsar given the observed period-averaged radio flux at a given frequency, the effective pulse width, the spin period and the survey parameters (see eq. (A1.22) in Lorimer & Kramer 2005). We are assuming a square pulse shape for simplicity with height equal to the observed flux and width equal to the effective width.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
S_radio_obs_mean
|
ndarray
|
Observed period-averaged radio flux density in [Jy]. |
required |
G
|
ndarray
|
Gain of the telescope for the given detection in [K Jy^(-1)]. |
required |
w_eff
|
ndarray
|
Effective pulse width in [s]. |
required |
P
|
ndarray
|
Spin period in [s]. |
required |
T_sky
|
ndarray
|
Sky temperature for every detection in [K]. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Signal-to-noise ratio of the detection. |
Source code in mlpoppyns/simulator/multiband_surveys/survey_radio.py
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 | |
simulate_detection(S_radio_obs_mean, l_gal, b_gal, DEC, w_eff, P)
Simulate a detection: If the measured SNR surpasses the threshold SNR_th of the survey then the pulsar is detected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
S_radio_obs_mean
|
ndarray
|
Observed period-averaged radio flux density in [Jy]. |
required |
l_gal
|
ndarray
|
Galactic longitude in [deg] defined between [-180, 180] deg. |
required |
b_gal
|
ndarray
|
Galactic latitude in [deg] defined between [-90, 90] deg. |
required |
DEC
|
ndarray
|
Declination in [deg] defined between [-90, 90] deg in ICRS frame. |
required |
w_eff
|
ndarray
|
Effective pulse width in [s]. |
required |
P
|
ndarray
|
Spin period in [s]. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Array of boolean variables: True if the pulsar is detected, False if not. |
Source code in mlpoppyns/simulator/multiband_surveys/survey_radio.py
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 | |
sky_coverage(RA, DEC, l_gal, b_gal)
Determine which neutron stars are in the sky region covered by the survey.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
RA
|
ndarray
|
Right ascension in [deg] defined between [0, 360] deg in ICRS frame. |
required |
DEC
|
ndarray
|
Declination in [deg] defined between [-90, 90] deg in ICRS frame. |
required |
l_gal
|
ndarray
|
Galactic longitude in [deg] defined between [-180, 180] deg. |
required |
b_gal
|
ndarray
|
Galactic latitude in [deg] defined between [-90, 90] deg. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Array of boolean variables: True if the pulsar is in the covered sky region, False if not. |
Source code in mlpoppyns/simulator/multiband_surveys/survey_radio.py
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 | |
effective_pulse_width(w_int, DM, channel_width, f, t_samp, tau_sc)
Measured effective pulse width which is smeared out by the inter-channel dispersion, the scattering with the interstellar medium and by the instrumental sampling time (see eq. (2) in Cordes & McLaughlin 2003).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
w_int
|
ndarray
|
Intrinsic pulse width in [s]. |
required |
DM
|
ndarray
|
Dispersion measure in [pc cm^-3]. |
required |
channel_width
|
float
|
Width in frequency of a single frequency channel of the receiver in [Hz]. |
required |
f
|
float
|
Central frequency at which the observation is performed [Hz]. |
required |
t_samp
|
float
|
Sampling time for the radio survey [s]. |
required |
tau_sc
|
ndarray
|
Scattering timescales in [s]. |
required |
Returns: (np.ndarray): Measured effective pulse width in [s].
Source code in mlpoppyns/simulator/multiband_surveys/survey_radio.py
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 | |
flux_radio_obs(S_radio_f, w_int, w_eff)
Compute the flux density received by the telescope after taking into account that the pulse has been broadened by the propagation in the interstellar medium. We assume that the total fluence = S_radio_f x w_int is conserved as the pulse propagates in the interstellar medium. Since the pulse is broadened as it propagates, the flux received on Earth is given by S_radio_obs = fluence / w_eff, therefore S_radio_obs < S_radio_f. Also, since in our simulation we are assuming a simple squared pulse shape, the flux density computed here is equal to the peak flux density.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
S_radio_f
|
ndarray
|
Intrinsic pulsar radio flux in [Jy]. |
required |
w_int
|
ndarray
|
Intrinsic pulse width in [rad]. |
required |
w_eff
|
ndarray
|
Effective pulse width in [rad]. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Observed pulsar radio flux in [Jy]. |
Source code in mlpoppyns/simulator/multiband_surveys/survey_radio.py
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 | |
flux_radio_obs_period_average(S_radio_f_obs, P, w_eff)
Compute the mean flux density received by the telescope averaged over a spin period. We are assuming a simple squared pulse shape.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
S_radio_f_obs
|
ndarray
|
Observed pulsar radio flux in [Jy]. |
required |
P
|
ndarray
|
Spin period of the pulsar in [s]. |
required |
w_eff
|
ndarray
|
Effective pulse width in [s]. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Observed pulsar radio flux averaged over a period in [Jy]. |
Source code in mlpoppyns/simulator/multiband_surveys/survey_radio.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | |
sky_temperature_H81(l_gal, b_gal, f)
Sky temperature as a function of Galactic longitude and latitude (l, b) and frequency f. This function implements the sky temperature map at 408 MHz from Haslam et al. (1981), downloadable here: https://lambda.gsfc.nasa.gov/product/foreground/haslam_408.cfm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
l_gal
|
ndarray
|
Galactic longitude in [deg] defined between [-180, 180] deg. |
required |
b_gal
|
ndarray
|
Galactic latitude in [deg] defined between [-90, 90] deg. |
required |
f
|
float
|
Central frequency at which the observation is performed [Hz]. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Measured sky temperature in [K] as a function of the Galactic coordinates at frequency f. |
Source code in mlpoppyns/simulator/multiband_surveys/survey_radio.py
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 | |
sky_temperature_H81refined(l_gal, b_gal, f)
Sky temperature as a function of Galactic longitude and latitude (l, b) and frequency f. This function implements the sky temperature map at 408 MHz from Remazeilles et al. (2015) which is a refinement of the map from Haslam et al. (1981). The map is downloadable here: https://lambda.gsfc.nasa.gov/product/foreground/fg_2014_haslam_408_get.html.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
l_gal
|
ndarray
|
Galactic longitude in [deg] defined between [-180, 180] deg. |
required |
b_gal
|
ndarray
|
Galactic latitude in [deg] defined between [-90, 90] deg. |
required |
f
|
float
|
Central frequency at which the observation is performed [Hz]. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Measured sky temperature in [K] as a function of the Galactic coordinates at frequency f. |
Source code in mlpoppyns/simulator/multiband_surveys/survey_radio.py
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 | |
sky_temperature_approx(l_gal, b_gal, f)
Sky temperature as a function of Galactic longitude and latitude (l, b) and frequency f. This function uses an empirical fit from Narayan (1987) and rescale to the given frequency using a relation from Johnston et al. (1992) (see also eq. (5) in Yusifov & Küçük 2004).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
l_gal
|
ndarray
|
Galactic longitude in [deg] defined between [-180, 180] deg. |
required |
b_gal
|
ndarray
|
Galactic latitude in [deg] defined between [-90, 90] deg. |
required |
f
|
float
|
Central frequency at which the observation is performed [Hz]. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Measured sky temperature in [K] as a function of the Galactic coordinates at frequency f. |
Source code in mlpoppyns/simulator/multiband_surveys/survey_radio.py
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 | |
smearing_in_channel(DM, channel_width, nu)
Dispersive smearing inside a single frequency channel in [s] evaluated for the central frequency of the survey. See eq. (27) in Bates et al. (2014) and appendix A2.4 of Handbook of pulsar astronomy by Lorimer and Kramer (2004).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
DM
|
ndarray
|
Dispersion measure in [pc cm^-3]. |
required |
channel_width
|
float
|
Width in frequency of a single frequency channel of the receiver in [Hz]. |
required |
nu
|
float
|
Central frequency at which the observation is performed [Hz]. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Intra-channel dispersive smearing in [s]. |
Source code in mlpoppyns/simulator/multiband_surveys/survey_radio.py
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 | |
mlpoppyns.simulator.multiband_surveys.surveys_wrapper
A wrapper module to include all methods used in the script simulate_population_magrot_det.py to initialize and simulate surveys to detect neutron stars in different wavelengths.
Authors:
Vanessa Graber (graber @ ice.csic.es)
Michele Ronchi (ronchi @ ice.csic.es)
Alberto Garcia-Garcia (garciagarcia @ ice.csic.es)
Celsa Pardo Araujo (pardo @ ice.csic.es)
SurveyData
dataclass
A dataclass object to store all the survey data for a simulation.
Attributes:
| Name | Type | Description |
|---|---|---|
surveys_cfg |
Dict
|
A dictionary to save all the survey information from config_simulator. |
surveys_radio |
Dict
|
A dictionary to store the radio survey class objects. |
n_detected_sim |
Dict
|
A dictionary to store the number of stars detected in each survey. |
n_detected_complete_sim |
Dict
|
A dictionary to store how many neutron stars are detected in the flux ranges where we assume completeness. |
percentage_detected |
Dict
|
A dictionary storing the percentage of detections compared to real detected numbers. |
n_created_at_match |
Dict
|
A dictionary storing how many stars we have created to reach the desirable number in each survey. |
n_detected_sim_at_match |
Dict
|
A dictionary storing how many stars we have detected when we reach the desirable number in each survey. |
batchsize_adjust_flags |
Dict
|
A dictionary storing the flags for adjusting batch size as we approach the target detection number for all surveys. |
stop_flags |
Dict
|
A dictionary storing the flags for stopping the simulation as we reach the target detection number for all surveys. |
dictionary_detected_radio |
Dict
|
A dictionary storing all the properties of neutron stars detected in the radio surveys. |
Source code in mlpoppyns/simulator/multiband_surveys/surveys_wrapper.py
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 | |
adjust_n_batchsize(survey_data_class)
To speed up the simulation, generate new neutron stars in batches.
The batchsize is adjusted as the synthetic population approaches the observed number of neutron stars in the real surveys. This guarantees a better fine-tuning of the simulated detected numbers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
survey_data_class
|
SurveyData
|
The SurveyData dataclass containing the data of all neutron star surveys. |
required |
Source code in mlpoppyns/simulator/multiband_surveys/surveys_wrapper.py
582 583 584 585 586 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 | |
apply_surveys_coverage_filter(surveys_radio, coverage_dict, pop_dict, idx_remove)
Apply survey coverage criteria to filter a dynamic population dataset based on sky coverage of all surveys and a distance cutoff, and update the indices of entries to be removed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
surveys_radio
|
dict
|
A dictionary of radio survey objects, containing the information on the sky coverage. |
required |
coverage_dict
|
dict
|
A dictionary with the sky coverage information for all surveys. |
required |
pop_dict
|
dict
|
A dictionary containing the data of a neutron star population. |
required |
idx_remove
|
list
|
A list of indices of entries to be removed based on the filtering criteria. |
required |
Returns:
| Type | Description |
|---|---|
Tuple[dict, list]
|
A tuple object containing the following attributes:
|
Source code in mlpoppyns/simulator/multiband_surveys/surveys_wrapper.py
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 | |
compute_surveys_coverage(surveys_radio, pop_dict, dist_cutoff)
Apply survey coverage criteria to filter a dynamic population dataset based on sky coverage of all surveys and a distance cutoff, and update the indices of entries to be removed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
surveys_radio
|
dict
|
A dictionary of radio survey objects, containing the information on the sky coverage. |
required |
pop_dict
|
dict
|
A dictionary containing the sky coordinates of a population of neutron stars. |
required |
dist_cutoff
|
float
|
The maximum heliocentric distance to include in the survey coverage. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
A dictionary with the sky coverage information for all surveys. |
Source code in mlpoppyns/simulator/multiband_surveys/surveys_wrapper.py
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 | |
create_output_dataframe_surveys(dictionary_detected_radio)
Creates Pandas DataFrames containing the information on the detected neutron stars for each survey.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dictionary_detected_radio
|
dict
|
Dictionary containing detected neutron star properties for each radio survey. |
required |
Returns: (dict): A dictionary of DataFrames, one for each survey containing detected neutron stars' information.
Source code in mlpoppyns/simulator/multiband_surveys/surveys_wrapper.py
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 | |
initialize_all_surveys()
Initialize all surveys.
Returns:
| Type | Description |
|---|---|
SurveyData
|
A SurveyData object containing all survey data. |
Source code in mlpoppyns/simulator/multiband_surveys/surveys_wrapper.py
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 | |
initialize_radio_surveys()
Initialize and return radio survey objects and empty detection dictionaries.
Returns:
| Type | Description |
|---|---|
Tuple[dict, dict]
|
A tuple of dictionaries containing the following information:
|
Source code in mlpoppyns/simulator/multiband_surveys/surveys_wrapper.py
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 125 126 127 128 129 130 | |
radio_detection(radio_surveys, dictionary_radio, intercepted_radio, logger, full_population=False)
Simulate radio detections for various surveys and update the dictionaries with the properties of detected neutron stars.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radio_surveys
|
dict
|
Dictionary containing the radio survey objects. |
required |
dictionary_radio
|
dict
|
Dictionary with properties of radio pulsars. |
required |
intercepted_radio
|
ndarray
|
Boolean mask to select radio pulsars whose beam intercept our line of sight. |
required |
logger
|
Logger
|
Logger object for logging. |
required |
full_population
|
bool
|
If True, return arrays of size |
False
|
Returns:
| Type | Description |
|---|---|
dict
|
A dictionary containing the properties of detected pulsars for each survey. |
Source code in mlpoppyns/simulator/multiband_surveys/surveys_wrapper.py
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 381 382 383 384 385 386 387 388 389 390 | |
update_filtered_dictionary(dict_to_update, mask, **kwargs)
This function updates a dictionary to include for each key only the values corresponding to a given Boolean mask.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dict_to_update
|
dict
|
The original dictionary containing properties of neutron stars. |
required |
mask
|
ndarray
|
Boolean mask indicating which elements for each key in |
required |
**kwargs
|
ndarray
|
Additional property values provided as keyword arguments.
These properties will also be filtered using the |
{}
|
Returns:
| Type | Description |
|---|---|
dict
|
A new dictionary containing only the filtered values from |
Source code in mlpoppyns/simulator/multiband_surveys/surveys_wrapper.py
393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 | |
update_survey_data(survey_data_class, pop_detected_dict_update, survey_type, n_created, idx_remove, logger)
This function updates the survey data dictionaries to include only the properties of neutron stars that are detected in the surveys.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
survey_data_class
|
SurveyData
|
The SurveyData dataclass containing the data of all neutron star surveys. |
required |
pop_detected_dict_update
|
dict
|
A dictionary containing the properties of neutron stars that have been detected in the surveys. |
required |
survey_type
|
str
|
A string specifying which survey to update, "Radio" or "X-ray". |
required |
n_created
|
int
|
The total number of neutron stars created so far. |
required |
idx_remove
|
list
|
A list of indices of the neutron stars that have been detected and have to be removed from the dynamical database. |
required |
logger
|
Logger
|
A logger instance to log messages. |
required |
Source code in mlpoppyns/simulator/multiband_surveys/surveys_wrapper.py
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 | |