EffectiveApertureInstrument

class nyx.instrument.effective_aperture.EffectiveApertureInstrument[source]

Bases: InstrumentModel

An instrument whose pixels have a centre, a throughput weight and a bandpass.

The response is a fixed table on a shared PixelLattice, as produced by an iactrace ray-tracing scan. Build one with from_iactrace_table() from a saved scan, or from_iactrace() to scan from scratch.

Trainable in efficiency, pixel_efficiency, shift and rotation, the last two per observation, and in misalignment_lon and misalignment_lat when that option is switched on. The forward model uses efficiency * pixel_efficiency[i], so the first two are degenerate: freeze one before fitting for a unique MLE.

Build the instrument.

Parameters:
  • geo (Geometry)

  • bandpass (callable) – Maps a wavelength Quantity to transmission.

  • grid (array-like, shape (n_pixels, 2, grid_dim), or PixelLattice) – Pixel sub-grid coordinates in radians, from which the shared response lattice is recovered; or that lattice directly.

  • values (array-like, shape (n_pixels, grid_dim, grid_dim)) – Pixel response at the sub-grid points, of the aligned optics.

  • misalignment (float, pair of floats, or None) – Initial facet tilt RMS in arcseconds, one value or one per axis as [lon, lat]. None means no misalignment.

Attributes Summary

bandpass

Spectral transmission curve, shape (n_wvl,), excluding efficiency.

bandpass_values

blur

Misalignment blur width in lattice nodes, [lon, lat], or None.

centers

Pixel centres in the offset frame, shape (n_pix, 2); precomputed.

efficiency

grid

Per-pixel response sample coordinates, shape (n_pix, 2, grid_dim).

lattice

misalignment_lat

misalignment_lon

pixel_efficiency

pixel_values

Pixel response values, shape (n_pix, grid_dim, grid_dim).

rotation

shift

weight

Simpson-integrated pixel weight, shape (n_pix,).

Methods Summary

corrected_pm(pm)

Pointing matrix corrected for shift and rotation.

from_iactrace(geo, telescope, camera, *, ...)

Build an instrument by ray-tracing an iactrace telescope and camera.

from_iactrace_table(geo, table, *[, ...])

Build an instrument from an already-scanned effective-aperture table.

project_catalog(source_coords, source_fluxes)

Project point sources onto pixels, blurred by any misalignment.

project_diffuse(hp_values, pm)

Sample a band-integrated HEALPix sky at each pixel.

project_scattered(eval_grid_values)

Sample the FOV scattering grid at each pixel.

Attributes Documentation

bandpass

Spectral transmission curve, shape (n_wvl,), excluding efficiency.

bandpass_values = <dataclasses._MISSING_TYPE object>
blur

Misalignment blur width in lattice nodes, [lon, lat], or None.

centers

Pixel centres in the offset frame, shape (n_pix, 2); precomputed.

efficiency = <dataclasses._MISSING_TYPE object>
grid

Per-pixel response sample coordinates, shape (n_pix, 2, grid_dim).

lattice = <dataclasses._MISSING_TYPE object>
misalignment_lat = <dataclasses._MISSING_TYPE object>
misalignment_lon = <dataclasses._MISSING_TYPE object>
pixel_efficiency = <dataclasses._MISSING_TYPE object>
pixel_values

Pixel response values, shape (n_pix, grid_dim, grid_dim).

rotation = <dataclasses._MISSING_TYPE object>
shift = <dataclasses._MISSING_TYPE object>
weight

Simpson-integrated pixel weight, shape (n_pix,).

Methods Documentation

corrected_pm(pm)[source]

Pointing matrix corrected for shift and rotation.

Parameters:

pm (jax.Array, shape (3, 3))

Return type:

jax.Array, shape (3, 3)

classmethod from_iactrace(geo, telescope, camera, *, half_angle, step, wvls, window=None, chunk_size=256, progress=False, misalignment=None, **scan_kwargs)[source]

Build an instrument by ray-tracing an iactrace telescope and camera.

Needs the optional nyx[iactrace] dependency.

Parameters:
  • geo (Geometry)

  • telescope (iactrace.Telescope)

  • camera (iactrace.Camera)

  • half_angle (float) – Half-width of the field to scan, in radians; must clear the camera radius over the focal length.

  • step (float) – Field-angle lattice spacing, in radians; around an eighth of the angular pixel pitch resolves a pixel response.

  • wvls (array-like) – Wavelength grid in nm the bandpass is tabulated on.

  • window (int or None) – Side length of each pixel’s response window, in nodes; None measures it.

  • chunk_size (int) – Field directions traced per render call.

  • progress (bool) – Whether to print scan progress to stderr.

  • misalignment (float, pair of floats, or None) – Initial facet blur model in arcseconds.

  • **scan_kwargs – Anything else iactrace.analysis.effective_aperture() takes.

Return type:

EffectiveApertureInstrument

classmethod from_iactrace_table(geo, table, *, misalignment=None)[source]

Build an instrument from an already-scanned effective-aperture table.

Parameters:
  • geo (Geometry)

  • table (path-like or EffectiveApertureTable) – A .npz file written by iactrace.io.save_aperture_table.

  • misalignment (float, pair of floats, or None) – Initial facet tilt RMS in arcseconds.

Return type:

EffectiveApertureInstrument

project_catalog(source_coords, source_fluxes)[source]

Project point sources onto pixels, blurred by any misalignment.

Parameters:
  • source_coords (jax.Array, shape (n_sources, 2)) – Offset-frame coordinates, already in the detector frame.

  • source_fluxes (jax.Array, shape (n_sources,)) – Already band-integrated and extincted by the render pipeline.

Return type:

jax.Array, shape (n_pixels,)

project_diffuse(hp_values, pm)[source]

Sample a band-integrated HEALPix sky at each pixel.

Parameters:
Return type:

jax.Array, shape (n_pixels,)

project_scattered(eval_grid_values)[source]

Sample the FOV scattering grid at each pixel.

Parameters:

eval_grid_values (jax.Array, shape (n_lon, n_lat))

Return type:

jax.Array, shape (n_pixels,)

__init__(geo, bandpass, grid, values, *, misalignment=None)[source]

Build the instrument.

Parameters:
  • geo (Geometry)

  • bandpass (callable) – Maps a wavelength Quantity to transmission.

  • grid (array-like, shape (n_pixels, 2, grid_dim), or PixelLattice) – Pixel sub-grid coordinates in radians, from which the shared response lattice is recovered; or that lattice directly.

  • values (array-like, shape (n_pixels, grid_dim, grid_dim)) – Pixel response at the sub-grid points, of the aligned optics.

  • misalignment (float, pair of floats, or None) – Initial facet tilt RMS in arcseconds, one value or one per axis as [lon, lat]. None means no misalignment.

static __new__(cls, *args, **kwargs)