MUSE Pipeline Reference Manual
2.1.1
|
Functions | |
cpl_error_code | muse_quadrants_overscan_stats (muse_image *aImage, const char *aRejection, unsigned int aIgnore) |
Compute overscan statistics of all quadrants and save in FITS header. More... | |
cpl_boolean | muse_quadrants_overscan_check (muse_image *aImage, muse_image *aRefImage, double aSigma) |
Compare overscan statistics of all quadrants to those of reference image. More... | |
cpl_error_code | muse_quadrants_overscan_correct (muse_image *aImage, muse_image *aRefImage) |
Adapt bias level to reference image using overscan statistics. More... | |
cpl_error_code | muse_quadrants_overscan_polyfit_vertical (muse_image *aImage, unsigned aIgnore, unsigned char aOrder, double aSigma, const double aFRMS, double aFChiSq) |
Correct quadrants by polynomial representation of vertical overscan. More... | |
cpl_size * | muse_quadrants_overscan_get_window (const muse_image *aImage, unsigned char aQuadrant, unsigned int aIgnore) |
Determine the overscan windows of a given quadrant on the CCD. More... | |
muse_image * | muse_quadrants_trim_image (muse_image *aImage) |
Trim the input image of pre- and over-scan regions of all quadrants. More... | |
cpl_error_code | muse_quadrants_coords_to_raw (cpl_propertylist *aHeader, int *aX, int *aY) |
Convert coordinates of a trimmed image to raw-image coordinates. More... | |
cpl_boolean | muse_quadrants_verify (cpl_propertylist *aHeader) |
Verify that quadrant locations and sizes meet the expectations. More... | |
cpl_size * | muse_quadrants_get_window (const muse_image *aImage, unsigned char aQuadrant) |
Determine the data window of a given quadrant on the CCD. More... | |
This group of functions handles regions on the CCDs, like quadrants, pre- and overscans, trimming of the pre- and overscans, and overscan statistics.
cpl_error_code muse_quadrants_coords_to_raw | ( | cpl_propertylist * | aHeader, |
int * | aX, | ||
int * | aY | ||
) |
Convert coordinates of a trimmed image to raw-image coordinates.
aHeader | list of FITS headers to check |
aX | the horizontal position |
aY | the vertical position |
return CPL_ERROR_NULL_INPUT | both aX and aY are NULL |
assume standard layout | aHeader is NULL |
Definition at line 958 of file muse_quadrants.c.
Referenced by muse_pixtable_dump(), muse_quality_convert_dq(), and muse_resampling_params_delete().
cpl_size* muse_quadrants_get_window | ( | const muse_image * | aImage, |
unsigned char | aQuadrant | ||
) |
Determine the data window of a given quadrant on the CCD.
aImage | muse_image that holds the necessary data |
aQuadrant | the quadrant number |
The returned window array contains four values, in the order xmin, xmax, ymin, ymax. It has to be deallocated using cpl_free() after use. For both trimmed and untrimmed data, the coordinates give the image window containing the data part of the quadrant, i.e. excluding pre- and overscans.
return CPL_ERROR_NULL_INPUT | if aImage or its data or header component are NULL |
return CPL_ERROR_ILLEGAL_INPUT | an invalid quadrant number was given (>4 or < 1) |
Definition at line 1074 of file muse_quadrants.c.
References muse_image::data, muse_image::header, muse_pfits_get_binx(), muse_pfits_get_biny(), muse_pfits_get_out_nx(), muse_pfits_get_out_ny(), muse_pfits_get_out_overscan_x(), muse_pfits_get_out_overscan_y(), muse_pfits_get_out_prescan_x(), and muse_pfits_get_out_prescan_y().
Referenced by muse_basicproc_params_delete(), muse_image_adu_to_count(), muse_image_variance_create(), muse_imagelist_compute_ron(), muse_quadrants_overscan_correct(), muse_quality_bad_columns(), muse_quality_dark_badpix(), and muse_trace_horizontal_cut().
cpl_boolean muse_quadrants_overscan_check | ( | muse_image * | aImage, |
muse_image * | aRefImage, | ||
double | aSigma | ||
) |
Compare overscan statistics of all quadrants to those of reference image.
aImage | muse_image that holds the header to check |
aRefImage | muse_image that holds the header to use as reference |
aSigma | sigma to use for overscan comparison |
set CPL_ERROR_NULL_INPUT, return CPL_FALSE | if aImage or aRefImage or their header components are NULL |
Definition at line 309 of file muse_quadrants.c.
References muse_image::header.
Referenced by muse_basicproc_params_delete().
cpl_error_code muse_quadrants_overscan_correct | ( | muse_image * | aImage, |
muse_image * | aRefImage | ||
) |
Adapt bias level to reference image using overscan statistics.
aImage | muse_image to be corrected |
aRefImage | muse_image that holds the header to use as reference |
This offsets the data values of aImage according to the mean overscan level difference between aImage and aRefImage. The variance of aImage is adjusted using the standard deviation of the overscan values of both images.
return CPL_ERROR_NULL_INPUT | if aImage or aRefImage or their header components are NULL |
Definition at line 363 of file muse_quadrants.c.
References muse_image::data, muse_image::header, muse_pfits_get_gain(), muse_quadrants_get_window(), and muse_image::stat.
Referenced by muse_basicproc_params_delete().
cpl_size* muse_quadrants_overscan_get_window | ( | const muse_image * | aImage, |
unsigned char | aQuadrant, | ||
unsigned int | aIgnore | ||
) |
Determine the overscan windows of a given quadrant on the CCD.
aImage | muse_image that holds the necessary data |
aQuadrant | the quadrant number |
aIgnore | number of pixels to ignore at the inner edge of the overscans |
The returned window array contains eight values, in the order xmin, xmax, ymin, ymax for the horizontal overscan region (indices 0 - 3), and then xmin, xmax, ymin, ymax for the vertical overscan region (indices 4 - 7). The small square where both overscans overlap is counted as part of the vertical overscan.
The returned array has to be deallocated using cpl_free() after use.
Since trimmed data does not contain header entries about pre- and overscans any more, such data will is incompatible input and will be rejected.
set CPL_ERROR_NULL_INPUT, return NULL | if aImage or its data or header component are NULL |
set CPL_ERROR_ILLEGAL_INPUT, return NULL | an invalid quadrant number was given (>4 or <1) |
set CPL_ERROR_INCOMPATIBLE_INPUT, return NULL | one of the quadrant parameters is missing or non-positive, or unexpected output port position was found in aImage |
set CPL_ERROR_ILLEGAL_INPUT, return NULL | aIgnore as large as the horizontal overscan width or larger |
Definition at line 686 of file muse_quadrants.c.
References muse_image::data, muse_image::header, muse_pfits_get_binx(), muse_pfits_get_biny(), muse_pfits_get_out_nx(), muse_pfits_get_out_ny(), muse_pfits_get_out_output_x(), muse_pfits_get_out_output_y(), muse_pfits_get_out_overscan_x(), muse_pfits_get_out_overscan_y(), muse_pfits_get_out_prescan_x(), and muse_pfits_get_out_prescan_y().
Referenced by muse_quadrants_overscan_polyfit_vertical(), and muse_quadrants_overscan_stats().
cpl_error_code muse_quadrants_overscan_polyfit_vertical | ( | muse_image * | aImage, |
unsigned | aIgnore, | ||
unsigned char | aOrder, | ||
double | aSigma, | ||
const double | aFRMS, | ||
double | aFChiSq | ||
) |
Correct quadrants by polynomial representation of vertical overscan.
aImage | muse_image to be corrected |
aIgnore | number of pixels to ignore at the inner edge of the overscans |
aOrder | maximum polynomial order to use |
aSigma | rejection sigma level for the iterative fit |
aFRMS | improvement limit in RMS |
aFChiSq | improvement limit in chi**2 |
This function modifies the input image (the data component) and the header, trying to remove possible large-scale vertical bias structure. The steps involved are:
return CPL_ERROR_NULL_INPUT | aImage or its data, dq, or header components are NULL |
return CPL_ERROR_ILLEGAL_INPUT | aFRMS and/or aFChiSq are not > 1. |
return CPL_ERROR_BAD_FILE_FORMAT | the quadrant layout in aImage is non-standard, i.e. muse_quadrants_verify() fails |
return CPL_ERROR_INCOMPATIBLE_INPUT | one of the quadrant 1 parameters is missing from aImage or non-positive |
return CPL_ERROR_ILLEGAL_INPUT | getting overscan regions, i.e. muse_quadrants_overscan_get_window() fails, possibly due to too large aIgnore |
return CPL_ERROR_INCOMPATIBLE_INPUT | unexpected output port position in aImage |
Definition at line 461 of file muse_quadrants.c.
References muse_image::data, muse_image::dq, muse_image::header, muse_pfits_get_binx(), muse_pfits_get_biny(), muse_pfits_get_out_nx(), muse_pfits_get_out_ny(), muse_pfits_get_out_output_x(), muse_pfits_get_out_output_y(), muse_pfits_get_out_overscan_x(), muse_pfits_get_out_overscan_y(), muse_pfits_get_out_prescan_x(), muse_pfits_get_out_prescan_y(), muse_quadrants_overscan_get_window(), muse_quadrants_verify(), muse_utils_get_ifu(), and muse_utils_iterate_fit_polynomial().
Referenced by muse_basicproc_params_delete().
cpl_error_code muse_quadrants_overscan_stats | ( | muse_image * | aImage, |
const char * | aRejection, | ||
unsigned int | aIgnore | ||
) |
Compute overscan statistics of all quadrants and save in FITS header.
aImage | muse_image that holds the image and header to work on |
aRejection | rejection method (and possibly parameters) |
aIgnore | number of pixels to ignore at the inner edge of the overscans |
Recognized aRejection methods are "none", "dcr" and "fit". aRejection may also contain more parameters for the respective type. Parameters to "none" are ignored. For "dcr" three unsigned integers and one float can be passed, like "dcr:128,32,3,2.5" (two box sizes, the number of passes, and the sigma threshold). For "fit" one float can be passed, like "fit:4.0" (the iterative rejection sigma).
return CPL_ERROR_NULL_INPUT | if aImage or its data or header component are NULL |
return CPL_ERROR_BAD_FILE_FORMAT | section sizes are not equal for all quadrants |
return CPL_ERROR_ILLEGAL_INPUT | FITS headers are missing required keywords or aIgnore as large as the horizontal overscan width or larger |
Definition at line 79 of file muse_quadrants.c.
References muse_image::data, muse_image::dq, muse_image::header, muse_cosmics_dcr(), muse_image_delete(), muse_image_new(), muse_pfits_get_binx(), muse_pfits_get_biny(), muse_pfits_get_out_nx(), muse_pfits_get_out_ny(), muse_pfits_get_out_overscan_x(), muse_pfits_get_out_overscan_y(), muse_quadrants_overscan_get_window(), muse_quadrants_verify(), muse_utils_iterate_fit_polynomial(), and muse_image::stat.
Referenced by muse_basicproc_params_delete().
muse_image* muse_quadrants_trim_image | ( | muse_image * | aImage | ) |
Trim the input image of pre- and over-scan regions of all quadrants.
aImage | muse_image that holds the image to trim |
set CPL_ERROR_NULL_INPUT, return NULL | if aImage or its data or header component are NULL |
set CPL_ERROR_DATA_NOT_FOUND, return NULL | FITS headers are missing required keywords |
set CPL_ERROR_INCOMPATIBLE_INPUT, return NULL | FITS headers contain incompatible read-out port setup (order of quadrants, differing sizes) |
set CPL_ERROR_ILLEGAL_INPUT, return NULL | FITS header in input lead to computation of too large or non-positive output sizes |
Definition at line 773 of file muse_quadrants.c.
References muse_image::data, muse_image::dq, muse_image::header, muse_image_new(), muse_image_save(), muse_pfits_get_binx(), muse_pfits_get_biny(), muse_pfits_get_out_nx(), muse_pfits_get_out_ny(), muse_pfits_get_out_output_x(), muse_pfits_get_out_output_y(), muse_pfits_get_out_prescan_x(), muse_pfits_get_out_prescan_y(), and muse_image::stat.
Referenced by muse_basicproc_params_delete().
cpl_boolean muse_quadrants_verify | ( | cpl_propertylist * | aHeader | ) |
Verify that quadrant locations and sizes meet the expectations.
aHeader | list of FITS headers to check |
The expected quadrant locations are
4(=H) 3(=G)
1(=E) 2(=F)
Note that INM data has ports G and H switched.
set CPL_ERROR_NULL_INPUT, return CPL_FALSE | the input header is NULL |
set CPL_ERROR_ILLEGAL_INPUT, return CPL_FALSE | the order of the ports is unexpected |
set CPL_ERROR_INCOMPATIBLE_INPUT, return CPL_FALSE | the sizes of the quadrants are not equal |
Definition at line 1006 of file muse_quadrants.c.
References muse_pfits_get_binx(), muse_pfits_get_biny(), muse_pfits_get_out_nx(), muse_pfits_get_out_ny(), muse_pfits_get_out_output_x(), muse_pfits_get_out_output_y(), muse_pfits_get_out_overscan_x(), muse_pfits_get_out_overscan_y(), muse_pfits_get_out_prescan_x(), and muse_pfits_get_out_prescan_y().
Referenced by muse_quadrants_overscan_polyfit_vertical(), and muse_quadrants_overscan_stats().