ImageSampler¶
The ImageSampler
component attempts to reproduce the image acquired by a CCD assuming an intensity field given by an ImagePlane
object is placed in the entrance pupil of the optical model described by an OpticalModel
object, simulating the image produced by the instrument. The ImageSampler
is also in charge of translating the input intensity map into a flux map that can be used to integrate the image in the CCD.

-
class
ImageSampler
(plane, model)¶ Initializes the
ImageSampler
main object, from a given sky/maskImagePlane
as first argument andOpticalModel
as second argument. TheImageSampler
is set with a default oversampling value ofHARMONI_IMAGE_SAMPLER_OVERSAMPLIGN
(currently 8). Parallelization is set to true by default.-
set_oversampling
(oversampling)¶ Sets the oversampling value to
oversampling
. This operation triggers the precalculation of all intermediate data like the coordinate offset matrices and the CCD matrix.
-
set_geometry
(cols, rows, delta_x, delta_y, finv=1)¶ Sets the geometry of the CCD to
cols
columns wide,rows
rows tall, and with pixel sizesdelta_x
xdelta_y
, both in meters. The optional argumentfinv
establishes adjusts the plate scale between the last optical element in theOpticalModel
optics and the CCD.
-
set_parallel
(val)¶ Enables or disables parallelization according to the boolean value
val
.
-
integrate
()¶ Triggers integration of the sky intensity function passed to the constructor, in a serial or parallel fashion according to the current parallelization configuration. Returns a tuple with the following information, in order:
Number of slices of the CCD.
The mean computation time of each integration slice.
The standard deviation of the computation time of all slices.
Total integration time (in seconds).
TODO: specify integration time!
-
integrate_serial():
Force computation of all slices in one thread (equivalent to calling
integrate()
with parallelization disabled). No value is returned.
-
integrate_parallel():
Force computation of all slices in one thread (equivalent to calling
integrate()
with parallelization enabled). No value is returned.
-
save_to_file(path):
Saves the image produced by the CCD to an image file specified by
path
.
-