synthesizer.instruments.photometric_imager¶
Specialised photometric imaging instrument.
This instrument is designed to hold the attributes required by photometric
imaging. It extends PhotometricInstrument with spatial resolution,
optional PSFs, fixed noise maps, and correlated-noise source maps.
Classes
- class synthesizer.instruments.photometric_imager.PhotometricImager(label, filters, resolution, psfs=None, psf_resample_factor=1, depth=None, depth_app_radius=None, snrs=None, noise_maps=None, noise_source_maps=None)[source]¶
Photometric imager instrument class.
A class containing the attributes and methods required to produce photometric images. It extends
PhotometricInstrumentwith spatial resolution, optional PSFs, fixed noise maps, and correlated-noise source maps. This is the instrument class to use when a photometric setup must produce resolved images rather than integrated photometry alone.- resolution¶
The spatial resolution of the instrument, in kpc or arcseconds.
- Type:
unyt_array
- psfs¶
An optional dictionary of point spread functions, with one entry per filter.
- Type:
dict, optional
- noise_maps¶
An optional dictionary of fixed noise maps to apply directly to images, with one entry per filter.
- Type:
dict, optional
- noise_source_maps¶
An optional dictionary of source maps used to generate correlated-noise models, with one entry per filter.
- Type:
dict, optional
- apply_noise(image, filter_code, correct_periodicity=True, rng_seed=None, aperture_radius=None)[source]¶
Apply the configured imaging noise to one image.
- Parameters:
image (Image) – Image to which noise should be applied.
filter_code (str) – Filter code identifying which noise definition to use.
correct_periodicity (bool) – Whether to apply periodicity correction when generating correlated noise.
rng_seed (int, optional) – Seed used for stochastic noise generation.
aperture_radius (unyt_quantity, optional) – Aperture radius used by SNR/depth-based noise generation.
- Returns:
New image with noise applied.
- Return type:
- apply_noises(image_collection, correct_periodicity=True, rng_seed=None, aperture_radius=None)[source]¶
Apply the configured imaging noise to an image collection.
- Parameters:
image_collection (ImageCollection) – Collection to which noise should be applied.
correct_periodicity (bool) – Whether to apply periodicity correction when generating correlated noise.
rng_seed (int, optional) – Seed used for stochastic noise generation.
aperture_radius (unyt_quantity, optional) – Aperture radius used by SNR/depth-based noise generation.
- Returns:
New image collection with noise applied.
- Return type:
- apply_psf(image, filter_code, inplace=False)[source]¶
Apply the configured PSF to one image.
- Parameters:
image (Image) – Image to which the PSF should be applied.
filter_code (str) – Filter code identifying which PSF to use.
inplace (bool) – If
Trueupdateimagedirectly and return it. Otherwise return a new image.
- Returns:
New image with the PSF applied.
- Return type:
- Raises:
MissingArgument – If the instrument has no PSFs configured.
InconsistentArguments – If no PSF is defined for
filter_code.
- apply_psfs(image_collection, inplace=False)[source]¶
Apply the configured PSFs to an image collection.
- Parameters:
image_collection (ImageCollection) – Collection to which PSFs should be applied.
inplace (bool) – If
Trueupdateimage_collectiondirectly and return it. Otherwise return a new image collection.
- Returns:
New image collection with PSFs applied.
- Return type:
- Raises:
InconsistentArguments – If
psf_resample_factoris smaller than 1.
- property can_do_imaging¶
Return whether this instrument supports imaging.
- property can_do_noisy_imaging¶
Return whether this instrument supports noisy imaging.
- property can_do_psf_imaging¶
Return whether this instrument supports PSF imaging.
- generate_images(photometry, fov, img_type, kernel, kernel_threshold, nthreads, emitter, cosmo)[source]¶
Generate an image collection for one emitter.
- Parameters:
photometry (PhotometryCollection) – Photometry to project into the output images.
fov (unyt_quantity/tuple, unyt_quantity) – Width of the image.
img_type (str) – The type of image to create.
kernel (np.ndarray, optional) – Kernel used for smoothed particle imaging.
kernel_threshold (float) – Kernel impact-parameter threshold.
nthreads (int) – Number of threads to use for particle smoothing.
emitter (Component) – Emitter supplying geometry and source data.
cosmo (astropy.cosmology.Cosmology, optional) – Cosmology used for angular-image coordinate conversions.
- Returns:
The generated image collection.
- Return type:
Return the correlated-noise model for a filter.
- Parameters:
filter_code (str) – Filter code identifying the required model.
- Returns:
The correlated-noise model for the filter.
- Return type:
- property instrument_type¶
Return the serialised type tag for this instrument.
- classmethod load(filepath=None, **kwargs)[source]¶
Load a photometric imager from an HDF5 file.
- Parameters:
filepath (str or PathLike, optional) – Path to the HDF5 file. If omitted, subclasses may provide a cached default path.
**kwargs – Attribute overrides applied after deserialisation.
- Returns:
The loaded instrument.
- Return type: