Sources#
In prose
, objects detected in astronomical images are represented by Source
objects. To encompass the large variety of sources encountered in astronomical images, prose fatures three kinds of sources:
PointSource: star
ExtendedSource: comet, galaxy or lensed source
TraceSource: diffracted spectrum, satellite streak or cosmic ray
To demonstrate how to use these objects, we will work on the following example image:
from prose.simulations import source_example
im = source_example()
_ = im.show()
Detection#
To detect these sources, detection blocks from the prose.blocks.detection
module can be used:
from prose import blocks
im = blocks.detection.AutoSourceDetection(min_area=2.0)(im)
_ = im.show()
Note
Source-specific detection blocks are also available, like the PointSourceDetection
, as well as blocks with legacy detection algorithms such as DAOFindStars
From here, sources are located in the Image.sources
object
im.sources
array([PointSource(a=7.27731607873119, b=7.13659101541078, orientation=0.2511845824904546, coords=array([24.97294478, 29.9760079 ]), peak=704.7791466048427, i=0, discarded=False),
ExtendedSource(a=18.90216084088588, b=7.872387025388987, orientation=2.3362100451125793, coords=array([80.02963314, 29.92012386]), peak=606.2406241047279, i=1, discarded=False),
TraceSource(a=29.271560543180488, b=0.8953476293811246, orientation=0.9288368364077698, coords=array([135.31755481, 30.43770383]), peak=520.144050123536, i=2, discarded=False)],
dtype=object)
where we can identify the three types of sources, like an extended source at index 1
print(im.sources[1])
⬭ ExtendedSource 1
----------------
coords 80.03 29.92
a, b 18.90 7.87
e 0.42
Sources properties#
Such sources contain useful properties and methods used throughout prose to perform image processing.
Apertures#
Apertures from the photutils.aperture
module can easily be instantiated from a Source
object
import matplotlib.pyplot as plt
source = im.sources[0]
aperture = source.circular_aperture(10, scale=False)
# plotted on top of the image
im.show(sources=False)
_ = aperture.plot(color="y")
For automatic treatments, the Source.aperture
method provides an aperture specific to each type of source
im.show(sources=False)
for source in im.sources:
aperture = source.aperture()
_ = aperture.plot(color="y")
and associated annulus methods
im.show(sources=False)
for source in im.sources:
aperture = source.annulus()
_ = aperture.plot(color="y")