tod
Tools for fitting detector pointing from source-observation TODs.
The main fitting routine, fit_tod_pointing, estimates each detector's
offset, beam width, and amplitude by fitting a symmetric 2D Gaussian to
the source response in source-centered (xi, eta) coordinates. The TOD
residuals are filtered before fitting, and optional binned priors are
used to improve the initial pointing estimate.
The module also provides helpers for converting boresight coordinates to source-centered coordinates, constructing binned position priors, and filtering TOD residuals. See the individual function docstrings for details.
filter_tod(am, filt, signal_name='resid', rfft=None)
Apply a Fourier-domain filter to a signal in an AxisManager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
am
|
AxisManager
|
AxisManager containing the signal and time axes. |
required |
filt
|
FilterChain
|
sotodlib Fourier filter to apply. |
required |
signal_name
|
str
|
Name of the signal field to filter. |
"resid"
|
rfft
|
RFFTObj
|
Precomputed FFT configuration. If |
None
|
Returns:
| Type | Description |
|---|---|
AxisManager
|
The input AxisManager with |
Source code in lat_beams/fitting/tod.py
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 | |
fit_tod_pointing(aman, bandpass_range=(None, None), fwhm=np.deg2rad(0.5), max_rad=None, source='mars', bin_priors=True, bin_2d=True, pos_priors=None, show_tqdm=False, min_snr=5.0)
Fit detector beam positions from a source-observation TOD.
Each detector is fit independently with a symmetric 2D Gaussian. The source-centered xi/eta trajectory is used as the detector position, and the TOD is filtered before fitting. Initial positions can optionally be estimated from binned TOD data or supplied as positional priors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
aman
|
AxisManager
|
Observation containing detector TOD and boresight data. Must contain
|
required |
bandpass_range
|
tuple[Optional[float], Optional[float]]
|
Low and high frequency cutoffs in Hz. A value of |
(None, None)
|
fwhm
|
float
|
Initial beam FWHM in radians. |
np.deg2rad(0.5)
|
max_rad
|
float
|
Maximum radius in radians around the initial beam position to include
in the fit. If |
None
|
source
|
str
|
Solar-system source being observed. |
"mars"
|
bin_priors
|
bool
|
If |
True
|
bin_2d
|
bool
|
If |
True
|
pos_priors
|
Float[NDArray, 'ndets 2']
|
Initial positional priors in radians. Each row contains |
None
|
show_tqdm
|
bool
|
If |
False
|
min_snr
|
float
|
Signal-to-noise threshold used when calculating the number of hits. |
5.0
|
Returns:
| Name | Type | Description |
|---|---|---|
focal_plane |
AxisManager
|
Fitted detector parameters. Fields include:
|
Source code in lat_beams/fitting/tod.py
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 | |
get_xieta_src_centered(ctime, az, el, roll, sso_name)
Get source-centered xi and eta coordinates.
The source position is evaluated using the center of the input time range. This is a good approximation for a slowly moving source, but can become inaccurate for a long time range or one spanning both sides of a transit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctime
|
Float[NDArray, n]
|
Observation times. |
required |
az
|
Float[NDArray, n]
|
Boresight azimuth angles in radians. |
required |
el
|
Float[NDArray, n]
|
Boresight elevation angles in radians. |
required |
roll
|
Float[NDArray, n]
|
Boresight roll angles in radians. |
required |
sso_name
|
str
|
Name of the solar-system object. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
xi |
Float[NDArray, n]
|
Source-centered xi coordinates in radians. |
eta |
Float[NDArray, n]
|
Source-centered eta coordinates in radians. |
Source code in lat_beams/fitting/tod.py
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 | |