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:

To demonstrate how to use these objects, we will work on the following example image:

from prose.simulations import source_example

im = source_example()
_ =


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)
_ =


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

array([PointSource(a=7.448840871964584, b=7.202000579066966, orientation=1.6150469706739825, coords=array([25.02893218, 30.09797018]), peak=711.5976278172313, i=0, discarded=False),
       ExtendedSource(a=19.444583549405184, b=7.785198915761831, orientation=2.345150740025764, coords=array([79.9831468 , 30.00735541]), peak=603.6085462633009, i=1, discarded=False),
       TraceSource(a=29.45583900499354, b=0.882752897398152, orientation=0.927901764625361, coords=array([135.17356673,  30.25999302]), peak=517.784076738549, i=2, discarded=False)],

where we can identify the three types of sources, like an extended source at index 1

⬭ ExtendedSource 1
  coords   79.98   30.01
  a, b     19.44    7.79
  e         0.40

Sources properties#

Such sources contain useful properties and methods used throughout prose to perform image processing.


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
_ = aperture.plot(color="y")

For automatic treatments, the Source.aperture method provides an aperture specific to each type of source

for source in im.sources:
    aperture = source.aperture()
    _ = aperture.plot(color="y")

and associated annulus methods

for source in im.sources:
    aperture = source.annulus()
    _ = aperture.plot(color="y")