MUSE Pipeline Reference Manual
2.1.1
|
Data Structures | |
struct | muse_imagelist |
Structure definition for a collection of muse_images. More... | |
Functions | |
muse_imagelist * | muse_imagelist_new (void) |
Create a new (empty) MUSE image list. More... | |
void | muse_imagelist_delete (muse_imagelist *aList) |
Free the memory of the MUSE image list. More... | |
unsigned int | muse_imagelist_get_size (muse_imagelist *aList) |
Return the number of stored images. More... | |
muse_image * | muse_imagelist_get (muse_imagelist *aList, unsigned int aIdx) |
Get the muse_image of given list index. More... | |
cpl_error_code | muse_imagelist_set (muse_imagelist *aList, muse_image *aImage, unsigned int aIdx) |
Set the muse_image of given list index. More... | |
muse_image * | muse_imagelist_unset (muse_imagelist *aList, unsigned int aIdx) |
Unset the muse_image at given list index from the list. More... | |
int | muse_imagelist_is_uniform (muse_imagelist *aList) |
Check that all images in the muse_imagelist have the same size. More... | |
void | muse_imagelist_dump_statistics (muse_imagelist *aList) |
Show statistics of a muse_image list. More... | |
cpl_error_code | muse_imagelist_scale_exptime (muse_imagelist *aList) |
Scale muse_images to a common exposure time. More... | |
cpl_bivector * | muse_imagelist_compute_ron (muse_imagelist *aList, int aHalfsize, int aNSamples) |
Compute the read-out noise from bias images in an imagelist. More... | |
Functions to handle lists of muse_images.
cpl_bivector* muse_imagelist_compute_ron | ( | muse_imagelist * | aList, |
int | aHalfsize, | ||
int | aNSamples | ||
) |
Compute the read-out noise from bias images in an imagelist.
aList | the image list |
aHalfsize | half size of sample squares |
aNSamples | number of sample squares |
The output bivector has a length of 4, with one entry for RON (in the x-component) and RONERR (in y) for each quadrant.
This loops through all images in the input list and subtracts one from the next. From the difference image the RON is measured. So several RON values are derived (one less than the size of the input list) which are then averaged to create the final value. RONERR should be at most 10% of RON, so this function reruns cpl_flux_get_noise_window() until that is reached.
This function assumes that the input images are all bias images, that the GAIN value in the header is accurate, and that the images are still in the original adu.
Uses the formula from "Handbook of CCD Astronomy" by Steve B. Howell (2000, Sect. 4.3, p. 53) to scale the measured values to the correct ones: RON = GAIN * sigma(B1 - B2) / sqrt(2) where sigma() is the read-out noise measured on the difference bias image and GAIN is in count/adu.
set CPL_ERROR_NULL_INPUT, return NULL | aList is NULL |
set CPL_ERROR_ILLEGAL_INPUT, return NULL | aList has no elementes |
Definition at line 364 of file muse_imagelist.c.
References muse_image::data, muse_image::header, list, muse_imagelist_get_size(), muse_pfits_get_gain(), muse_pfits_get_ron(), muse_quadrants_get_window(), muse_utils_get_ifu(), size, and muse_image::stat.
void muse_imagelist_delete | ( | muse_imagelist * | aList | ) |
Free the memory of the MUSE image list.
aList | the image list |
Frees the memory of all muse_images in the list and the pointers to the image list and the list itself. As a safeguard, it checks if a valid pointer was passed, so that crashes cannot occur.
Definition at line 78 of file muse_imagelist.c.
References list, muse_image_delete(), and size.
Referenced by muse_basicproc_combine_images_lampwise(), muse_basicproc_load(), muse_basicproc_params_delete(), muse_dar_check(), muse_datacube_concat(), muse_datacube_delete(), muse_euro3dcube_delete(), muse_wave_calib(), muse_wave_calib_lampwise(), and muse_wcs_locate_sources().
void muse_imagelist_dump_statistics | ( | muse_imagelist * | aList | ) |
Show statistics of a muse_image list.
aList | the image list |
return without doing anything | aList is NULL |
Definition at line 269 of file muse_imagelist.c.
References muse_image::data, muse_image::header, muse_imagelist_get(), muse_pfits_get_exptime(), and size.
muse_image* muse_imagelist_get | ( | muse_imagelist * | aList, |
unsigned int | aIdx | ||
) |
Get the muse_image of given list index.
aList | the image list |
aIdx | index of the image to return, starting at 0 |
This function only returns a pointer to the actual image which remains in the image list and will be deallocated with it. So do not use muse_image_delete() on the pointer returned by this function.
set CPL_ERROR_NULL_INPUT, return NULL | aList is NULL |
set CPL_ERROR_ACCESS_OUT_OF_RANGE, return NULL | aIdx does not exist in the list |
Definition at line 126 of file muse_imagelist.c.
References list.
Referenced by muse_basicproc_combine_images_lampwise(), muse_basicproc_get_illum(), muse_basicproc_params_delete(), muse_combine_images(), muse_datacube_save_recimages(), muse_euro3dcube_delete(), muse_geo_measure_spots(), muse_imagelist_dump_statistics(), muse_imagelist_is_uniform(), muse_imagelist_scale_exptime(), muse_lsf_create_arcpixtable(), muse_pixtable_from_imagelist(), muse_wave_calib_lampwise(), and muse_wcs_optimize_solution().
unsigned int muse_imagelist_get_size | ( | muse_imagelist * | aList | ) |
Return the number of stored images.
aList | the image list |
set CPL_ERROR_NULL_INPUT, return 0 | aList is NULL |
Definition at line 103 of file muse_imagelist.c.
References size.
Referenced by muse_basicproc_combine_images_lampwise(), muse_basicproc_get_illum(), muse_basicproc_params_delete(), muse_combine_average_create(), muse_combine_images(), muse_combine_median_create(), muse_combine_minmax_create(), muse_combine_sigclip_create(), muse_combine_sum_create(), muse_datacube_load(), muse_datacube_save_recimages(), muse_euro3dcube_delete(), muse_geo_measure_spots(), muse_imagelist_compute_ron(), muse_lsf_create_arcpixtable(), muse_pixtable_from_imagelist(), muse_postproc_cube_resample_and_collapse(), and muse_wave_calib_lampwise().
int muse_imagelist_is_uniform | ( | muse_imagelist * | aList | ) |
Check that all images in the muse_imagelist have the same size.
aList | the image list |
Unlike cpl_imagelists, the types of the images are automatically equal, so this is not tested.
set CPL_ERROR_NULL_INPUT, return -1 | aList is NULL |
Definition at line 240 of file muse_imagelist.c.
References muse_imagelist_get(), and size.
Referenced by muse_basicproc_params_delete().
muse_imagelist* muse_imagelist_new | ( | void | ) |
Create a new (empty) MUSE image list.
Definition at line 60 of file muse_imagelist.c.
Referenced by muse_basicproc_combine_images_lampwise(), muse_basicproc_load_reduced(), muse_basicproc_params_delete(), muse_dar_check(), muse_datacube_load(), muse_pixtable_to_imagelist(), muse_postproc_cube_resample_and_collapse(), muse_wave_calib(), muse_wave_calib_lampwise(), and muse_wcs_locate_sources().
cpl_error_code muse_imagelist_scale_exptime | ( | muse_imagelist * | aList | ) |
Scale muse_images to a common exposure time.
aList | the image list |
Scale all muse_images and their statistics by their exposure time (FITS keyword EXPTIME) relative to the first exposure in the input list. Reset their EXPTIME keyword to the value of the first exposure, too.
set and return CPL_ERROR_NULL_INPUT | aList is NULL |
Definition at line 308 of file muse_imagelist.c.
References muse_image::header, muse_image_scale(), muse_imagelist_get(), muse_pfits_get_exptime(), and size.
Referenced by muse_combine_images().
cpl_error_code muse_imagelist_set | ( | muse_imagelist * | aList, |
muse_image * | aImage, | ||
unsigned int | aIdx | ||
) |
Set the muse_image of given list index.
aList | the image list |
aImage | the muse_image to set |
aIdx | index of the image to return, starting at 0 |
If the index points to an existing muse_image in the list, that will be deallocated and replaced by the given image. Otherwise the list will be extended to store a new image at aIdx, possibly even with empty entries in between.
You should not deallocate the image after it has been inserted into an imagelist, since the muse_imagelist_delete() will deallocate its images.
return CPL_ERROR_NULL_INPUT | aList or aImage are NULL |
return CPL_ERROR_ILLEGAL_INPUT | the pointer to aImage was already added to aList |
Definition at line 156 of file muse_imagelist.c.
References list, muse_image_delete(), and size.
Referenced by muse_basicproc_combine_images_lampwise(), muse_basicproc_load_reduced(), muse_basicproc_params_delete(), muse_dar_check(), muse_datacube_load(), muse_pixtable_to_imagelist(), muse_postproc_cube_resample_and_collapse(), muse_wave_calib(), muse_wave_calib_lampwise(), and muse_wcs_locate_sources().
muse_image* muse_imagelist_unset | ( | muse_imagelist * | aList, |
unsigned int | aIdx | ||
) |
Unset the muse_image at given list index from the list.
aList | the image list |
aIdx | index of the image to unset, starting at 0 |
If the index points to an existing muse_image in the list, that will be erased from the list. The image at that position is returned by this function so that the user can deallocate it, if no longer needed. The rest of the images are moved to the previous position in the list and the size of the list is decreased by one.
set CPL_ERROR_NULL_INPUT, return NULL | aList is NULL |
set CPL_ERROR_ACCESS_OUT_OF_RANGE, return NULL | aIdx does not exist in the list |
Definition at line 200 of file muse_imagelist.c.
Referenced by muse_basicproc_get_illum().