Sources
PointSource
Bases: Source
A simple point source with a spectrum, position and flux.
UML
Attributes:
Name | Type | Description |
---|---|---|
position |
(Array, radians)
|
The (x, y) on-sky position of this object. |
flux |
(float, photons)
|
The flux of the object. |
spectrum |
Spectrum
|
The spectrum of this object, represented by a Spectrum object. |
Source code in src/dLux/sources.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 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 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 |
|
__init__(wavelengths=None, position=np.zeros(2), flux=1.0, weights=None, spectrum=None)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wavelengths
|
Array, metres = None
|
The array of wavelengths at which the spectrum is defined. This input is ignored if a Spectrum object is provided. |
None
|
position
|
Array, radians = np.zeros(2)
|
The (x, y) on-sky position of this object. |
zeros(2)
|
flux
|
float, photons = 1.
|
The flux of the object. |
1.0
|
spectrum
|
Spectrum = None
|
The spectrum of this object, represented by a Spectrum object. |
None
|
Source code in src/dLux/sources.py
131 132 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 161 |
|
model(optics, return_wf=False, return_psf=False)
Models the source object through the provided optics.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
optics
|
Optics
|
The optics through which to model the source object. |
required |
return_wf
|
bool = False
|
Should the Wavefront object be returned instead of the psf Array? |
False
|
return_psf
|
bool = False
|
Should the PSF object be returned instead of the psf Array? |
False
|
Returns:
Name | Type | Description |
---|---|---|
object |
(Array, Wavefront, PSF)
|
if |
Source code in src/dLux/sources.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 |
|
PointSources
Bases: Source
A set of point sources with the same spectrum, but different positions and fluxes.
UML
Attributes:
Name | Type | Description |
---|---|---|
position |
(Array, radians)
|
The ((x0, y0), (x1, y1), ...) on-sky positions of these sources. |
flux |
(Array, photons)
|
The fluxes of the sources. |
spectrum |
Spectrum
|
The spectrum of this object, represented by a Spectrum object. |
Source code in src/dLux/sources.py
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 |
|
__init__(wavelengths=None, position=np.zeros((1, 2)), flux=None, weights=None, spectrum=None)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wavelengths
|
(Array, metres)
|
The array of wavelengths at which the spectrum is defined. |
None
|
position
|
Array, radians = np.zeros((1, 2))
|
The (x, y) on-sky position of this object. |
zeros((1, 2))
|
flux
|
Array, photons = None
|
The flux of the object. |
None
|
weights
|
Array = None
|
The spectral weights of the object. |
None
|
spectrum
|
Spectrum = None
|
The spectrum of this object, represented by a Spectrum object. |
None
|
Source code in src/dLux/sources.py
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 |
|
model(optics, return_wf=False, return_psf=False)
Models the source object through the provided optics.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
optics
|
Optics
|
The optics through which to model the source object. |
required |
return_wf
|
bool = False
|
Should the Wavefront object be returned instead of the psf Array? |
False
|
return_psf
|
bool = False
|
Should the PSF object be returned instead of the psf Array? |
False
|
Returns:
Name | Type | Description |
---|---|---|
object |
(Array, Wavefront, PSF)
|
if |
Source code in src/dLux/sources.py
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 |
|
BinarySource
Bases: Source
A binary source parameterised by the position, flux, separation, position_angle, and contrast between the two sources.
UML
Attributes:
Name | Type | Description |
---|---|---|
position |
(Array, radians)
|
The mean (x, y) on-sky position of this object. |
mean_flux |
(float, photons)
|
The mean flux of the sources. |
separation |
(float, radians)
|
The separation of the two sources in radians. |
position_angle |
(float, radians)
|
The position angle between the two sources measured clockwise from the vertical axis. |
contrast |
float
|
The contrast ratio between the two sources. |
spectrum |
Spectrum
|
The spectrum of this object, represented by a Spectrum object. |
Source code in src/dLux/sources.py
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 |
|
__init__(wavelengths=None, position=np.zeros(2), mean_flux=1.0, separation=0.0, position_angle=np.pi / 2, contrast=1.0, spectrum=None, weights=None)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wavelengths
|
Array, metres = None
|
The array of wavelengths at which the spectrum is defined. |
None
|
position
|
Array, radians = np.zeros(2)
|
The (x, y) on-sky position of this object. |
zeros(2)
|
mean_flux
|
float, photons = 1.
|
The mean flux of the sources. |
1.0
|
separation
|
float, radians = 0.
|
The separation of the two sources in radians. |
0.0
|
position_angle
|
float, radians = np.pi / 2
|
The position angle between the two sources measured clockwise from the vertical axis. |
pi / 2
|
contrast
|
float = 1.
|
The contrast ratio between the two sources. |
1.0
|
spectrum
|
Spectrum = None
|
The spectrum of this object, represented by a Spectrum object. |
None
|
Source code in src/dLux/sources.py
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 |
|
model(optics, return_wf=False, return_psf=False)
Models the source object through the provided optics.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
optics
|
Optics
|
The optics through which to model the source object. |
required |
return_wf
|
bool = False
|
Should the Wavefront object be returned instead of the psf Array? |
False
|
return_psf
|
bool = False
|
Should the PSF object be returned instead of the psf Array? |
False
|
Returns:
Name | Type | Description |
---|---|---|
object |
(Array, Wavefront, PSF)
|
if |
Source code in src/dLux/sources.py
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 |
|
ResolvedSource
Bases: PointSource
A single resolved source with a spectrum, position, flux, and distribution array that represents the resolved component.
UML
Attributes:
Name | Type | Description |
---|---|---|
position |
(Array, radians)
|
The (x, y) on-sky position of this object. |
flux |
(float, photons)
|
The flux of the object. |
distribution |
Array
|
The array of intensities representing the resolved source. |
spectrum |
Spectrum
|
The spectrum of this object, represented by a Spectrum object. |
Source code in src/dLux/sources.py
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 |
|
__init__(wavelengths=None, position=np.zeros(2), flux=1.0, distribution=np.ones((3, 3)), weights=None, spectrum=None)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wavelengths
|
(Array, metres)
|
The array of wavelengths at which the spectrum is defined. |
None
|
position
|
Array, radians = np.zeros(2)
|
The (x, y) on-sky position of this object. |
zeros(2)
|
flux
|
float, photons = 1.
|
The flux of the object. |
1.0
|
distribution
|
Array = np.ones((3, 3))
|
The array of intensities representing the resolved source. |
ones((3, 3))
|
weights
|
Array = None
|
The spectral weights of the object. |
None
|
spectrum
|
Spectrum = None
|
The spectrum of this object, represented by a Spectrum object. |
None
|
Source code in src/dLux/sources.py
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 |
|
model(optics=None, return_wf=False, return_psf=False)
Models the source object through the provided optics.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
optics
|
Optics
|
The optics through which to model the source object. |
None
|
return_wf
|
bool = False
|
Should the Wavefront object be returned instead of the psf Array? |
False
|
return_psf
|
bool = False
|
Should the PSF object be returned instead of the psf Array? |
False
|
Returns:
Name | Type | Description |
---|---|---|
object |
(Array, Wavefront, PSF)
|
if |
Source code in src/dLux/sources.py
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 |
|
normalise()
Method for returning a new source object with a normalised total spectrum and source distribution.
Returns:
Name | Type | Description |
---|---|---|
source |
Source
|
The source object with the normalised spectrum and distribution. |
Source code in src/dLux/sources.py
367 368 369 370 371 372 373 374 375 376 377 378 379 380 |
|
PointResolvedSource
Bases: ResolvedSource
A class for modelling a point source and a resolved source that is defined relative to the point source. An example would be an unresolved star with a resolved dust shell or debris disk. These two objects share the same spectra but have their flux defined by flux (the mean flux) and the flux ratio (contrast) between the point source and resolved distribution. The resolved component is defined by an array of intensities that represent the resolved distribution.
UML
Attributes:
Name | Type | Description |
---|---|---|
position |
(Array, radians)
|
The (x, y) on-sky position of this object. |
flux |
(float, photons)
|
The mean flux of the point and resolved source. |
distribution |
Array
|
The array of intensities representing the resolved source. |
contrast |
float
|
The contrast ratio between the point source and the resolved source. |
spectrum |
Spectrum
|
The spectrum of this object, represented by a Spectrum object. |
Source code in src/dLux/sources.py
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 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 707 708 709 710 711 712 713 714 715 716 717 718 719 |
|
__init__(wavelengths=None, position=np.zeros(2), flux=1.0, distribution=np.ones((3, 3)), contrast=1.0, weights=None, spectrum=None)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wavelengths
|
Array, metres = None
|
The array of wavelengths at which the spectrum is defined. |
None
|
position
|
Array, radians = np.zeros(2)
|
The (x, y) on-sky position of this object. |
zeros(2)
|
flux
|
float, photons = 1.
|
The mean flux of the point and resolved source. |
1.0
|
distribution
|
Array = np.ones((3, 3))
|
The array of intensities representing the resolved source. |
ones((3, 3))
|
contrast
|
float = 1.
|
The contrast ratio between the point source and the resolved source. |
1.0
|
weights
|
Array = None
|
The spectral weights of the object. |
None
|
spectrum
|
Spectrum = None
|
The spectrum of this object, represented by a Spectrum object. |
None
|
Source code in src/dLux/sources.py
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 |
|
model(optics, return_wf=False, return_psf=False)
Models the source object through the provided optics.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
optics
|
Optics
|
The optics through which to model the source object. |
required |
return_wf
|
bool = False
|
Should the Wavefront object be returned instead of the psf Array? |
False
|
return_psf
|
bool = False
|
Should the PSF object be returned instead of the psf Array? |
False
|
Returns:
Name | Type | Description |
---|---|---|
object |
(Array, Wavefront, PSF)
|
if |
Source code in src/dLux/sources.py
645 646 647 648 649 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 707 708 709 710 711 712 713 714 715 716 717 718 719 |
|
Scene
Bases: BaseSource
A source object that holds a set of sources that are model simultaneously.
UML
Attributes:
Name | Type | Description |
---|---|---|
sources |
dict
|
A dictionary of source objects to model simultaneously. |
Source code in src/dLux/sources.py
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 755 756 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 |
|
__getattr__(key)
Raises the individual sources via their keys.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
The key of the item to be searched for in the sub-dictionaries. |
required |
Returns:
Name | Type | Description |
---|---|---|
item |
object
|
The item corresponding to the supplied key in the sub-dictionaries. |
Source code in src/dLux/sources.py
763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 |
|
__init__(sources)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sources
|
list[Source]
|
A list of source objects to model simultaneously. |
required |
Source code in src/dLux/sources.py
737 738 739 740 741 742 743 744 745 746 747 |
|
model(optics, return_wf=False, return_psf=False)
Models the source object through the provided optics.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
optics
|
Optics
|
The optics through which to model the source object. |
required |
return_wf
|
bool = False
|
Should the Wavefront object be returned instead of the psf Array? |
False
|
return_psf
|
bool = False
|
Should the PSF object be returned instead of the psf Array? |
False
|
Returns:
Name | Type | Description |
---|---|---|
object |
(Array, Wavefront, PSF)
|
if |
Source code in src/dLux/sources.py
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 |
|
normalise()
Method for returning a new scene with normalised source objects.
Returns:
Name | Type | Description |
---|---|---|
scene |
Scene
|
The normalised scene object. |
Source code in src/dLux/sources.py
749 750 751 752 753 754 755 756 757 758 759 760 761 |
|