MUSE Pipeline Reference Manual
2.1.1
|
Data Structures | |
struct | muse_sky_params |
Structure to define the major settable sky parameters. More... | |
Functions | |
cpl_table * | muse_sky_spectrum_from_cube (muse_datacube *aCube, const cpl_mask *aMask) |
Create a spectrum out of a cube by applying a mask. More... | |
muse_mask * | muse_sky_create_skymask (muse_image *aImage, double aMinFraction, double aFraction, const char *aQCPrefix) |
Select spaxels to be considered as sky. More... | |
cpl_error_code | muse_sky_save_continuum (muse_processing *aProcessing, const cpl_table *aContinuum, cpl_propertylist *aHeader) |
Save sky continuum table to file. More... | |
cpl_error_code | muse_sky_lines_set_range (cpl_table *aLines, double aLow, double aHigh) |
Limit the lines in the table to a wavelength range. More... | |
cpl_error_code | muse_sky_lines_save (muse_processing *aProcessing, const cpl_table *aLines, cpl_propertylist *aHeader) |
Save sky lines table to file. More... | |
cpl_table * | muse_sky_lines_load (muse_processing *aProcessing) |
Load the sky data files. More... | |
cpl_error_code | muse_sky_lines_apply_strength (cpl_table *aLines, const cpl_array *aStrength) |
Apply the line strengths to the lines. More... | |
cpl_error_code | muse_sky_lines_cut (cpl_table *aLines, double aMinflux) |
Remove all lines below a certain flux limit. More... | |
cpl_table * | muse_sky_lines_create (const cpl_table *aLines, const cpl_table *aOh_transitions, double aT_vibr) |
Create the emission lines from the OH transitions and other lines. More... | |
cpl_error_code | muse_sky_lines_fit (cpl_table *aSpectrum, cpl_table *aLines, cpl_image *aLsfImage, muse_wcs *aWCS) |
Fit all entries of the pixel table to the master sky. More... | |
cpl_table * | muse_sky_continuum_create (cpl_table *aSpectrum, cpl_table *aLines, cpl_image *aLsfImage, muse_wcs *aLsfWCS, double aBinWidth) |
Create a continuum spectrum. More... | |
cpl_table * | muse_sky_continuum_load (muse_processing *aProcessing) |
Load the sky continuum. More... | |
cpl_error_code | muse_sky_lines_fit_old (cpl_table *aSpectrum, cpl_table *aLines) |
Fit all entries of the pixel table to the master sky. More... | |
cpl_error_code | muse_sky_subtract_lines_old (muse_pixtable *aPixtable, cpl_table *aLines, muse_lsf_params **aLsfParams) |
Subtract sky lines from a pixtable. More... | |
void | muse_sky_qc_lines (cpl_propertylist *aHeader, cpl_table *aLines, const char *aPrefix) |
Fill a header with the QC parameters for the sky lines. More... | |
void | muse_sky_qc_continuum (cpl_propertylist *aHeader, cpl_table *aContinuum, const char *aPrefix) |
Fill a header with the QC parameters for the sky continuum. More... | |
cpl_array * | muse_sky_lines_spectrum (const cpl_array *aLambda, cpl_table *aLines, const cpl_image *aLsfImage, const muse_wcs *aLsfWCS) |
Create spectrum for a single slice. More... | |
cpl_error_code | muse_sky_subtract_lines (muse_pixtable *aPixtable, cpl_table *aLines, muse_lsf_cube **aLsfCube) |
Subtract sky lines from a pixtable. More... | |
cpl_error_code | muse_sky_subtract_continuum (muse_pixtable *aPixtable, cpl_table *aSpectrum) |
Subtract sky continuum from pixel table. More... | |
Variables | |
const muse_cpltable_def | muse_fluxspectrum_def [] |
Definition of the flux spectrum table structure. More... | |
The sky subtraction consists of two steps: the calculation of the common sky parameters (continuum spectrum and emission line fluxes), and the actual subtraction of this spectrum applied to LSF parameters from each slice. The communication between these two steps is realized with the muse_sky_master
structure.
As input for the master sky calculation a parameter file is used that will be read into a muse_sky_lines
structure.
This type of file contains one or more binary tables with the relative fluxes on the sky emission lines. If both tables are present, they are merged, so that lines should not appear in both tables.
Columns:
name
': Transition name; like "OH 8-3 P1e(22.5) 2" [string]lambda
': Air wavelength [double]v_u
': Upper transition level [int]v_l
': Lower transition level [int]nu
': Vibrational momentum [int]E_u
': Upper energy [double]J_u
': Upper momentum [double]A
': Transition probability [double]This type of file contains one or more binary tables with the relative fluxes on the sky emission lines. If both tables are present, they are merged, so that lines should not appear in both tables.
Columns:
name
': Line name [string]group
': Line group id [int]lambda
': Air wavelength [double]flux
': Line flux [double]dq
': Quality of the entry (>0: dont use) [int] cpl_table* muse_sky_continuum_create | ( | cpl_table * | aSpectrum, |
cpl_table * | aLines, | ||
cpl_image * | aLsfImage, | ||
muse_wcs * | aLsfWCS, | ||
double | aBinWidth | ||
) |
Create a continuum spectrum.
aSpectrum | Sky spectrum |
aLines | Sky emission line list |
aLsfImage | LSF data to use |
aLsfWCS | WCS information for the LSF data |
aBinWidth | Continuum spectrum bin with |
set CPL_ERROR_NULL_INPUT, return NULL | (aSpectrum) not fulfilled |
set CPL_ERROR_NULL_INPUT, return NULL | (aLines) not fulfilled |
set CPL_ERROR_NULL_INPUT, return NULL | (aLsfImage) not fulfilled |
set CPL_ERROR_NULL_INPUT, return NULL | (aLsfWCS) not fulfilled |
Definition at line 319 of file muse_sky_master.c.
References muse_cplarray_interpolate_linear(), muse_cpltable_extract_column(), muse_cpltable_new(), muse_fluxspectrum_def, and muse_sky_lines_spectrum().
Referenced by muse_postproc_process_exposure().
cpl_table* muse_sky_continuum_load | ( | muse_processing * | aProcessing | ) |
Load the sky continuum.
aProcessing | the processing structure |
Definition at line 367 of file muse_sky_master.c.
References muse_processing::inframes, muse_cpltable_load(), muse_fluxspectrum_def, muse_frameset_find(), and muse_processing_append_used().
muse_mask* muse_sky_create_skymask | ( | muse_image * | aImage, |
double | aMinFraction, | ||
double | aFraction, | ||
const char * | aQCPrefix | ||
) |
Select spaxels to be considered as sky.
aImage | MUSE (white-light) image of the field of view. |
aMinFraction | Lowest fraction of spectra to ignore |
aFraction | Lowest fraction of remaining spectra to select |
aQCPrefix | prefix for the QC keywords |
Use thresholding to create a mask of sky regions. The output mask contains a QC parameter aQCPrefix" THRESHOLD" in its header component.
set CPL_ERROR_NULL_INPUT, return NULL | aImage is NULL |
Definition at line 120 of file muse_sky_common.c.
References muse_image::data, muse_mask::header, muse_image::header, muse_mask::mask, muse_cplimage_get_percentile(), muse_image_reject_from_dq(), and muse_mask_new().
Referenced by muse_postproc_process_exposure().
cpl_error_code muse_sky_lines_apply_strength | ( | cpl_table * | aLines, |
const cpl_array * | aStrength | ||
) |
Apply the line strengths to the lines.
aLines | List of emission lines. |
aStrength | Array of strengths, sorted by line group. |
CPL_ERROR_NONE | Everything went OK |
CPL_ERROR_NULL_INPUT | (aLines != NULL) not fulfilled |
CPL_ERROR_NULL_INPUT | (aStrength != NULL) not fulfilled |
CPL_ERROR_ILLEGAL_INPUT | (aLines['group'] != NULL) not fulfilled |
CPL_ERROR_ILLEGAL_INPUT | (aLines['flux'] != NULL) not fulfilled |
The line strengths are applied in-place, changing the emission lines list.
Definition at line 239 of file muse_sky_lines.c.
Referenced by muse_sky_lines_fit(), and muse_sky_lines_fit_old().
cpl_table* muse_sky_lines_create | ( | const cpl_table * | aLines, |
const cpl_table * | aOh_transitions, | ||
double | aT_vibr | ||
) |
Create the emission lines from the OH transitions and other lines.
aLines | non-OH lines table |
aOh_transitions | OH transition table |
aT_vibr | structure to hold vibrational transitions |
If the input parameters are NULL
, then the function returns an empty table (default).
Definition at line 389 of file muse_sky_lines.c.
Referenced by muse_sky_lines_load().
cpl_error_code muse_sky_lines_cut | ( | cpl_table * | aLines, |
double | aMinflux | ||
) |
Remove all lines below a certain flux limit.
aLines | List of emission lines. |
aMinflux | Minimal flux, in 10^-20 erg/(s cm^2 arcsec^2) |
CPL_ERROR_NONE | Everything went OK |
CPL_ERROR_NULL_INPUT | (aLines != NULL) not fulfilled |
The line strengths are applied in-place, changing the emission lines list.
Definition at line 268 of file muse_sky_lines.c.
References muse_cpltable_new(), and muse_sky_lines_lines_def.
cpl_error_code muse_sky_lines_fit | ( | cpl_table * | aSpectrum, |
cpl_table * | aLines, | ||
cpl_image * | aLsfImage, | ||
muse_wcs * | aWCS | ||
) |
Fit all entries of the pixel table to the master sky.
aSpectrum | Sky spectrum |
aLines | Sky lines table. The line fluxes are adjusted. |
aLsfImage | Image to store the LSF. |
aWCS | The WCS header of the image. |
CPL_ERROR_NULL_INPUT | (aSpectrum != NULL) not fulfilled |
CPL_ERROR_NULL_INPUT | (aLines != NULL) not fulfilled |
set CPL_ERROR_DATA_NOT_FOUND | aSpectrum has no entries |
Definition at line 227 of file muse_sky_master.c.
References muse_cpl_optimize_lvmq(), muse_cpltable_extract_column(), and muse_sky_lines_apply_strength().
Referenced by muse_postproc_process_exposure().
cpl_error_code muse_sky_lines_fit_old | ( | cpl_table * | aSpectrum, |
cpl_table * | aLines | ||
) |
Fit all entries of the pixel table to the master sky.
aSpectrum | Measured sky spectrum. |
aLines | Sky lines table. |
CPL_ERROR_NULL_INPUT | (aSpectrum != NULL) not fulfilled |
CPL_ERROR_NULL_INPUT | (aLines != NULL) not fulfilled |
set CPL_ERROR_DATA_NOT_FOUND, return NULL | aStat has no entries |
Definition at line 436 of file muse_sky_old.c.
References muse_cpl_optimize_lvmq(), muse_cpltable_extract_column(), and muse_sky_lines_apply_strength().
Referenced by muse_postproc_process_exposure().
cpl_table* muse_sky_lines_load | ( | muse_processing * | aProcessing | ) |
Load the sky data files.
aProcessing | the processing structure |
set CPL_ERROR_NULL_INPUT, return NULL | (aFile != NULL) not fulfilled |
The file must consist of two extensions containing the OH transition table ("OH_TRANSITIONS") and the table of other lines ("LINES").
Definition at line 169 of file muse_sky_lines.c.
References muse_processing::inframes, muse_cpltable_load(), muse_frameset_find(), muse_processing_append_used(), muse_sky_lines_create(), and muse_sky_lines_lines_def.
cpl_error_code muse_sky_lines_save | ( | muse_processing * | aProcessing, |
const cpl_table * | aLines, | ||
cpl_propertylist * | aHeader | ||
) |
Save sky lines table to file.
aProcessing | the processing structure |
aLines | the sky lines table |
aHeader | the FITS header to use for the primary HDU |
The table extension is marked with and EXTNAME of "LINES".
return CPL_ERROR_NULL_INPUT | one of the arguments is NULL |
return CPL_ERROR_ILLEGAL_INPUT | the output frame could not be created |
Definition at line 136 of file muse_sky_lines.c.
References muse_cpltable_append_file(), muse_processing_new_frame(), muse_sky_lines_lines_def, and muse_processing::outframes.
cpl_error_code muse_sky_lines_set_range | ( | cpl_table * | aLines, |
double | aLow, | ||
double | aHigh | ||
) |
Limit the lines in the table to a wavelength range.
aLines | sky lines table |
aLow | lower limit, in Angstrom |
aHigh | higher limit, in Angstrom |
CPL_ERROR_NONE | Success |
CPL_ERROR_NULL_INPUT | (aSkyData != NULL) not fulfilled |
This function is used to improve the efficiency of the fits by removing lines outside of the data range.
Definition at line 108 of file muse_sky_lines.c.
Referenced by muse_postproc_process_exposure().
cpl_array* muse_sky_lines_spectrum | ( | const cpl_array * | aLambda, |
cpl_table * | aLines, | ||
const cpl_image * | aLsfImage, | ||
const muse_wcs * | aLsfWCS | ||
) |
Create spectrum for a single slice.
aLambda | Wavelength array. |
aLines | Sky emission line table |
aLsfImage | LSF data to use |
aLsfWCS | WCS information for the LSF data return the spectrum as cpl_array |
The values in the returned array correspond to the wavelengths in the aLambda parameter.
Definition at line 64 of file muse_sky_subtract.c.
References muse_cplarray_add_window(), muse_cplarray_find_sorted(), muse_cpltable_extract_column(), muse_lsf_apply(), MUSE_PIXTABLE_DATA, MUSE_PIXTABLE_LAMBDA, and muse_pixtable::table.
Referenced by muse_sky_continuum_create().
void muse_sky_qc_continuum | ( | cpl_propertylist * | aHeader, |
cpl_table * | aContinuum, | ||
const char * | aPrefix | ||
) |
Fill a header with the QC parameters for the sky continuum.
aHeader | header to store the QC parameters for the sky continuum |
aContinuum | sky continuum table |
aPrefix | prefix for the QC keywords |
set CPL_ERROR_NULL_INPUT and return | one of the input arguments is NULL |
set CPL_ERROR_DATA_NOT_FOUND and return | aContinuum does not contain any rows |
Definition at line 102 of file muse_sky_qc.c.
void muse_sky_qc_lines | ( | cpl_propertylist * | aHeader, |
cpl_table * | aLines, | ||
const char * | aPrefix | ||
) |
Fill a header with the QC parameters for the sky lines.
aHeader | header with the QC parameters for the sky lines |
aLines | sky line table |
aPrefix | prefix for the QC keywords |
set CPL_ERROR_NULL_INPUT and return | one of the input arguments is NULL |
set CPL_ERROR_DATA_NOT_FOUND and return | aLines does not contain any rows |
Definition at line 46 of file muse_sky_qc.c.
cpl_error_code muse_sky_save_continuum | ( | muse_processing * | aProcessing, |
const cpl_table * | aContinuum, | ||
cpl_propertylist * | aHeader | ||
) |
Save sky continuum table to file.
aProcessing | the processing structure |
aContinuum | the sky continuum table |
aHeader | the FITS header to use for the primary HDU |
The table extension is marked with and EXTNAME of "CONTINUUM".
return CPL_ERROR_NULL_INPUT | one of the arguments is NULL |
return CPL_ERROR_ILLEGAL_INPUT | the output frame could not be created |
Definition at line 169 of file muse_sky_common.c.
References muse_cpltable_append_file(), muse_processing_new_frame(), and muse_processing::outframes.
cpl_table* muse_sky_spectrum_from_cube | ( | muse_datacube * | aCube, |
const cpl_mask * | aMask | ||
) |
Create a spectrum out of a cube by applying a mask.
aCube | MUSE datacube. |
aMask | Mask image of sky regions. |
Definition at line 70 of file muse_sky_common.c.
References muse_datacube::data, muse_datacube::dq, muse_datacube::header, muse_cpltable_new(), muse_dataspectrum_def, muse_pfits_get_cd(), muse_pfits_get_crpix(), and muse_pfits_get_crval().
cpl_error_code muse_sky_subtract_continuum | ( | muse_pixtable * | aPixtable, |
cpl_table * | aSpectrum | ||
) |
Subtract sky continuum from pixel table.
aPixtable | Pixel table. The data column will be changed. |
aSpectrum | Continuum spectrum |
Definition at line 216 of file muse_sky_subtract.c.
References muse_cpltable_check(), muse_cpltable_extract_column(), muse_pixtable_def, muse_pixtable_restrict_wavelength(), muse_pixtable_spectrum_apply(), and muse_pixtable::table.
Referenced by muse_postproc_process_exposure().
cpl_error_code muse_sky_subtract_lines | ( | muse_pixtable * | aPixtable, |
cpl_table * | aLines, | ||
muse_lsf_cube ** | aLsfCube | ||
) |
Subtract sky lines from a pixtable.
aPixtable | Pixel table. The data column will be changed. |
aLines | Line list with individual line fluxes |
aLsfCube | The LSF cube |
Definition at line 150 of file muse_sky_subtract.c.
References muse_cpltable_check(), muse_pixtable_def, muse_pixtable_extracted_delete(), muse_pixtable_extracted_get_size(), muse_pixtable_extracted_get_slices(), muse_pixtable_get_nrow(), MUSE_PIXTABLE_ORIGIN, muse_pixtable_origin_get_ifu(), muse_pixtable_origin_get_slice(), and muse_pixtable::table.
Referenced by muse_postproc_process_exposure().
cpl_error_code muse_sky_subtract_lines_old | ( | muse_pixtable * | aPixtable, |
cpl_table * | aLines, | ||
muse_lsf_params ** | aLsfParams | ||
) |
Subtract sky lines from a pixtable.
aPixtable | Pixel table. The data column will be changed. |
aLines | Line list with individual line fluxes |
aLsfParams | LSF parameters for the instrument |
CPL_ERROR_NONE | if everything was OK. |
set CPL_ERROR_NULL_INPUT, return CPL_ERROR_NULL_INPUT | (aPixtable != NULL) not fulfilled |
set CPL_ERROR_NULL_INPUT, return CPL_ERROR_NULL_INPUT | (aPixtable->table != NULL) not fulfilled |
set CPL_ERROR_DATA_NOT_FOUND, return CPL_ERROR_DATA_NOT_FOUND | (aPixtable->table is a pixel table) not fulfilled |
set CPL_ERROR_NULL_INPUT, return CPL_ERROR_NULL_INPUT | (aLines != NULL) not fulfilled |
set CPL_ERROR_NULL_INPUT, return CPL_ERROR_NULL_INPUT | (aLsfParams != NULL) not fulfilled |
Definition at line 532 of file muse_sky_old.c.
References muse_pixtable::header, muse_cpltable_extract_column(), MUSE_HDR_PT_SKYSUB, muse_lsf_params_get(), muse_lsf_params_spectrum(), MUSE_PIXTABLE_DATA, muse_pixtable_extracted_delete(), muse_pixtable_extracted_get_size(), muse_pixtable_extracted_get_slices(), muse_pixtable_get_nrow(), MUSE_PIXTABLE_LAMBDA, MUSE_PIXTABLE_ORIGIN, muse_pixtable_origin_get_ifu(), muse_pixtable_origin_get_slice(), and muse_pixtable::table.
Referenced by muse_postproc_process_exposure().
const muse_cpltable_def muse_fluxspectrum_def[] |
Definition of the flux spectrum table structure.
lambda
: wavelength [Angstrom]flux
: Flux [erg/(s cm^2 arcsec^2)]The table can be expected to be sorted by the wavelength.
Definition at line 55 of file muse_sky_common.c.
Referenced by muse_sky_continuum_create(), and muse_sky_continuum_load().