Instrument

class simsit.instrument.Instrument(*, image_shape, gain, read_noise, pixel_scale, aperture, obscuration=0.0, distortion=None, vignetting=None)

Bases: object

Instrument model describing detector geometry, noise, and optical response.

Parameters

image_shapetuple of int

Image dimensions (nx, ny) in pixels.

gainfloat

Detector gain in electrons per ADU.

read_noisefloat

Read noise in electrons.

pixel_scalefloat

Physical pixel size in microns.

aperturefloat

Telescope aperture diameter in meters.

obscurationfloat, optional

Linear fractional obscuration.

distortiondict, optional

Optical distortion model with keys:

  • "th": field angle in degrees

  • "dthdr": plate scale in arcsec/micron

vignettingdict, optional

Vignetting model with keys:

  • "th": field angle in degrees

  • "unvig": surviving fraction of photons

Attributes Summary

field_radius

This decorator will act similarly to @property, but will be efficient for multiple access to values that require some significant calculation.

pix_size

This decorator will act similarly to @property, but will be efficient for multiple access to values that require some significant calculation.

Methods Summary

apply_noise(image, sky_phot, rng)

Add CCD noise to an image in place.

apply_vignetting(image)

Apply vignetting to an image in place.

compute_lsst_scaled_zp()

Compute a zeropoint by scaling an LSST i-band reference value.

compute_scaled_zp(reference_area, reference_zp)

Scale a reference photometric zeropoint by collecting area.

fromConfig()

Create an Instrument from a configuration dictionary.

from_config(config)

Create an Instrument from a configuration dictionary.

get_wcs(boresight, rot_sky_pos)

Construct a WCS for the instrument.

init_image(*, sky_phot, exptime)

Initialize an image with sky background.

streak_snr(*, nphot, length, psf_fwhm, sky_phot)

Compute the signal-to-noise ratio for a linear streak.

Attributes Documentation

field_radius

This decorator will act similarly to @property, but will be efficient for multiple access to values that require some significant calculation.

It works by replacing the attribute with the computed value, so after the first access, the property (an attribute of the class) is superseded by the new attribute of the instance.

Note that is should only be used for non-mutable data, since the calculation will not be repeated if anything about the instance changes.

Usage:

@lazy_property
def slow_function_to_be_used_as_a_property(self):
    x =  ...  # Some slow calculation.
    return x

Base on an answer from http://stackoverflow.com/a/6849299

pix_size

This decorator will act similarly to @property, but will be efficient for multiple access to values that require some significant calculation.

It works by replacing the attribute with the computed value, so after the first access, the property (an attribute of the class) is superseded by the new attribute of the instance.

Note that is should only be used for non-mutable data, since the calculation will not be repeated if anything about the instance changes.

Usage:

@lazy_property
def slow_function_to_be_used_as_a_property(self):
    x =  ...  # Some slow calculation.
    return x

Base on an answer from http://stackoverflow.com/a/6849299

Methods Documentation

apply_noise(image, sky_phot, rng)

Add CCD noise to an image in place.

Parameters

imagegalsim.Image

Image to modify.

sky_photfloat

Sky level in photons / arcsec^2 / sec.

rngnumpy.random.Generator

Random number generator.

apply_vignetting(image)

Apply vignetting to an image in place.

Parameters

imagegalsim.Image

Image to modify.

compute_lsst_scaled_zp()

Compute a zeropoint by scaling an LSST i-band reference value.

Returns

float

Approximate photometric zeropoint in AB magnitudes.

Notes

This helper is retained for backward compatibility and uses an LSST i-band reference value. For general use, prefer compute_scaled_zp.

compute_scaled_zp(reference_area, reference_zp)

Scale a reference photometric zeropoint by collecting area.

Parameters

reference_areafloat

Reference collecting area in square meters.

reference_zpfloat

Reference zeropoint expressed as electrons/sec for a source of fixed reference magnitude 24 AB.

Returns

float

Zeropoint in AB magnitudes such that an object of magnitude zp produces 1 photon/sec.

Notes

This assumes throughput is otherwise unchanged and only collecting area is rescaled.

fromConfig()

Create an Instrument from a configuration dictionary.

Parameters

configdict

Instrument configuration dictionary.

Returns

Instrument

Configured instrument instance.

static from_config(config)

Create an Instrument from a configuration dictionary.

Parameters

configdict

Instrument configuration dictionary.

Returns

Instrument

Configured instrument instance.

get_wcs(boresight, rot_sky_pos)

Construct a WCS for the instrument.

Parameters

boresightgalsim.CelestialCoord

Telescope pointing direction.

rot_sky_posgalsim.Angle

Position angle of detector up relative to north.

Returns

galsim.GSFitsWCS

World coordinate system.

init_image(*, sky_phot, exptime)

Initialize an image with sky background.

Parameters

sky_photfloat

Sky level in photons / arcsec^2 / sec.

exptimefloat

Exposure time in seconds.

Returns

galsim.Image

Image initialized with sky background.

streak_snr(*, nphot, length, psf_fwhm, sky_phot)

Compute the signal-to-noise ratio for a linear streak.

Parameters

nphotarray-like or float

Number of photons in the streak.

lengthfloat

Streak length in arcseconds.

psf_fwhmfloat

PSF full width at half maximum in arcseconds.

sky_photfloat

Sky level in photons / arcsec^2 / sec.

Returns

array-like or float

Streak signal-to-noise ratio.