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 PhotometricInstrument with 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:

Image

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:

ImageCollection

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 True update image directly and return it. Otherwise return a new image.

Returns:

New image with the PSF applied.

Return type:

Image

Raises:
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 True update image_collection directly and return it. Otherwise return a new image collection.

Returns:

New image collection with PSFs applied.

Return type:

ImageCollection

Raises:

InconsistentArguments – If psf_resample_factor is 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:

ImageCollection

get_correlated_noise_model(filter_code)[source]

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:

CorrelatedNoiseModel

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:

PhotometricImager

to_hdf5(group)[source]

Write the photometric imager to an HDF5 group.

Parameters:

group (h5py.Group) – Group into which the instrument should be serialised.