IdealImager

class artpop.image.IdealImager[source]

Bases: Imager

Ideal imager for making noise-free images.

Note

Stars are injected in the center of pixels even if subpixel coordinates are given. If you need subpixel precision, we recommend creating upsampled mock images and downsampling to the desired resolution.

Methods Summary

apply_seeing(image[, psf, boundary])

Convolve mock image with psf.

inject_smooth_model(image, source, bandpass, zpt)

Inject smooth component of the star system into image if it exists.

inject_stars(x, y, signal, xy_dim[, mask])

Inject sources into image.

observe(source, bandpass[, psf, zpt, mask])

Make ideal observation.

Methods Documentation

apply_seeing(image, psf=None, boundary='wrap')

Convolve mock image with psf.

Parameters
imagendarray

The mock image.

psfndarray or None, optional

The point-spread function. If None, will return the input image.

boundary{‘fill’, ‘wrap’}, optional

A flag indicating how to handle boundaries:

  • ‘fill’: set values outside the array boundary to fill_value (default)

  • ‘wrap’: periodic boundary

The None and ‘extend’ parameters are not supported for FFT-based convolution.

Returns
imagendarray

The psf-convolved image. If psf is not None, the original image is returned.

inject_smooth_model(image, source, bandpass, zpt)[source]

Inject smooth component of the star system into image if it exists.

Parameters
imagendarray

The artificial image.

sourceSource

The artificial source.

bandpassstr

Observational bandpass of the mock observation.

zptfloat

Photometric zero point.

Returns
imagendarray

The artificial image with the smooth model injected into it. If no smooth model exists, the original image will be returned.

inject_stars(x, y, signal, xy_dim, mask=None)

Inject sources into image.

Parameters
xndarray

Source x coordinates.

yndarray

Source y coordinates.

signalndarray

The signal to inject into image (e.g., flux, counts, etc…).

xy_dimint or list-like

The dimensions of mock image in xy units. If int is given, it is assumed to be both the x and y dimensions: (xy_dim, xy_dim).

maskndarray, optional

Boolean mask that is set to True for stars you want to inject. If None, all stars will be injected.

Returns
imagendarray

The mock image before psf convolution.

observe(source, bandpass, psf=None, zpt=27, mask=None, **kwargs)[source]

Make ideal observation.

Parameters
sourceSource

Source to mock observer.

bandpassstr

Filter of observation. Must be a filter in the given photometric system(s).

psfndarray or None, optional

The point-spread function. If None, will not psf-convolve image.

zptfloat, optional

The magnitude zero point of the mock image.

maskndarray, optional

Boolean mask that is set to True for stars you want to inject. If None, all stars will be injected.

Returns
observationIdealObservation

Observation object for the ideal imager.