Camera

class cometsuite.instruments.Camera(*, size=(1024, 1024), cdelt=(-1, 1), crval=None, crpix=None, wcs=None, fitsheader=None, scaler=None, normalizer=None, axes=None, bins=None, range=None)

Bases: Instrument

A CometSuite instrument that only takes images of the sky.

Use the integrate() method to convert simulation sky coordinates to pixel coordinates.

Example usage:

camera = Camera()
camera = Camera(size=size, cdelt=cdelt, [crval=], [crpix=])
camera = Camera(wcs=wcs, [size=])
camera = Camera(fitsheader=h)

Note

Take care: the WCS parameters are (x, y) and use 1-based indexing.

Parameters:
sizearray, optional

The x, y size of the camera array. [pixels]

cdeltarray, optional

The x, y pixel scale of the camera. [arcsec/pixel]

crvalarray, optional

The center of the field of view in world coordinates (RA, Dec). If None, the FOV will be centered on the target when the first simulation is observed. [degrees]

crpixarray, optional

Place the coordinates crval on this x, y pixel, 1-based index (FITS convention).

wcsastropy.wcs.WCS, optional

The WCS of the image. Requires size.

fitsheaderastropy.io.fits.Header, optional

Get the WCS from this FITS header.

scalerScaler or CompositeScaler, optional

A particle scaler.

normalizerScaler or CompositeScaler, optional

Use this scaling function for computing the normalization array n.

axesarray, optional

Additional axes to add to the camera. The first two axes will always be ‘y’ and ‘x’. See Instrument for details.

binsarray, optional

Specify the bins for the additional axes. See Instrument for details.

rangearray, optional

Specify the range for the additional axes. See Instrument for details.

Attributes:
nndarray

The normalization array, which is by default the number of particles per pixel.

datandarray

The observation data.

Methods Summary

integrate(sim[, reobserve])

Integrate array on a simulation.

sky2xy(sim)

Compute a simulation's particle's xy coordinates.

write(filename[, normalized])

Write a FITS file, complete with WCS.

Methods Documentation

integrate(sim, reobserve=True)

Integrate array on a simulation.

Parameters:
simSimulation

The simulation to observe. If array_coords is not defined, it will be updated.

reobservebool, optional

Force an update of the simulation’s x, y particle positions.

sky2xy(sim)

Compute a simulation’s particle’s xy coordinates.

Coordinates are saved to sim.array_coords.

write(filename, normalized=False, **keywords)

Write a FITS file, complete with WCS.

2 extensions are saved:

[0] The data (possibly normalized) [1] The number of particles per pixel.

Parameters:
filenamestring

The file name.

normalizedbool

Set to True to save normalized data.

**keywords

fits.HDUList.writeto() keywords.