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_system
FilterSystem
, optional Filter system object with filter curves for the filters you use to create artificial images. This object calculates
dlam
andlam_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_state
None
, int, list of ints, orRandomState
If
None
, return theRandomState
singleton used bynumpy.random
. Ifint
, return a newRandomState
instance seeded with theint
. IfRandomState
, return it. Otherwise raiseValueError
.
Attributes Summary
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
- image
ndarray
The mock image.
- psf
ndarray
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.
- image
- Returns
- 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
- Returns
- image
ndarray
The artificial image with the smooth model injected into it. If no smooth model exists, the original image will be returned.
- image
- inject_stars(x, y, signal, xy_dim, mask=None)¶
Inject sources into image.
- Parameters
- x
ndarray
Source x coordinates.
- y
ndarray
Source y coordinates.
- signal
ndarray
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).- mask
ndarray
, optional Boolean mask that is set to True for stars you want to inject. If None, all stars will be injected.
- x
- Returns
- image
ndarray
The mock image before psf convolution.
- image
- mag_to_counts(mags, bandpass, exptime)[source]¶
Convert magnitudes to counts.
- Parameters
- Returns
- counts
ndarray
The counts associated with each magnitude.
- counts
- observe(source, bandpass, exptime, sky_sb=None, psf=None, zpt=27.0, mask=None, **kwargs)[source]¶
Make artificial observation.
- Parameters
- source
Source
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 besecond
.- sky_sbfloat or None, optional
Constant surface brightness of the sky. If None is given, then no sky noise will be added.
- psf
ndarray
or None, optional The point-spread function. If None, will not psf-convolve image.
- zptfloat, optional
The magnitude zero point of the mock image.
- mask
ndarray
, optional Boolean mask that is set to True for stars you want to inject. If None, all stars will be injected.
- source
- Returns
- observation
ArtObservation
Observation object for the artificial imager.
- observation