This file provides a class to insert instrument specific features to a simulated image. The VIS instrument model is taken from support.VISinstrumentModel.VISinformation function.
The class supports multiprocessing.
Note
The output images will be compressed with gzip to save disk space.
Warning
The logging module used does not work well with multiprocessing, but starts to write multiple entries after a while. This should be fixed.
requires: | PyFITS |
---|---|
requires: | NumPy |
requires: | CDM03 (FORTRAN code, f2py -c -m cdm03 cdm03.f90) |
author: | Sami-Matias Niemi |
contact: | smn2@mssl.ucl.ac.uk |
version: | 0.9 |
Euclid Visible Instrument postprocessing class. This class allows to add radiation damage (as defined by the CDM03 model) and add readout noise to a simulated image.
Applies a linear correction after one forward readout through the CDM03 model.
Bristow & Alexov (2003) algorithm further developed for HST data processing by Massey, Rhodes et al.
Parameters: | image (ndarray) – radiation damaged image |
---|---|
Returns: | corrected image after single forward readout |
Return type: | ndarray |
Apply radian damage based on FORTRAN CDM03 model. The method assumes that input data covers only a single quadrant defined by the iquadrant integer.
Parameters: |
|
---|
Note
Because Python/NumPy arrays are different row/column based, one needs to be extra careful here. NumPy.asfortranarray will be called to get an array laid out in Fortran order in memory. Before returning the array will be laid out in memory in C-style (row-major order).
Returns: | image that has been run through the CDM03 model |
---|---|
Return type: | ndarray |
Applies readout noise. The noise is drawn from a Normal (Gaussian) distribution. Mean = 0.0, and std = readout.
Parameters: | data (ndarray) – input data to which the readout noise will be added to |
---|---|
Returns: | updated data, noise image |
Return type: | dict |
This method compresses the given file using gzip and removes the parent from the file system.
Parameters: | filename (str) – name of the file to be compressed |
---|---|
Returns: | None |
Cuts out a region from the imaging data. The cutout region is specified by xstart/stop and ystart/stop that are read out from the self.values dictionary. Also checks if there are values that are above the given cutoff value and sets those pixels to a max value (default=33e3).
Parameters: |
|
---|---|
Returns: | cut out image from the original data |
Return type: | ndarray |
Convert floating point arrays to integer arrays and convert to ADUs. Adds bias level after converting to ADUs.
Parameters: | data (ndarray) – data to be discretised to. |
---|---|
Returns: | discretised array in ADUs |
Return type: | ndarray |
Calculates a map showing the CTI effect. This map is being generated by dividing radiation damaged image with the original data.
Parameters: |
|
---|---|
Returns: | CTI map (ratio of radiation damaged image and original data) |
Return type: | ndarray |
Loads data from a given FITS file and extension.
Parameters: |
|
---|---|
Returns: | data, FITS header, xsize, ysize |
Return type: | dict |
This routine allows the whole CCD to be run through a radiation damage mode. The routine takes into account the fact that the amplifiers are in the corners of the CCD. The routine assumes that the CCD is using four amplifiers.
Parameters: |
|
---|---|
Returns: | radiation damaged image |
Return type: | ndarray |
This is the method that will be called when multiprocessing.
Write out FITS files using PyFITS.
Parameters: |
|
---|---|
Returns: | None |
This file contains a class to create a single VIS CCD image from separate files one for each quadrant.
requires: | NumPy |
---|---|
requires: | PyFITS |
author: | Sami-Matias Niemi |
contact: | s.niemi@ucl.ac.uk |
To execute:
python tileCCD.py -f 'Q*science.fits' -e 1
where -f argument defines the input files to be tiled and the -e argument marks the FITS extension from which the imaging data are being read.
version: | 0.5 |
---|
Todo
Class to create a single VIS CCD image from separate quadrants files.
Reads in data from all the input files and the header from the first file. Input files are taken from the input dictionary given when class was initiated.
Subtracts the pre- and overscan regions if these were simulated. Takes into account which quadrant is being processed so that the extra regions are subtracted correctly.
Wrapper to perform all class methods.
Tiles quadrants to form a single CCD image.
Assume that the input file naming convention is Qx_CCDX_CCDY_name.fits.
Parameters: |
|
---|---|
Returns: | image array of size (ysize*2, xsize*2) |
Return type: | ndnarray |
Write out FITS files using PyFITS.
Parameters: |
|
---|---|
Returns: | None |
This file contains a class to create a single VIS FPA image from separate files one for each CCD.
requires: | NumPy |
---|---|
requires: | PyFITS |
author: | Sami-Matias Niemi |
contact: | s.niemi@ucl.ac.uk |
To execute:
python tileFPA.py -f 'CCD*science.fits' -e 1
where -f argument defines the input files to be tiled and the -e argument marks the FITS extension from which the imaging data are being read.
version: | 0.1 |
---|
Class to create a single VIS FPA image from separate CCD files.
Reads in data from all the input files and the header from the first file. Input files are taken from the input dictionary given when class was initiated.
Subtracts the pre- and overscan regions if these were simulated. Takes into account which quadrant is being processed so that the extra regions are subtracted correctly.
Wrapper to perform all class methods.
Tiles quadrants to form a single CCD image.
Assume that the input file naming convention is Qx_CCDX_CCDY_name.fits.
Parameters: |
|
---|---|
Returns: | FPA image array |
Return type: | ndnarray |
Write out FITS files using PyFITS.
Parameters: |
|
---|---|
Returns: | None |