Quickstart#

prose contains the structure to build astronomical images pipelines.

Here is a quick example pipeline to characterize the point spread function (PSF) of an image. Let’s start by loading an example Image.

from prose import Sequence, blocks, example_image
import matplotlib.pyplot as plt

# getting the example image
image = example_image()
image.show()
../_images/cd862d899e771117cf440387d00de1df373503d24cb8409070409dfb5cfd1bab.png

We can now build a Sequence containing single processing units called Block that will sequentially process our image.

sequence = Sequence(
    [
        blocks.PointSourceDetection(),  # stars detection
        blocks.Cutouts(21),             # cutouts extraction
        blocks.MedianEPSF(),            # PSF building
        blocks.Moffat2D(),              # PSF modeling
    ]
)

sequence.run([image])

# plotting the detected stars
image.show()
../_images/39a6451a55fdd40c5a817cbd3bd25441ac9b9b11f058d50bc83a63b3167d9ad3.png

Let’s plot the results of the PSF building and modeling from the Image attributes.

plt.figure(None, (10, 4))

# PSF building
plt.subplot(1, 2, 1, title="Median PSF")
plt.imshow(image.epsf.data, origin="lower")

# PSF modeling
params = image.epsf.params
model = image.epsf.model

plt.subplot(1, 2, 2, title=f"Moffat2D model")
plt.imshow(model(params), origin="lower")
_ = plt.text(
    1,
    1,
    f"$\sigma_x$: {params['sigma_x']:.2f} pix\n$\sigma_y$: {params['sigma_y']:.2f} pix",
    c="w",
)
../_images/f03d73af1d23302b35aae7d35d8ed5902fc609e9737a0752abc8ecd464fdfb2d.png

prose contains a wide variety of blocks implementing methods and algorithms commonly used in astronomical image processing.