Bad pixel correction

Functions

static int uves_correct_badpix (cpl_image *master_bias, uves_propertylist *header, int **badmap, bool mark_bad)
 Correct bad pixels.
int uves_correct_badpix_all (cpl_image *master_bias, uves_propertylist *mbias_header, enum uves_chip chip, int binx, int biny, int mark_bad, bool red_ccd_new)
 Correct all bad pixels on a chip.
void uves_badmap_free (int ***badmap)
 Deallocate bpm position.
static int ** dup_map (int badmap[][4])
 Copy bpm to heap.
int ** uves_get_badpix (enum uves_chip chip, int binx, int biny, int mark_bad, bool red_ccd_new)
 Get hard-coded bpm map.

Detailed Description

Correct the bad pixels in an image


Function Documentation

static int uves_correct_badpix ( cpl_image *  master_bias,
uves_propertylist header,
int **  badmap,
bool  mark_bad 
) [static]

Correct bad pixels.

Parameters:
master_bias The image to correct
header Image FITS header,
badmap Matrix of bad pixel traps. Each row is in the format (xstart, ystart, xend, yend), except the last row which must be (-1, -1, -1, -1).
mark_bad If true, the relevant pixels are not interpolated but simply marked as bad.
Returns:
Number of pixels that was corrected, or undefined on error.

The bad pixels are replaced by the average of nearest good pixels in the same column.

Definition at line 588 of file uves_corrbadpix.c.

References check, uves_msg, uves_pfits_set_badpixcorr(), and uves_tostring_cpl_type().

Referenced by uves_correct_badpix_all().

int uves_correct_badpix_all ( cpl_image *  master_bias,
uves_propertylist mbias_header,
enum uves_chip  chip,
int  binx,
int  biny,
int  mark_bad,
bool  red_ccd_new 
)

Correct all bad pixels on a chip.

Parameters:
master_bias The image to correct
mbias_header Image FITS header,
chip CCD chip
binx x-binning
biny y-binning
mark_bad If true, the relevant pixels are not interpolated but simply marked as bad.
Returns:
Number of pixels that was corrected, or undefined on error.

The bad pixels are replaced by the average of nearest good pixels in the same column, or simply marked as bad.

The positions of bad pixels are hard-coded (as function of UVES chip).

Definition at line 159 of file uves_corrbadpix.c.

References check, uves_badmap_free(), uves_correct_badpix(), and uves_get_badpix().

Referenced by test_bad_corr(), and uves_reduce_scired().

void uves_badmap_free ( int ***  badmap  ) 

Deallocate bpm position.

Parameters:
badmap to deallocate (pointer to 2d array)

Definition at line 187 of file uves_corrbadpix.c.

Referenced by test_bad_corr(), and uves_correct_badpix_all().

static int** dup_map ( int  badmap[][4]  )  [static]

Copy bpm to heap.

Parameters:
badmap to copy
Returns:
dynamically allocated copy of input

Definition at line 216 of file uves_corrbadpix.c.

Referenced by uves_get_badpix().

int** uves_get_badpix ( enum uves_chip  chip,
int  binx,
int  biny,
int  mark_bad,
bool  red_ccd_new 
)

Get hard-coded bpm map.

Parameters:
chip UVES CCD chip
binx x binning
biny y binning
mark_bad a strange parameter, if true, a few more regions are marked as bad (for compatibility with MIDAS)
Returns:
dynamically allocated array of bad pixel areas, must be deallocated with uves_badmap_free()

The array is terminated with a row of -1

Definition at line 259 of file uves_corrbadpix.c.

References dup_map().

Referenced by test_bad_corr(), and uves_correct_badpix_all().


Generated on 8 Mar 2011 for UVES Pipeline Reference Manual by  doxygen 1.6.1