A simple script to test how to simulate CCD bleeding effects.
requires: | PyFITS |
---|---|
requires: | NumPy |
author: | Sami-Matias Niemi |
contact: | smn2@mssl.ucl.ac.uk |
Writes out a simple FITS file.
Parameters: |
|
---|---|
Returns: | None |
A simple script to convert Zemax text file output to FITS format. Copies the meta to the header.
requires: | PyFITS |
---|---|
requires: | NumPy |
version: | 0.1 |
author: | Sami-Matias Niemi |
contact: | s.niemi@ucl.ac.uk |
Converts Zemax output TXT file to FITS format. Stores the extra information from the Zemax output to the FITS header.
Parameters: |
|
---|---|
Returns: | None |
A simple script to generate a random location cosmetics map.
requires: | NumPy |
---|---|
author: | Sami-Matias Niemi |
contact: | s.niemi@ucl.ac.uk |
Generates a cosmetics catalogue with dead and hot pixels with random locations. The default numbers have been taken from MSSL/Euclid/TR/12003 Issue 2 Draft b.
Results are written to a CSV file.
Parameters: |
|
---|---|
Returns: | None |
This simple class can be used to include cosmic ray events to an image. By default the cosmic ray events are drawn from distributions describing the length and energy of the events. Such distributions can be generated for example using Stardust code (http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=04636917). The energy of the cosmic ray events can also be set to constant for testing purposes. The class can be used to draw a single cosmic ray event or up to a covering fraction.
requires: | NumPy |
---|---|
requires: | SciPy |
version: | 0.2 |
author: | Sami-Matias Niemi |
contact: | s.niemi@ucl.ac.uk |
Cosmic ray generation class. Can either draw events from distributions or set the energy of the events to a constant.
Parameters: |
|
---|
Include cosmic rays to the image given.
Returns: | image with cosmic rays |
---|---|
Return type: | ndarray |
Include a single cosmic ray event to the image given.
Returns: | image with cosmic rays |
---|---|
Return type: | ndarray |
Add cosmic ray events up to the covering Fraction.
Parameters: |
|
---|---|
Returns: | image with cosmic rays |
Return type: | ndarray |
Basic image manipulation algorithms such as Gaussian smoothing and free rebinning.
requires: | NumPy |
---|---|
requires: | SciPy |
author: | Sami-Matias Niemi |
contact: | sniemi@unc.edu |
version: | 0.1 |
blurs the image by convolving with a gaussian kernel of typical size np. The optional keyword argument ny allows for a different size in the y direction.
Arbitrary resampling of source array to new dimension sizes. Currently only supports maintaining the same number of dimensions. To use 1-D arrays, first promote them to shape (x,1).
Uses the same parameters and creates the same co-ordinate lookup points as IDL’’s congrid routine, which apparently originally came from a VAX/VMS routine of the same name.
method: neighbour - closest value from original data nearest and linear - uses n x 1-D interpolations using scipy.interpolate.interp1d (see Numerical Recipes for validity of use of n 1-D interpolations) spline - uses ndimage.map_coordinates
centre: True - interpolation points are at the centres of the bins False - points are at the front edge of the bin
minusone: For example- inarray.shape = (i,j) & new dimensions = (x,y) False - inarray is resampled by factors of (i/x) * (j/y) True - inarray is resampled by(i-1)/(x-1) * (j-1)/(y-1) This prevents extrapolation one element beyond bounds of input array.
Shrink or expand the size of an array an arbitary amount using interpolation. Conserves flux by ensuring that each input pixel is equally represented in the output array.
Todo
one could do the binning faster if old and new outputs are modulo 0
Note
modelled after the IDL code frebin.pro, so this may not be the fastest solution
Parameters: |
|
---|---|
Returns: | binned array |
Return type: | ndarray |
Returns a normalized 2D gauss kernel array for convolutions.
rebin ndarray data into a smaller ndarray of the same rank whose dimensions are factors of the original dimensions. eg. An array with 6 columns and 4 rows can be reduced to have 6,3,2 or 1 columns and 4,2 or 1 rows. example usages: >>> a=rand(6,4); b=rebin(a,3,2) >>> a=rand(6); b=rebin(a,2)