UVES Pipeline Reference Manual  5.4.6
Functions
Bad pixel correction

Functions

static int uves_correct_badpix (cpl_image *master_bias, uves_propertylist *header, int **badmap, bool mark_bad)
 Correct bad pixels. More...
 
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. More...
 
void uves_badmap_free (int ***badmap)
 Deallocate bpm position. More...
 
static int ** dup_map (int badmap[][4])
 Copy bpm to heap. More...
 
int ** uves_get_badpix (enum uves_chip chip, int binx, int biny, int mark_bad, bool red_ccd_new)
 Get hard-coded bpm map. More...
 

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_biasThe image to correct
headerImage FITS header,
badmapMatrix 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_badIf 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 585 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_biasThe image to correct
mbias_headerImage FITS header,
chipCCD chip
binxx-binning
binyy-binning
mark_badIf 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 156 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
badmapto deallocate (pointer to 2d array)

Definition at line 184 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
badmapto copy
Returns
dynamically allocated copy of input

Definition at line 213 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
chipUVES CCD chip
binxx binning
binyy binning
mark_bada 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 256 of file uves_corrbadpix.c.

References dup_map().

Referenced by test_bad_corr(), and uves_correct_badpix_all().