ArtImager

class artpop.image.ArtImager(phot_system=None, diameter=10, read_noise=0.0, efficiency=1.0, dlam=None, lam_eff=None, filter_system=None, zpt_inst=None, random_state=None)[source]

Bases: Imager

Imager for making fully artificial 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.

Note

If you use a phot_system and its pre-calculated filter properties, the conversion from magnitude to counts assumes AB magnitudes.

Parameters
phot_systemstr or list-like, optional

Name of the photometric system(s). Use this option if you are using magnitudes from one of the systems with pre-calculated filter properties included with ArtPop. See phot_system_list.

diameterfloat or Quantity, optional

Diameter of the telescope aperture. If a float is given, the units will be assumed to be meters.

read_noisefloat, optional

RMS of Gaussian read noise. Set to zero by default.

efficiencyfloat, optional

Efficiency factor (e.g., to account for CCD efficiency, atmospheric transmission, etc). It is set to one by default.

dlamdict of floats or dict of ~astropy.units.Quantity`, optional

Dictionary containing the filter widths. Used for converting magnitudes into counts. Filter names should be the keys and the widths the values. If the wavelengths are given as floats, angstroms will be assumed.

lam_effdict of floats or dict of ~astropy.units.Quantity`, optional

Dictionary containing the filter effective wavelengths. Used for converting magnitudes into counts. Filter names should be the keys and the widths should be the values. If the wavelengths are given as floats, angstroms will be assumed.

filter_systemFilterSystem, optional

Filter system object with filter curves for the filters you use to create artificial images. This object calculates dlam and lam_eff for converting magnitudes into counts.

zpt_instdictionary, optional

Instrumental zero points. Format should be a dictionary with the filter names as keys and the zero points as values. If not None, this alone sets the magnitude associated with 1 count per second. This parameter takes precedence; parameters such as the diameter will be ignored.

random_stateNone, int, list of ints, or RandomState

If None, return the RandomState singleton used by numpy.random. If int, return a new RandomState instance seeded with the int. If RandomState, return it. Otherwise raise ValueError.

Attributes Summary

area

Area of aperture.

Methods Summary

apply_seeing(image[, psf, boundary])

Convolve mock image with psf.

calibration(bandpass, exptime[, zpt])

Calculate the calibration factor, which converts counts into calibrated flux units.

inject_smooth_model(image, source, bandpass, ...)

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

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

Inject sources into image.

mag_to_counts(mags, bandpass, exptime)

Convert magnitudes to counts.

observe(source, bandpass, exptime[, sky_sb, ...])

Make artificial observation.

sb_to_counts_per_pixel(sb, bandpass, ...)

Convert a constant surface brightness into counts per pixel.

Attributes Documentation

area

Area of aperture.

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.

calibration(bandpass, exptime, zpt=27.0)[source]

Calculate the calibration factor, which converts counts into calibrated flux units.

Parameters
bandpassstr

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

exptimefloat or Quantity

Exposure time. If float is given, the units are assumed to be second.

zptfloat, optional

The magnitude zero point of the mock image.

Returns
cali_factorfloat

The calibration factor.

inject_smooth_model(image, source, bandpass, exptime, 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.

exptimefloat or Quantity

Exposure time. If float is given, the units are assumed to be second.

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.

mag_to_counts(mags, bandpass, exptime)[source]

Convert magnitudes to counts.

Parameters
magsndarray or Column

AB magnitudes to be converted into counts.

bandpassstr

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

exptimefloat or Quantity

Exposure time. If float is given, the units are assumed to be second.

Returns
countsndarray

The counts associated with each magnitude.

observe(source, bandpass, exptime, sky_sb=None, psf=None, zpt=27.0, mask=None, **kwargs)[source]

Make artificial observation.

Parameters
sourceSource

Artificial source to be observed.

bandpassstr

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

exptimefloat or Quantity

Exposure time. If float is given, the units are assumed to be second.

sky_sbfloat or None, optional

Constant surface brightness of the sky. If None is given, then no sky noise will be added.

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
observationArtObservation

Observation object for the artificial imager.

sb_to_counts_per_pixel(sb, bandpass, exptime, pixel_scale)[source]

Convert a constant surface brightness into counts per pixel.

Parameters
sbfloat

Surface brightness in units of mag per square arcsec.

bandpassstr

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

exptimefloat or Quantity

Exposure time. If float is given, the units are assumed to be second.

pixel_scaleQuantity

Pixel scale.

Returns
counts_per_pixelfloat

Counts per pixel associated with the given surface brightness.