MUSE Pipeline Reference Manual  2.1.1
Data Structures | Macros | Enumerations | Functions | Variables
Pixel table handling

Data Structures

struct  muse_pixtable
 Structure definition of MUSE pixel table. More...
 

Macros

#define MUSE_PIXTABLE_DATA   "data"
 
#define MUSE_PIXTABLE_DQ   "dq"
 
#define MUSE_PIXTABLE_STAT   "stat"
 
#define MUSE_PIXTABLE_XPOS   "xpos"
 
#define MUSE_PIXTABLE_YPOS   "ypos"
 
#define MUSE_PIXTABLE_LAMBDA   "lambda"
 
#define MUSE_PIXTABLE_ORIGIN   "origin"
 
#define MUSE_PIXTABLE_WEIGHT   "weight"
 
#define MUSE_PIXTABLE_FF_EXT   "PIXTABLE_FLAT_FIELD"
 
#define MUSE_PIXTABLE_FFLAMBDA   MUSE_PIXTABLE_LAMBDA
 
#define MUSE_PIXTABLE_FFDATA   MUSE_PIXTABLE_DATA
 
#define MUSE_HDR_PT_IFU_SLICE_OFFSET   "ESO DRS MUSE PIXTABLE EXP%u IFU%02hu SLICE%02hu XOFFSET"
 FITS header keyword for the horizontal slice offset on the CCD. More...
 
#define MUSE_HDR_PT_TYPE   "ESO DRS MUSE PIXTABLE TYPE"
 Pixel table "type" stored in the FITS header. More...
 
#define MUSE_HDR_PT_EXP_FST   "ESO DRS MUSE PIXTABLE EXP%u FIRST"
 FITS header keyword defining the first row index for a given exposure. More...
 
#define MUSE_HDR_PT_EXP_LST   "ESO DRS MUSE PIXTABLE EXP%u LAST"
 FITS header keyword defining the last row index for a given exposure. More...
 
#define MUSE_HDR_PT_ILLUMi   "ESO DRS MUSE PIXTABLE ILLUM%hu"
 
#define MUSE_HDR_PT_ILLUM_MEAN   "ESO DRS MUSE PIXTABLE ILLUM MEAN"
 
#define MUSE_HDR_PT_ILLUM_STDEV   "ESO DRS MUSE PIXTABLE ILLUM STDEV"
 
#define MUSE_HDR_PT_ILLUM_REGEXP   "^ESO DRS MUSE PIXTABLE ILLUM"
 
#define MUSE_HDR_PT_XLO   "ESO DRS MUSE PIXTABLE LIMITS X LOW"
 FITS header keyword contains the lower limit of the data in x-direction. More...
 
#define MUSE_HDR_PT_XHI   "ESO DRS MUSE PIXTABLE LIMITS X HIGH"
 FITS header keyword contains the upper limit of the data in x-ion. More...
 
#define MUSE_HDR_PT_YLO   "ESO DRS MUSE PIXTABLE LIMITS Y LOW"
 FITS header keyword contains the lower limit of the data in y-direction. More...
 
#define MUSE_HDR_PT_YHI   "ESO DRS MUSE PIXTABLE LIMITS Y HIGH"
 FITS header keyword contains the upper limit of the data in y-direction. More...
 
#define MUSE_HDR_PT_LLO   "ESO DRS MUSE PIXTABLE LIMITS LAMBDA LOW"
 FITS header keyword contains the lower limit of the data in spectral direction. More...
 
#define MUSE_HDR_PT_LHI   "ESO DRS MUSE PIXTABLE LIMITS LAMBDA HIGH"
 FITS header keyword contains the upper limit of the data in spectral direction. More...
 
#define MUSE_HDR_PT_ILO   "ESO DRS MUSE PIXTABLE LIMITS IFU LOW"
 FITS header keyword contains the lowest IFU number in the data. More...
 
#define MUSE_HDR_PT_IHI   "ESO DRS MUSE PIXTABLE LIMITS IFU HIGH"
 FITS header keyword contains the highest IFU number in the data. More...
 
#define MUSE_HDR_PT_SLO   "ESO DRS MUSE PIXTABLE LIMITS SLICE LOW"
 FITS header keyword contains the lowest slice number in the data. More...
 
#define MUSE_HDR_PT_SHI   "ESO DRS MUSE PIXTABLE LIMITS SLICE HIGH"
 FITS header keyword contains the highest slice number in the data. More...
 
#define MUSE_HDR_PT_PREDAR_XLO   "ESO DRS MUSE PIXTABLE PREDAR LIMITS XLO"
 
#define MUSE_HDR_PT_PREDAR_XHI   "ESO DRS MUSE PIXTABLE PREDAR LIMITS XHI"
 
#define MUSE_HDR_PT_PREDAR_YLO   "ESO DRS MUSE PIXTABLE PREDAR LIMITS YLO"
 
#define MUSE_HDR_PT_PREDAR_YHI   "ESO DRS MUSE PIXTABLE PREDAR LIMITS YHI"
 
#define MUSE_HDR_PT_FFCORR   "ESO DRS MUSE PIXTABLE FFCORR" /* int */
 
#define MUSE_HDR_PT_MERGED   "ESO DRS MUSE PIXTABLE MERGED" /* int */
 
#define MUSE_HDR_PT_SKYSUB   "ESO DRS MUSE PIXTABLE SKYSUB" /* bool */
 
#define MUSE_HDR_PT_DAR_NAME   "ESO DRS MUSE PIXTABLE DAR CORRECT"
 
#define MUSE_HDR_PT_DAR_CHECK   "ESO DRS MUSE PIXTABLE DAR CHECK"
 
#define MUSE_HDR_PT_DAR_CORR   "ESO DRS MUSE PIXTABLE DAR CORRECT RESIDUAL"
 
#define MUSE_HDR_PT_RVCORR   "ESO DRS MUSE PIXTABLE RVCORR"
 
#define MUSE_HDR_PT_FLUXCAL   "ESO DRS MUSE PIXTABLE FLUXCAL" /* bool */
 
#define MUSE_HDR_PT_WCS   "ESO DRS MUSE PIXTABLE WCS" /* string */
 
#define MUSE_HDR_PT_WCS_PROJ   "projected (intermediate)"
 
#define MUSE_HDR_PT_WCS_POSI   "positioned (final)"
 
#define MUSE_HDR_PT_WEIGHTED   "ESO DRS MUSE PIXTABLE WEIGHTED" /* bool */
 
#define MUSE_HDR_PT_COMBINED   "ESO DRS MUSE PIXTABLE COMBINED" /* int */
 
#define MUSE_HDR_PT_SPEC_TYPE   "ESO DRS MUSE PIXTABLE SPECTYPE" /* string */
 

Enumerations

Functions

uint32_t muse_pixtable_origin_encode (unsigned int aX, unsigned int aY, unsigned short aIFU, unsigned short aSlice, unsigned int aOffset)
 Encode the three CCD coordinates defining the origin of one MUSE pixel into a 32bit integer. More...
 
unsigned int muse_pixtable_origin_get_x (uint32_t aOrigin, muse_pixtable *aPixtable, cpl_size aRow)
 Get the horizontal coordinate from the encoded 32bit origin number. More...
 
unsigned int muse_pixtable_origin_get_y (uint32_t aOrigin)
 Get the vertical coordinate from the encoded 32bit origin number. More...
 
unsigned short muse_pixtable_origin_get_ifu (uint32_t aOrigin)
 Get the IFU number from the encoded 32bit origin number. More...
 
unsigned short muse_pixtable_origin_get_slice (uint32_t aOrigin)
 Get the slice number from the encoded 32bit origin number. More...
 
unsigned int muse_pixtable_origin_set_offset (muse_pixtable *aPixtable, cpl_polynomial *aLTrace, unsigned short aIFU, unsigned short aSlice)
 Set the slice offset from the pixel table header. More...
 
unsigned int muse_pixtable_origin_get_offset (muse_pixtable *aPixtable, unsigned int aExpNum, unsigned short aIFU, unsigned short aSlice)
 Get the slice offset from the pixel table header. More...
 
cpl_error_code muse_pixtable_origin_copy_offsets (muse_pixtable *aOut, muse_pixtable *aFrom, unsigned int aNum)
 Copy MUSE_HDR_PT_IFU_SLICE_OFFSET keywords between pixel tables. More...
 
unsigned int muse_pixtable_get_expnum (muse_pixtable *aPixtable, cpl_size aRow)
 Get the exposure number of a given row in a pixel table. More...
 
muse_pixtablemuse_pixtable_create (muse_image *aImage, cpl_table *aTrace, cpl_table *aWave, cpl_table *aGeoTable)
 Create the pixel table for one CCD. More...
 
muse_pixtablemuse_pixtable_duplicate (muse_pixtable *aPixtable)
 Make a copy of the pixtanle. More...
 
void muse_pixtable_delete (muse_pixtable *aPixtable)
 Deallocate memory associated to a pixel table object. More...
 
cpl_error_code muse_pixtable_append_ff (muse_pixtable *aPixtable, muse_image *aFF, cpl_table *aTrace, cpl_table *aWave, float aSampling)
 Create flat-field spectrum and append to pixel table. More...
 
cpl_error_code muse_pixtable_save (muse_pixtable *aPixtable, const char *aFilename)
 Save a MUSE pixel table to a file on disk. More...
 
muse_pixtablemuse_pixtable_load_window (const char *aFilename, cpl_size aStart, cpl_size aNRows)
 Load a range of rows from the table and all the FITS headers of a MUSE pixel table from a file. More...
 
muse_pixtablemuse_pixtable_load (const char *aFilename)
 Load the table itself and the FITS headers of a MUSE pixel table from a file. More...
 
muse_pixtablemuse_pixtable_load_restricted_wavelength (const char *aFilename, double aLambdaMin, double aLambdaMax)
 Load a pixel table from file and cut down the wavelength range. More...
 
muse_pixtablemuse_pixtable_load_merge_channels (cpl_table *aExposureList, double aLambdaMin, double aLambdaMax)
 Load and merge the pixel tables of the 24 MUSE sub-fields. More...
 
int muse_pixtable_get_type (muse_pixtable *aPixtable)
 Determine the type of pixel table. More...
 
cpl_size muse_pixtable_get_nrow (const muse_pixtable *aPixtable)
 get the number of rows within the pixel table More...
 
cpl_error_code muse_pixtable_compute_limits (muse_pixtable *aPixtable)
 (Re-)Compute the limits of the coordinate columns of a pixel table. More...
 
cpl_error_code muse_pixtable_flux_multiply (muse_pixtable *aPixtable, double aScale)
 Scale the flux of a pixel table with correct treatment of variance. More...
 
cpl_error_code muse_pixtable_spectrum_apply (muse_pixtable *aPixtable, const cpl_array *aLambdas, const cpl_array *aFlux, muse_pixtable_operation aOperation)
 Apply a spectrum given by two arrays with an operation to a pixel table. More...
 
static cpl_error_code muse_pixtable_fix_exp_headers (muse_pixtable *aPixtable)
 Fix the exposure ranges in the header of a pixel table. More...
 
cpl_error_code muse_pixtable_restrict_wavelength (muse_pixtable *aPixtable, double aLow, double aHigh)
 Restrict a pixel table to a certain wavelength range. More...
 
cpl_error_code muse_pixtable_restrict_xpos (muse_pixtable *aPixtable, double aLo, double aHi)
 Restrict a pixel table to a certain x coordinate range. More...
 
cpl_error_code muse_pixtable_restrict_ypos (muse_pixtable *aPixtable, double aLo, double aHi)
 Restrict a pixel table to a certain y coordinate range. More...
 
cpl_error_code muse_pixtable_erase_ifu_slice (muse_pixtable *aPixtable, unsigned char aIFU, unsigned short aSlice)
 Erase pixel table rows related to one slice of one IFU. More...
 
cpl_error_code muse_pixtable_and_selected_mask (muse_pixtable *aPixtable, muse_mask *aMask)
 Select all pixels where the (x,y) positions are enabled in the given mask. More...
 
cpl_error_code muse_pixtable_dump (muse_pixtable *aPixtable, cpl_size aStart, cpl_size aCount, unsigned char aDisplayHeader)
 Dump a MUSE pixel table to the screen, resolving the origin column. More...
 
muse_pixtable_wcs muse_pixtable_wcs_check (muse_pixtable *aPixtable)
 Check the state of the world coordinate system of a pixel table. More...
 
cpl_boolean muse_pixtable_is_fluxcal (muse_pixtable *aPixtable)
 Determine whether the pixel table is flux calibrated. More...
 
cpl_boolean muse_pixtable_is_skysub (muse_pixtable *aPixtable)
 Determine whether the pixel table is sky subtracted. More...
 
cpl_boolean muse_pixtable_is_rvcorr (muse_pixtable *aPixtable)
 Determine whether the pixel table is radial-velocity corrected. More...
 
cpl_error_code muse_pixtable_reset_dq (muse_pixtable *aPixtable, unsigned int aDQ)
 Reset a given bad pixel status (DQ flag) for all pixels in the table. More...
 
muse_imagelistmuse_pixtable_to_imagelist (muse_pixtable *aPixtable)
 Project a pixel table with data from one IFU back onto its image. More...
 
cpl_error_code muse_pixtable_from_imagelist (muse_pixtable *aPixtable, muse_imagelist *aList)
 Get pixel table values back from a per-IFU imagelist. More...
 
muse_pixtable ** muse_pixtable_extracted_get_slices (muse_pixtable *aPixtable)
 Extract one pixel table per IFU and slice. More...
 
cpl_size muse_pixtable_extracted_get_size (muse_pixtable **aPixtables)
 Get the size of an array of extracted pixel tables. More...
 
void muse_pixtable_extracted_delete (muse_pixtable **aPixtables)
 Delete a pixel table array. More...
 

Variables

const muse_cpltable_def muse_pixtable_def []
 MUSE pixel table definition. More...
 
const muse_cpltable_def muse_pixtable_def []
 MUSE pixel table definition. More...
 

Detailed Description

To be able to easily handle the muse_pixtable structure as defined in DRLDesign Sect. 5, a number of functions are used in the MUSE DRL.

The MUSE pixel table has the following columns:

It may additionally contain a column 'weight' which per-pixel weight information to be used for resampling.

The information in the "origin" column is optimized for RAM usage, encoding several separate values into one 32bit integer. The offset of each slice of each IFU is stored in a FITS keyword, then x coordinates can be stored relative to that.

Storage sizes needed for the numbers involved in the origin column:

 + X per slice 1...~90 (use range 0... 127 -->  7 bits)
 + Y trimmed 1...4112  (use range 0...8191 --> 13 bits)
 + IFU 1...24          (use range 0...  31 -->  5 bits)
 + Slice 1...48        (use range 0...  63 -->  6 bits)
                                               31 bits

Bit usage in the origin column:

30  20                     10                  0
1 0 9 8  7 6 5 4  3 2 1 0  9 8 7 6  5 4 3 2  1 0 9 8  7 6 5 4  3 2 1 0
  ^-X in slice-^  ^-----Y on trimmed CCD-----^ ^--IFU---^ ^--slice---^
(the highest bit stays empty)

The layout of these bits can change any time, so software using this should use the accessor functions muse_pixtable_origin_get_*() to decode required values.

Note
Several of the header keywords need to be changed when the data changes or parts of the table are erased!

Macro Definition Documentation

#define MUSE_HDR_PT_COMBINED   "ESO DRS MUSE PIXTABLE COMBINED" /* int */

Combined exposures that went into this pixel table

Definition at line 215 of file muse_pixtable.h.

Referenced by muse_xcombine_tables().

#define MUSE_HDR_PT_DAR_CHECK   "ESO DRS MUSE PIXTABLE DAR CHECK"

empirical DAR check done, found this maximum residual DAR offsets [arcsec]

Definition at line 192 of file muse_pixtable.h.

Referenced by muse_dar_check().

#define MUSE_HDR_PT_DAR_CORR   "ESO DRS MUSE PIXTABLE DAR CORRECT RESIDUAL"

empirical DAR correction done, relative to this reference wavelength [Angstrom]

Definition at line 195 of file muse_pixtable.h.

Referenced by muse_dar_check(), and muse_wcs_locate_sources().

#define MUSE_HDR_PT_DAR_NAME   "ESO DRS MUSE PIXTABLE DAR CORRECT"

theoretical DAR correction done with this reference wavelength [Angstrom]

Definition at line 188 of file muse_pixtable.h.

Referenced by muse_dar_check(), muse_dar_correct(), muse_resampling_euro3d(), and muse_wcs_locate_sources().

#define MUSE_HDR_PT_EXP_FST   "ESO DRS MUSE PIXTABLE EXP%u FIRST"

FITS header keyword defining the first row index for a given exposure.

Note
This keyword needs to be updated when rows are removed from the pixel table!

Definition at line 93 of file muse_pixtable.h.

Referenced by muse_pixtable_fix_exp_headers(), muse_pixtable_get_expnum(), and muse_xcombine_tables().

#define MUSE_HDR_PT_EXP_LST   "ESO DRS MUSE PIXTABLE EXP%u LAST"

FITS header keyword defining the last row index for a given exposure.

Note
This keyword needs to be updated when rows are removed from the pixel table!

Definition at line 98 of file muse_pixtable.h.

Referenced by muse_pixtable_fix_exp_headers(), muse_pixtable_get_expnum(), and muse_xcombine_tables().

#define MUSE_HDR_PT_FFCORR   "ESO DRS MUSE PIXTABLE FFCORR" /* int */

Flat-field corrected pixel table, number is the IFUs that had flat-fields

Definition at line 178 of file muse_pixtable.h.

Referenced by muse_flux_calibrate(), muse_pixtable_load_merge_channels(), muse_postproc_revert_ffspec_maybe(), muse_resampling_cube(), and muse_resampling_image().

#define MUSE_HDR_PT_FLUXCAL   "ESO DRS MUSE PIXTABLE FLUXCAL" /* bool */

Pixel table was flux-calibrated

Definition at line 201 of file muse_pixtable.h.

Referenced by muse_flux_calibrate(), and muse_pixtable_is_fluxcal().

#define MUSE_HDR_PT_IFU_SLICE_OFFSET   "ESO DRS MUSE PIXTABLE EXP%u IFU%02hu SLICE%02hu XOFFSET"

FITS header keyword for the horizontal slice offset on the CCD.

This FITS header entry is needed to transform the "origin" column back to CCD pixels. The "EXP" part is originally created with EXP0, signifying a single exposure. When multiple exposures are merged into a single pixel table, the EXP number is updated to reflect the exposure number for which this entry is to be used. See MUSE_HDR_PT_EXP_FST, MUSE_HDR_PT_EXP_LST.

Definition at line 74 of file muse_pixtable.h.

Referenced by muse_pixtable_origin_copy_offsets(), muse_pixtable_origin_get_offset(), and muse_pixtable_origin_set_offset().

#define MUSE_HDR_PT_IHI   "ESO DRS MUSE PIXTABLE LIMITS IFU HIGH"

FITS header keyword contains the highest IFU number in the data.

Note
This keyword needs to be updated whenever the data changes!

Definition at line 152 of file muse_pixtable.h.

Referenced by muse_pixtable_compute_limits().

#define MUSE_HDR_PT_ILLUM_MEAN   "ESO DRS MUSE PIXTABLE ILLUM MEAN"

illumination-correction statistics: mean

Definition at line 106 of file muse_pixtable.h.

Referenced by muse_basicproc_apply_illum().

#define MUSE_HDR_PT_ILLUM_REGEXP   "^ESO DRS MUSE PIXTABLE ILLUM"

regular expression to remove the illum values and statistics from a header

Definition at line 110 of file muse_pixtable.h.

Referenced by muse_pixtable_load_merge_channels().

#define MUSE_HDR_PT_ILLUM_STDEV   "ESO DRS MUSE PIXTABLE ILLUM STDEV"

illumination-correction statistics: stdev

Definition at line 108 of file muse_pixtable.h.

Referenced by muse_basicproc_apply_illum().

#define MUSE_HDR_PT_ILLUMi   "ESO DRS MUSE PIXTABLE ILLUM%hu"

illumination-correction (multiplication) factors for each slice

Definition at line 104 of file muse_pixtable.h.

Referenced by muse_basicproc_apply_illum().

#define MUSE_HDR_PT_ILO   "ESO DRS MUSE PIXTABLE LIMITS IFU LOW"

FITS header keyword contains the lowest IFU number in the data.

Note
This keyword needs to be updated whenever the data changes!

Definition at line 147 of file muse_pixtable.h.

Referenced by muse_pixtable_compute_limits().

#define MUSE_HDR_PT_LHI   "ESO DRS MUSE PIXTABLE LIMITS LAMBDA HIGH"

FITS header keyword contains the upper limit of the data in spectral direction.

Note
This keyword needs to be updated whenever the data changes!

Definition at line 142 of file muse_pixtable.h.

Referenced by muse_basicproc_shift_pixtable(), muse_pixtable_compute_limits(), muse_pixtable_restrict_wavelength(), muse_resampling_collapse_pixgrid(), muse_resampling_image(), muse_resampling_params_delete(), and muse_resampling_spectrum().

#define MUSE_HDR_PT_LLO   "ESO DRS MUSE PIXTABLE LIMITS LAMBDA LOW"

FITS header keyword contains the lower limit of the data in spectral direction.

Note
This keyword needs to be updated whenever the data changes!

Definition at line 137 of file muse_pixtable.h.

Referenced by muse_basicproc_shift_pixtable(), muse_pixtable_compute_limits(), muse_pixtable_restrict_wavelength(), muse_resampling_collapse_pixgrid(), muse_resampling_cube(), muse_resampling_image(), muse_resampling_params_delete(), and muse_resampling_spectrum().

#define MUSE_HDR_PT_MERGED   "ESO DRS MUSE PIXTABLE MERGED" /* int */

Merged IFUs that went into this pixel table

Definition at line 181 of file muse_pixtable.h.

Referenced by muse_pixtable_load_merge_channels().

#define MUSE_HDR_PT_PREDAR_XHI   "ESO DRS MUSE PIXTABLE PREDAR LIMITS XHI"

FITS header keyword contains the upper limit of the data in x-direction before DAR correction.

Definition at line 170 of file muse_pixtable.h.

Referenced by muse_dar_check(), muse_dar_correct(), and muse_wcs_project_tan().

#define MUSE_HDR_PT_PREDAR_XLO   "ESO DRS MUSE PIXTABLE PREDAR LIMITS XLO"

FITS header keyword contains the lower limit of the data in x-direction before DAR correction.

Definition at line 168 of file muse_pixtable.h.

Referenced by muse_dar_check(), muse_dar_correct(), and muse_wcs_project_tan().

#define MUSE_HDR_PT_PREDAR_YHI   "ESO DRS MUSE PIXTABLE PREDAR LIMITS YHI"

FITS header keyword contains the upper limit of the data in y-direction before DAR correction.

Definition at line 174 of file muse_pixtable.h.

Referenced by muse_dar_check(), muse_dar_correct(), and muse_wcs_project_tan().

#define MUSE_HDR_PT_PREDAR_YLO   "ESO DRS MUSE PIXTABLE PREDAR LIMITS YLO"

FITS header keyword contains the lower limit of the data in y-direction before DAR correction.

Definition at line 172 of file muse_pixtable.h.

Referenced by muse_dar_check(), muse_dar_correct(), and muse_wcs_project_tan().

#define MUSE_HDR_PT_RVCORR   "ESO DRS MUSE PIXTABLE RVCORR"

radial-velocity correction done, with the given velocity shift and reference

Definition at line 198 of file muse_pixtable.h.

Referenced by muse_pixtable_is_rvcorr(), and muse_rvcorrect().

#define MUSE_HDR_PT_SHI   "ESO DRS MUSE PIXTABLE LIMITS SLICE HIGH"

FITS header keyword contains the highest slice number in the data.

Note
This keyword needs to be updated whenever the data changes!

Definition at line 162 of file muse_pixtable.h.

Referenced by muse_pixtable_compute_limits().

#define MUSE_HDR_PT_SKYSUB   "ESO DRS MUSE PIXTABLE SKYSUB" /* bool */

Pixel table was sky-subtracted

Definition at line 184 of file muse_pixtable.h.

Referenced by muse_pixtable_is_skysub(), and muse_sky_subtract_lines_old().

#define MUSE_HDR_PT_SLO   "ESO DRS MUSE PIXTABLE LIMITS SLICE LOW"

FITS header keyword contains the lowest slice number in the data.

Note
This keyword needs to be updated whenever the data changes!

Definition at line 157 of file muse_pixtable.h.

Referenced by muse_pixtable_compute_limits().

#define MUSE_HDR_PT_SPEC_TYPE   "ESO DRS MUSE PIXTABLE SPECTYPE" /* string */

Spectral type code, set after converting from air to vacuum

Definition at line 218 of file muse_pixtable.h.

Referenced by muse_phys_air_to_vacuum().

#define MUSE_HDR_PT_TYPE   "ESO DRS MUSE PIXTABLE TYPE"

Pixel table "type" stored in the FITS header.

Can be either "GEOFULL" (for science use and 3D resampling) and "SIMPLE" for quick-look, tests, and calibration (2D resampling).

Definition at line 83 of file muse_pixtable.h.

Referenced by muse_pixtable_create(), and muse_pixtable_get_type().

#define MUSE_HDR_PT_WCS   "ESO DRS MUSE PIXTABLE WCS" /* string */

Spatial world coordinate transformation applied to this pixel table

Definition at line 204 of file muse_pixtable.h.

Referenced by muse_wcs_position_celestial(), and muse_wcs_project_tan().

#define MUSE_HDR_PT_WCS_POSI   "positioned (final)"

Value of MUSE_HDR_PT_WCS after positioning this pixel table to sky coordinates

Definition at line 209 of file muse_pixtable.h.

Referenced by muse_wcs_position_celestial().

#define MUSE_HDR_PT_WCS_PROJ   "projected (intermediate)"

Value of MUSE_HDR_PT_WCS with Gnomonic projection applied to this pixel table

Definition at line 206 of file muse_pixtable.h.

Referenced by muse_wcs_project_tan().

#define MUSE_HDR_PT_WEIGHTED   "ESO DRS MUSE PIXTABLE WEIGHTED" /* bool */

Pixel table was weighted relative to other exposures

Definition at line 212 of file muse_pixtable.h.

Referenced by muse_xcombine_weights().

#define MUSE_HDR_PT_XHI   "ESO DRS MUSE PIXTABLE LIMITS X HIGH"

FITS header keyword contains the upper limit of the data in x-ion.

Note
This keyword needs to be updated whenever the data changes!

Definition at line 122 of file muse_pixtable.h.

Referenced by muse_dar_check(), muse_dar_correct(), muse_pixtable_compute_limits(), muse_pixtable_restrict_xpos(), muse_resampling_params_delete(), and muse_wcs_project_tan().

#define MUSE_HDR_PT_XLO   "ESO DRS MUSE PIXTABLE LIMITS X LOW"

FITS header keyword contains the lower limit of the data in x-direction.

Note
This keyword needs to be updated whenever the data changes!

Definition at line 117 of file muse_pixtable.h.

Referenced by muse_dar_check(), muse_dar_correct(), muse_pixtable_compute_limits(), muse_pixtable_restrict_xpos(), muse_resampling_cube(), muse_resampling_params_delete(), and muse_wcs_project_tan().

#define MUSE_HDR_PT_YHI   "ESO DRS MUSE PIXTABLE LIMITS Y HIGH"

FITS header keyword contains the upper limit of the data in y-direction.

Note
This keyword needs to be updated whenever the data changes!

Definition at line 132 of file muse_pixtable.h.

Referenced by muse_dar_check(), muse_dar_correct(), muse_pixtable_compute_limits(), muse_pixtable_restrict_ypos(), muse_resampling_params_delete(), and muse_wcs_project_tan().

#define MUSE_HDR_PT_YLO   "ESO DRS MUSE PIXTABLE LIMITS Y LOW"

FITS header keyword contains the lower limit of the data in y-direction.

Note
This keyword needs to be updated whenever the data changes!

Definition at line 127 of file muse_pixtable.h.

Referenced by muse_dar_check(), muse_dar_correct(), muse_pixtable_compute_limits(), muse_pixtable_restrict_ypos(), muse_resampling_cube(), muse_resampling_params_delete(), and muse_wcs_project_tan().

#define MUSE_PIXTABLE_DATA   "data"
#define MUSE_PIXTABLE_DQ   "dq"
#define MUSE_PIXTABLE_FF_EXT   "PIXTABLE_FLAT_FIELD"

flat-field extension of a MUSE pixel table (optional)

Definition at line 59 of file muse_pixtable.h.

Referenced by muse_pixtable_append_ff(), and muse_pixtable_save().

#define MUSE_PIXTABLE_FFDATA   MUSE_PIXTABLE_DATA

wavelength column for the flat-field extension of a MUSE pixel table

Definition at line 61 of file muse_pixtable.h.

Referenced by muse_pixtable_load_merge_channels(), and muse_postproc_revert_ffspec_maybe().

#define MUSE_PIXTABLE_FFLAMBDA   MUSE_PIXTABLE_LAMBDA

wavelength column for the flat-field extension of a MUSE pixel table

Definition at line 60 of file muse_pixtable.h.

Referenced by muse_pixtable_load_merge_channels(), muse_pixtable_restrict_wavelength(), and muse_postproc_revert_ffspec_maybe().

#define MUSE_PIXTABLE_LAMBDA   "lambda"
#define MUSE_PIXTABLE_ORIGIN   "origin"
#define MUSE_PIXTABLE_STAT   "stat"
#define MUSE_PIXTABLE_WEIGHT   "weight"

weight column of a MUSE pixel table (optional)

Definition at line 56 of file muse_pixtable.h.

Referenced by muse_pixtable_dump(), muse_resampling_collapse_pixgrid(), muse_resampling_params_delete(), muse_resampling_spectrum(), and muse_xcombine_weights().

#define MUSE_PIXTABLE_XPOS   "xpos"
#define MUSE_PIXTABLE_YPOS   "ypos"

Enumeration Type Documentation

Type of a MUSE pixel table.

Enumerator
MUSE_PIXTABLE_TYPE_UNKNOWN 

Unknown type of pixel table

MUSE_PIXTABLE_TYPE_SIMPLE 

Pixel table with simple geometry information (no y coordinate)

MUSE_PIXTABLE_TYPE_FULL 

Pixel table with full geometry information

Definition at line 268 of file muse_pixtable.h.

State of the astrometric calibration of a MUSE pixel table.

Enumerator
MUSE_PIXTABLE_WCS_UNKNOWN 

Undefined state (or axes disagree)

MUSE_PIXTABLE_WCS_PIXEL 

Original pixel positions [pix]

MUSE_PIXTABLE_WCS_NATSPH 

Native spherical coordinates [rad]

MUSE_PIXTABLE_WCS_CELSPH 

Celestial spherical coordinates [deg]

Definition at line 293 of file muse_pixtable.h.

Function Documentation

cpl_error_code muse_pixtable_and_selected_mask ( muse_pixtable aPixtable,
muse_mask aMask 
)

Select all pixels where the (x,y) positions are enabled in the given mask.

Parameters
aPixtableThe pixel table
aMaskThe mask to select pixels
Returns
CPL_ERROR_NONE on success, another CPL error code on failure.

Pixels which are outside of the mask are not selected at all.

XXX This only works for WCS without rotation and with positions in pixels! It could be made more flexible by combining this with muse_wcs* functions instead of the custom projection-plane-to-pixel code used here.

Return values
CPL_ERROR_NULL_INPUT(aPixtable && aPixtable->table) not fulfilled
CPL_ERROR_NULL_INPUT(aMask) not fulfilled

Definition at line 2344 of file muse_pixtable.c.

References muse_mask::header, muse_mask::mask, muse_pfits_get_cd(), muse_pfits_get_crpix(), muse_pfits_get_crval(), MUSE_PIXTABLE_XPOS, MUSE_PIXTABLE_YPOS, and table.

Referenced by muse_postproc_process_exposure().

cpl_error_code muse_pixtable_append_ff ( muse_pixtable aPixtable,
muse_image aFF,
cpl_table *  aTrace,
cpl_table *  aWave,
float  aSampling 
)

Create flat-field spectrum and append to pixel table.

Parameters
aPixtableinput MUSE pixel table
aFFthe MUSE image containing a master-flat field exposure
aTracethe table containing the trace solution
aWavethe table containing the wavelength calibration solution
aSamplingthe sampling for the flat-field spectrum [Angstrom/pix]
Returns
CPL_ERROR_NONE on success or the relevant cpl_error_code on error

This function creates a pixel table from the input image (aFF) and tables (aTrace and aWave) using muse_pixtable_create(), and then resamples it to a spectrum table, using muse_resampling_spectrum(). The variance and quality columns or this spectrum are then discarded, the columns of the table created here are hence MUSE_PIXTABLE_FFLAMBDA and MUSE_PIXTABLE_FFDATA. The table is attached to the input pixel table (aPixtable) in the ffspec component.

Any table that is set in the ffspec component of the input pixel table before the call to this function is deleted.

Exceptions
set and return CPL_ERROR_NULL_INPUTaPixtable is NULL
propagate error code of muse_pixtable_create()muse_pixtable_create() fails

Definition at line 1030 of file muse_pixtable.c.

References ffspec, muse_pixtable_create(), muse_pixtable_delete(), MUSE_PIXTABLE_FF_EXT, muse_pixtable_get_nrow(), muse_resampling_spectrum(), and table.

cpl_error_code muse_pixtable_compute_limits ( muse_pixtable aPixtable)

(Re-)Compute the limits of the coordinate columns of a pixel table.

Parameters
aPixtablethe pixel table
Return values
CPL_ERROR_NONEon success

This function searches the pixel table for the extreme values of each coordinate. The limits it finds are returned in the header of the pixel table in the keywords containing "MUSEPT" (see muse_pixtable.h).

Exceptions
return CPL_ERROR_NULL_INPUTaPixtable or one of its components are NULL
return CPL_ERROR_DATA_NOT_FOUNDthe table component of aPixtable does not have a pixel table structure

Definition at line 1864 of file muse_pixtable.c.

References header, muse_cpltable_check(), MUSE_HDR_PT_IHI, MUSE_HDR_PT_ILO, MUSE_HDR_PT_LHI, MUSE_HDR_PT_LLO, MUSE_HDR_PT_SHI, MUSE_HDR_PT_SLO, MUSE_HDR_PT_XHI, MUSE_HDR_PT_XLO, MUSE_HDR_PT_YHI, MUSE_HDR_PT_YLO, muse_pfits_get_crval(), muse_pixtable_get_nrow(), MUSE_PIXTABLE_LAMBDA, MUSE_PIXTABLE_ORIGIN, MUSE_PIXTABLE_WCS_CELSPH, muse_pixtable_wcs_check(), MUSE_PIXTABLE_XPOS, MUSE_PIXTABLE_YPOS, and table.

Referenced by muse_dar_check(), muse_dar_correct(), muse_phys_air_to_vacuum(), muse_pixtable_create(), muse_pixtable_erase_ifu_slice(), muse_pixtable_extracted_get_slices(), muse_pixtable_load_merge_channels(), muse_pixtable_restrict_wavelength(), muse_pixtable_restrict_xpos(), muse_pixtable_restrict_ypos(), muse_wcs_position_celestial(), muse_wcs_project_tan(), and muse_xcombine_tables().

muse_pixtable* muse_pixtable_create ( muse_image aImage,
cpl_table *  aTrace,
cpl_table *  aWave,
cpl_table *  aGeoTable 
)

Create the pixel table for one CCD.

Parameters
aImagemuse_image to be transformed to a pixel table
aTracethe table containing the trace solution
aWavethe table containing the wavelength calibration solution
aGeoTableMUSE geometry table containing at least the IFU in question (optional)
Returns
the pixel table as muse_pixtable * or NULL in case of error.
Remarks
The returned object has to be deallocated using muse_pixtable_delete().
If aGeoTable is NULL, simple slice locations are used, such that slices are only horizontally offset but are assumed to have no vertical offset and no rotation. This is good if you plan to resample the pixel table to 2D image (spatial and wavelength axes) afterwards instead of a 3D cube (2 spatial, 1 wavelength axis).

Create the output table and table columns. Loop through all pixels in the input image. Evaluate, if the pixel is within a slice. If so, evaluate the respective wavelength solution, and the trace, and set the coordinates accordingly. Then set the pixel values (data, dq, and stat) to the values in the input image.

Quality Assessment:
If the input calibration tables are correct, this function will give correct results. The only non-trivial parts are already tested in muse_wave_map() where errors are easily seen in the output file.
Exceptions
set CPL_ERROR_DATA_NOT_FOUND, return NULLthe IFU number found in the input image header is not valid
set CPL_ERROR_INCOMPATIBLE_INPUT, return NULLno BUNIT is given in the header of aImage, or it is not "count"
set CPL_ERROR_NULL_INPUT, return NULLthe input image, the input wavelength calibration solution table, or the input trace solution table are NULL
use simple slice locationsthe input geometry table is NULL
set CPL_ERROR_ILLEGAL_INPUT, return NULLgeometry table is given but unusable (missing IFU or missing x or y columns)
set CPL_ERROR_BAD_FILE_FORMAT, and either continue with defaults (MUSE_EXPERT_USER) or return NULLgeometry table does not contain angle or width columns
set CPL_ERROR_ILLEGAL_INPUT, output error message, and either continue (MUSE_EXPERT_USER), skipping the related slice, or return NULLthe wavelength calibration table is invalid for a slice
set CPL_ERROR_ILLEGAL_INPUT, output error message, and either continue (MUSE_EXPERT_USER), skipping the related slice, or return NULLthe trace table is invalid for a slice
skip rest of that slice, output warningtrace table gives invalid results for one vertical position of a slice

Definition at line 569 of file muse_pixtable.c.

References muse_image::data, muse_image::dq, muse_image::header, header, muse_cpltable_new(), muse_geo_table_extract_ifu(), MUSE_HDR_PT_TYPE, muse_pfits_get_bunit(), muse_pixtable_compute_limits(), MUSE_PIXTABLE_DATA, muse_pixtable_delete(), MUSE_PIXTABLE_DQ, muse_pixtable_get_nrow(), MUSE_PIXTABLE_LAMBDA, MUSE_PIXTABLE_ORIGIN, muse_pixtable_origin_set_offset(), MUSE_PIXTABLE_STAT, MUSE_PIXTABLE_XPOS, MUSE_PIXTABLE_YPOS, muse_trace_polys_delete(), muse_trace_table_get_order(), muse_trace_table_get_polys_for_slice(), muse_utils_get_ifu(), muse_wave_table_get_orders(), muse_wave_table_get_poly_for_slice(), MUSE_WCS_KEYS, muse_image::stat, and table.

Referenced by muse_basicproc_get_illum(), muse_lsf_create_arcpixtable(), and muse_pixtable_append_ff().

void muse_pixtable_delete ( muse_pixtable aPixtable)

Deallocate memory associated to a pixel table object.

Parameters
aPixtableinput MUSE pixel table

Calls cpl_table_delete() and cpl_propertylist_delete() for the two components of a muse_pixtable, and frees memory for the aPixtable pointer. As a safeguard, it checks if a valid pointer was passed, so that crashes cannot occur.

Definition at line 981 of file muse_pixtable.c.

References ffspec, header, and table.

Referenced by muse_basicproc_get_illum(), muse_lsf_create_arcpixtable(), muse_pixtable_append_ff(), muse_pixtable_create(), muse_pixtable_load_merge_channels(), muse_pixtable_load_restricted_wavelength(), muse_pixtable_load_window(), muse_postproc_process_exposure(), and muse_xcombine_tables().

cpl_error_code muse_pixtable_dump ( muse_pixtable aPixtable,
cpl_size  aStart,
cpl_size  aCount,
unsigned char  aDisplayHeader 
)

Dump a MUSE pixel table to the screen, resolving the origin column.

Parameters
aPixtablethe pixel table
aStartfirst row to print (starting at 0)
aCountnumber of rows to print
aDisplayHeaderif 1, a header is displayed above the table; if greater than 1, it does not include units
Returns
CPL_ERROR_NONE on success, another CPL error code on failure.

This function basically does the same as cpl_table_dump(), with two differences: it can resolve the origin column to the real on-CCD origin and it can list exposures numbers that are only available in the pixel table headers.

It also tries to convert the CCD coordinates (after trimming) to raw CCD coordinates (before trimming). But this only works under the assumption that all over- and pre-scans are kMusePreOverscanSize pixels wide and each quadrant is (kMuseOutputXRight/2)x(kMuseOutputYTop/2) pixels in size.

Exceptions
return CPL_ERROR_NULL_INPUTaPixtable or one of its components is NULL
return CPL_ERROR_ILLEGAL_INPUTaStart is negative or larger than the number of rows in the table, or aCount is negative
return CPL_ERROR_BAD_FILE_FORMATone of the 6 mandatory columns is missing

Definition at line 2424 of file muse_pixtable.c.

References header, muse_pfits_get_crval(), MUSE_PIXTABLE_DATA, MUSE_PIXTABLE_DQ, muse_pixtable_get_expnum(), muse_pixtable_get_nrow(), MUSE_PIXTABLE_LAMBDA, MUSE_PIXTABLE_ORIGIN, muse_pixtable_origin_get_x(), MUSE_PIXTABLE_STAT, MUSE_PIXTABLE_WCS_CELSPH, muse_pixtable_wcs_check(), MUSE_PIXTABLE_WCS_NATSPH, MUSE_PIXTABLE_WEIGHT, MUSE_PIXTABLE_XPOS, MUSE_PIXTABLE_YPOS, muse_quadrants_coords_to_raw(), and table.

Referenced by muse_resampling_collapse_pixgrid(), and muse_resampling_params_delete().

muse_pixtable* muse_pixtable_duplicate ( muse_pixtable aPixtable)

Make a copy of the pixtanle.

Parameters
aPixtableMUSE pixel table
Returns
Pointer to the new table, or NULL in case of NULL input

The copy operation is done "in depth": column data are duplicated too, not just their pointers. Also the selection flags of the original table are transferred to the new table. The header of the pixel table are copied, too.

Note
Passing in a NULL argument causes no error to be raised, it just returns a NULL pointer.

Definition at line 959 of file muse_pixtable.c.

References header, and table.

Referenced by muse_postproc_process_exposure().

cpl_error_code muse_pixtable_erase_ifu_slice ( muse_pixtable aPixtable,
unsigned char  aIFU,
unsigned short  aSlice 
)

Erase pixel table rows related to one slice of one IFU.

Parameters
aPixtablethe pixel table
aIFUthe IFU number
aSlicethe slice number
Returns
CPL_ERROR_NONE on success, another CPL error code on failure.

This function selects all rows in the given pixel table which originated in aIFU and aSlice. Then all selected slices are erased.

Exceptions
return CPL_ERROR_NULL_INPUTaPixtable is NULL
return CPL_ERROR_DATA_NOT_FOUNDno rows found in aPixtable

Definition at line 2297 of file muse_pixtable.c.

References muse_pixtable_compute_limits(), muse_pixtable_fix_exp_headers(), muse_pixtable_get_nrow(), MUSE_PIXTABLE_ORIGIN, muse_pixtable_origin_get_ifu(), muse_pixtable_origin_get_slice(), and table.

void muse_pixtable_extracted_delete ( muse_pixtable **  aPixtables)

Delete a pixel table array.

Parameters
aPixtablesThe pixel table array.

This deletes only the array itself, not the columns, since they are shared with the "mother" pixel table.

See also
muse_pixtable_extract_slices()

Definition at line 2954 of file muse_pixtable.c.

Referenced by muse_basicproc_apply_illum(), muse_basicproc_load_reduced(), muse_lsf_create_arcpixtable(), muse_pixtable_from_imagelist(), muse_pixtable_spectrum_apply(), muse_pixtable_to_imagelist(), muse_resampling_image(), muse_sky_subtract_lines(), and muse_sky_subtract_lines_old().

cpl_size muse_pixtable_extracted_get_size ( muse_pixtable **  aPixtables)

Get the size of an array of extracted pixel tables.

Parameters
aPixtablesThe pixel table array.
Returns
The number of pixel tables in this array, a negative value on error.

Since the table array is NULL terminated, it just searches for the NULL entry.

Exceptions
set CPL_ERROR_NULL_INPUT, return NULLaPixtable is NULL

Definition at line 2932 of file muse_pixtable.c.

Referenced by muse_basicproc_apply_illum(), muse_basicproc_load_reduced(), muse_lsf_create_arcpixtable(), muse_pixtable_from_imagelist(), muse_pixtable_spectrum_apply(), muse_pixtable_to_imagelist(), muse_resampling_image(), muse_sky_subtract_lines(), and muse_sky_subtract_lines_old().

muse_pixtable** muse_pixtable_extracted_get_slices ( muse_pixtable aPixtable)

Extract one pixel table per IFU and slice.

Parameters
aPixtablethe pixel table
Returns
NULL terminated array of slice pixel tables or NULL on error

The pixel table is re-sorted for slice and IFU. The slice pixel tables are not copied from the original table but share the data in memory. So they should not be deleted individually but with the function muse_pixtable_extracted_delete().

Exceptions
set CPL_ERROR_NULL_INPUT, return NULLaPixtable is NULL

Definition at line 2834 of file muse_pixtable.c.

References header, muse_pixtable_compute_limits(), MUSE_PIXTABLE_LAMBDA, MUSE_PIXTABLE_ORIGIN, and table.

Referenced by muse_basicproc_apply_illum(), muse_basicproc_load_reduced(), muse_lsf_create_arcpixtable(), muse_pixtable_from_imagelist(), muse_pixtable_spectrum_apply(), muse_pixtable_to_imagelist(), muse_resampling_image(), muse_sky_subtract_lines(), and muse_sky_subtract_lines_old().

static cpl_error_code muse_pixtable_fix_exp_headers ( muse_pixtable aPixtable)
static

Fix the exposure ranges in the header of a pixel table.

Parameters
aPixtablethe pixel table
Return values
CPL_ERROR_NONEon success, another cpl_error_code on failure.

This function assumes that all selected rows are going to be erased, and resets the header keywords MUSE_HDR_PT_EXP_FST and MUSE_HDR_PT_EXP_LST accordingly.

Definition at line 2094 of file muse_pixtable.c.

References header, muse_cplpropertylist_update_long_long(), MUSE_HDR_PT_EXP_FST, MUSE_HDR_PT_EXP_LST, and table.

Referenced by muse_pixtable_erase_ifu_slice(), muse_pixtable_restrict_wavelength(), muse_pixtable_restrict_xpos(), and muse_pixtable_restrict_ypos().

cpl_error_code muse_pixtable_flux_multiply ( muse_pixtable aPixtable,
double  aScale 
)

Scale the flux of a pixel table with correct treatment of variance.

Parameters
aPixtablepixel table to be changed
aScalethe flux scale factor
Returns
CPL_ERROR_NONE on success, another cpl_error_code on failure

Scaling here is meant to be multiplicative with the input aScale factor.

This function assumes that the scale is corrective, so that it leaves keywords related to flux units untouched.

Exceptions
set and return CPL_ERROR_NULL_INPUTaPixtable or its table component are NULL

Definition at line 1946 of file muse_pixtable.c.

References MUSE_PIXTABLE_DATA, MUSE_PIXTABLE_STAT, and table.

Referenced by muse_pixtable_load_merge_channels(), and muse_xcombine_tables().

cpl_error_code muse_pixtable_from_imagelist ( muse_pixtable aPixtable,
muse_imagelist aList 
)

Get pixel table values back from a per-IFU imagelist.

Parameters
aPixtablethe pixel table
aListthe image list
Returns
CPL_ERROR_NONE on success, another CPL error code on failure.

This function basically does the inverse of muse_pixtable_to_imagelist(): it assumes that the input image list was created by that function, and processed in some way, that did not affect the pixel positions. Then it does the same split into per-IFU / per-slice subtables and reads the respective pixel values and their variance back from the images, using the location saved in the MUSE_PIXTABLE_ORIGIN column.

Note
This directly modifies the input pixel table, i.e. replaces the values in the two data columns.
The DQ values in the images in the list are ignored, the contents of the MUSE_PIXTABLE_DQ column of the pixel table remains unchanged.
Exceptions
return CPL_ERROR_NULL_INPUTaPixtable or its header component are NULL
return CPL_ERROR_ILLEGAL_INPUTaPixtable contains data from more than one exposure
return CPL_ERROR_INCOMPATIBLE_INPUTaPixtable and aList contain a different number of IFUs

Definition at line 2764 of file muse_pixtable.c.

References muse_image::data, header, muse_imagelist_get(), muse_imagelist_get_size(), MUSE_PIXTABLE_DATA, muse_pixtable_extracted_delete(), muse_pixtable_extracted_get_size(), muse_pixtable_extracted_get_slices(), muse_pixtable_get_expnum(), muse_pixtable_get_nrow(), MUSE_PIXTABLE_ORIGIN, muse_pixtable_origin_get_offset(), MUSE_PIXTABLE_STAT, and muse_image::stat.

unsigned int muse_pixtable_get_expnum ( muse_pixtable aPixtable,
cpl_size  aRow 
)

Get the exposure number of a given row in a pixel table.

Parameters
aPixtableThe pixel table to query.
aRowThe row index (starting at zero).
Returns
The exposure number, or 0 on error or if no exposure info was present in the pixel table.
Exceptions
set CPL_ERROR_NULL_INPUT, return 0input pixel table or its header component are NULL
set CPL_ERROR_ILLEGAL_INPUT, return 0the row index is negative or beyond the table length
set CPL_ERROR_ILLEGAL_OUTPUT, return 0output exposure number does not agree with low/high boundaries

Definition at line 451 of file muse_pixtable.c.

References header, MUSE_HDR_PT_EXP_FST, MUSE_HDR_PT_EXP_LST, and muse_pixtable_get_nrow().

Referenced by muse_pixtable_dump(), muse_pixtable_from_imagelist(), muse_pixtable_origin_get_x(), and muse_pixtable_to_imagelist().

cpl_size muse_pixtable_get_nrow ( const muse_pixtable aPixtable)
int muse_pixtable_get_type ( muse_pixtable aPixtable)

Determine the type of pixel table.

Parameters
aPixtablethe pixel table to query
Returns
a muse_pixtable_type on success or MUSE_PIXTABLE_TYPE_UNKNOWN on failure
Exceptions
set CPL_ERROR_NULL_INPUT, return MUSE_PIXTABLE_TYPE_UNKNOWNaPixtable is NULL
return MUSE_PIXTABLE_TYPE_UNKNOWN, propagate CPL error codecpl_propertylist_get_string fails to return the header parameter

Definition at line 1803 of file muse_pixtable.c.

References header, MUSE_HDR_PT_TYPE, MUSE_PIXTABLE_TYPE_FULL, MUSE_PIXTABLE_TYPE_SIMPLE, and MUSE_PIXTABLE_TYPE_UNKNOWN.

Referenced by muse_pixtable_load_window(), muse_resampling_cube(), and muse_resampling_image().

cpl_boolean muse_pixtable_is_fluxcal ( muse_pixtable aPixtable)

Determine whether the pixel table is flux calibrated.

Parameters
aPixtablethe pixel table
Returns
CPL_TRUE if the pixel table is flux calibrated.
Exceptions
set CPL_ERROR_NULL_INPUT, return CPL_FALSEaPixtable is NULL

Definition at line 2562 of file muse_pixtable.c.

References header, and MUSE_HDR_PT_FLUXCAL.

cpl_boolean muse_pixtable_is_rvcorr ( muse_pixtable aPixtable)

Determine whether the pixel table is radial-velocity corrected.

Parameters
aPixtablethe pixel table
Returns
CPL_TRUE if the pixel table is radial-velocity corrected.
Exceptions
set CPL_ERROR_NULL_INPUT, return CPL_FALSEaPixtable is NULL

Definition at line 2602 of file muse_pixtable.c.

References header, and MUSE_HDR_PT_RVCORR.

Referenced by muse_xcombine_tables().

cpl_boolean muse_pixtable_is_skysub ( muse_pixtable aPixtable)

Determine whether the pixel table is sky subtracted.

Parameters
aPixtablethe pixel table
Returns
CPL_TRUE if the pixel table is sky subtracted.
Exceptions
set CPL_ERROR_NULL_INPUT, return CPL_FALSEaPixtable is NULL

Definition at line 2582 of file muse_pixtable.c.

References header, and MUSE_HDR_PT_SKYSUB.

muse_pixtable* muse_pixtable_load ( const char *  aFilename)

Load the table itself and the FITS headers of a MUSE pixel table from a file.

Parameters
aFilenamename of the file to load
Returns
a new muse_pixtable * or NULL on error
Remarks
The new table has to be deallocated using muse_pixtable_delete().

This function tries to load the header from the FITS file and uses that to query the full length of the table before it calls muse_pixtable_load_window() to actually load the complete pixel table.

See muse_pixtable_load_window() for the behavior regaring the flat-field spectrum.

Exceptions
return NULL, propagate CPL error codeloading the binary table header fails
return NULL, propagate CPL error codemuse_pixtable_load_window() fails

Definition at line 1476 of file muse_pixtable.c.

References muse_pixtable_load_window().

Referenced by muse_pixtable_load_restricted_wavelength().

muse_pixtable* muse_pixtable_load_merge_channels ( cpl_table *  aExposureList,
double  aLambdaMin,
double  aLambdaMax 
)

Load and merge the pixel tables of the 24 MUSE sub-fields.

Parameters
aExposureListthe one-row table listing all pixel table filenames
aLambdaMinlow wavelength limit [Angstrom]
aLambdaMaxhigh wavelength limit [Angstrom]
Returns
a muse_pixtable * containing the merged pixel table
Remarks
Uses the FITS header keyword ESO.DRS.MUSE.FLAT.FLUX.{SKY,LAMP} of all input pixel table headers to determine the relative flat-field level of each sub-field. This keyword is set by the routine that applies the flat-field exposure to other exposures.
This function adds a FITS header (MUSE_HDR_PT_MERGED) with the number of merged IFUs to the pixel table, for information.

This function simply loops through all filenames and loads the corresponding pixel table. For each pixel table it loops through all pixels and copies the data values into the output table. It uses the flat-field level relative to the first exposure to scale the data values across sub-fields to a common level.

If the pixel tables have an attached flat-field spectrum, this is averaged over all exposures involved and applied to the merged pixel table. If only a subset of exposures comes with this flat-field spectrum, the function fails. The output flat-field spectrum is cut to about the same wavelength range as the pixel table itself, but keeping an approximate MUSE resolution element extra on each side, in case further resampling is necessary. If the flat-field spectrum was applied to the pixel table (i.e. it was taken out of the data), the keyword MUSE_HDR_PT_FFCORR is set in the header of the output pixel table, as value it contains the number of pixel tables merged.

Quality Assessment:
The basic operation of this routine is simple and will be tested using small and simple input tables. To be able to visually see the resulting table, one of the muse_resampling_<format> functions has to be used first, to create an output datacube.
Exceptions
leave the corresponding pixels out of the output table, output warning, but return the otherwise combined tableone or more of the input pixel tables of one exposure are missing
set CPL_ERROR_INCOMPATIBLE_INPUT, return NULLone or more of the input pixel tables correspond to data taken in a different instrument mode
set CPL_ERROR_ILLEGAL_INPUT, return NULLthe number of input pixel tables is different from the pixel tables with flat-field spectrum attached
propagate error, return partial pixel tableloading one of the input pixel tables fails
set CPL_ERROR_FILE_NOT_FOUND, return NULLnone of the pixel tables given in aExposureList could be loaded

Definition at line 1582 of file muse_pixtable.c.

References ffspec, header, muse_cplarray_interpolate_table_linear(), muse_cpltable_copy_array(), MUSE_HDR_PT_FFCORR, MUSE_HDR_PT_ILLUM_REGEXP, MUSE_HDR_PT_MERGED, muse_pixtable_compute_limits(), muse_pixtable_delete(), MUSE_PIXTABLE_FFDATA, MUSE_PIXTABLE_FFLAMBDA, muse_pixtable_flux_multiply(), muse_pixtable_get_nrow(), muse_pixtable_load_restricted_wavelength(), muse_pixtable_origin_copy_offsets(), muse_pixtable_spectrum_apply(), and table.

Referenced by muse_postproc_process_exposure().

muse_pixtable* muse_pixtable_load_restricted_wavelength ( const char *  aFilename,
double  aLambdaMin,
double  aLambdaMax 
)

Load a pixel table from file and cut down the wavelength range.

Parameters
aFilenamename of the file to load
aLambdaMinlow wavelength limit [Angstrom]
aLambdaMaxhigh wavelength limit [Angstrom]
Returns
a new muse_pixtable * or NULL on error

Just a wrapper for muse_pixtable_load() followed by muse_pixtable_restrict_wavelength() and a few checks.

Exceptions
return NULL, propagate CPL error codemuse_pixtable_load() fails
return NULL, propagate CPL error codemuse_pixtable_restrict_wavelength() fails
set CPL_ERROR_DATA_NOT_FOUND, return NULLgiven reange is too short, no pixels are left

Definition at line 1510 of file muse_pixtable.c.

References muse_pixtable_delete(), muse_pixtable_get_nrow(), muse_pixtable_load(), and muse_pixtable_restrict_wavelength().

Referenced by muse_pixtable_load_merge_channels().

muse_pixtable* muse_pixtable_load_window ( const char *  aFilename,
cpl_size  aStart,
cpl_size  aNRows 
)

Load a range of rows from the table and all the FITS headers of a MUSE pixel table from a file.

Parameters
aFilenamename of the file to load
aStartfirst table row index to read (starting at zero)
aNRowsmaximum number of rows to load
Returns
a new muse_pixtable * or NULL on error
Remarks
The new table has to be deallocated using muse_pixtable_delete().

The primary FITS header is loaded into the header element using cpl_propertylist_load(). Then cpl_table_load_window() is used to allocate and load the table elements of a muse_pixtable from the input FITS file.

It also loads the extension with extension name MUSE_PIXTABLE_FF_EXT as table, and stores the content in the ffspec component. If this does not exist, this component remains NULL. If this extension exists but cannot be loaded, a warning is printed but no error is set, since this is not a critical failure.

Exceptions
return NULL, propagate CPL error codecpl_propertylist_load fails (this handles the case of an invalid or empty filename)
return NULL, propagate CPL error codecpl_table_load fails to load table contents

Definition at line 1403 of file muse_pixtable.c.

References header, muse_cpltable_check(), muse_pixtable_delete(), muse_pixtable_get_type(), MUSE_PIXTABLE_TYPE_UNKNOWN, and table.

Referenced by muse_pixtable_load().

cpl_error_code muse_pixtable_origin_copy_offsets ( muse_pixtable aOut,
muse_pixtable aFrom,
unsigned int  aNum 
)

Copy MUSE_HDR_PT_IFU_SLICE_OFFSET keywords between pixel tables.

Parameters
aOutoutput MUSE pixel table (can be input pixel table)
aFromoptional input MUSE pixel table (can be NULL)
aNumthe exposure number to set in place of 0

This can be used to set the exposure number of MUSE_HDR_PT_IFU_SLICE_OFFSET header keywords or to copy them around between different pixel tables with the exposure number staying zero.

Loop through all possible IFU and slice numbers, copy the FITS keyword and value and delete the old one.

If aFrom is NULL, then all keywords are copied/moved within the one respective property list. If aFrom is a valid pixel table, the output entries are copied from there, with the exposure number corrected.

Exceptions
return CPL_ERROR_NULL_INPUTaOut or its header component are NULL

Definition at line 397 of file muse_pixtable.c.

References header, and MUSE_HDR_PT_IFU_SLICE_OFFSET.

Referenced by muse_pixtable_load_merge_channels(), and muse_xcombine_tables().

uint32_t muse_pixtable_origin_encode ( unsigned int  aX,
unsigned int  aY,
unsigned short  aIFU,
unsigned short  aSlice,
unsigned int  aOffset 
)

Encode the three CCD coordinates defining the origin of one MUSE pixel into a 32bit integer.

Parameters
aXThe horizontal coordinate of the origin.
aYThe vertical coordinate of the origin.
aIFUThe IFU number where this pixel originated.
aSliceThe slice number where this pixel originated.
aOffsetThe offset of the slice on the CCD.
Returns
The encoded (32bit) unsigned integer or 0 on error.

aX and aY and aOffset have to be above 0 and below 8192; valid aIFU numbers are between 1 and 24, valid slice numbers between 1 and 48.

Exceptions
set CPL_ERROR_ILLEGAL_INPUT, return 0aX, aY, aIFU, aSlice, or aOffset are out of range

Definition at line 167 of file muse_pixtable.c.

unsigned short muse_pixtable_origin_get_ifu ( uint32_t  aOrigin)

Get the IFU number from the encoded 32bit origin number.

Parameters
aOriginThe encoded (32bit) integer.
Returns
The decoded IFU number or 0 on error.
Exceptions
set CPL_ERROR_ILLEGAL_OUTPUT, return 0decoded IFU number is out of range

Definition at line 268 of file muse_pixtable.c.

Referenced by muse_lsf_average_cube_all(), muse_lsf_check_arc_line(), muse_lsf_fit_slice(), muse_lsf_params_fit(), muse_pixtable_erase_ifu_slice(), muse_resampling_params_delete(), muse_sky_subtract_lines(), and muse_sky_subtract_lines_old().

unsigned int muse_pixtable_origin_get_offset ( muse_pixtable aPixtable,
unsigned int  aExpNum,
unsigned short  aIFU,
unsigned short  aSlice 
)

Get the slice offset from the pixel table header.

Parameters
aPixtableThe pixel table.
aExpNumThe relevant exposure number.
aIFUThe relevant IFU number.
aSliceThe relevant slice number.
Returns
The decoded slice offset or 0 on error.

If the exposure number aExpNum is unknown, pass 0.

Exceptions
set CPL_ERROR_ILLEGAL_OUTPUT, return 0decoded slice offset is out of range or header keyword missing for this combination of aExpNum/aIFU/aSlice

Definition at line 355 of file muse_pixtable.c.

References header, and MUSE_HDR_PT_IFU_SLICE_OFFSET.

Referenced by muse_pixtable_from_imagelist(), muse_pixtable_origin_get_x(), and muse_pixtable_to_imagelist().

unsigned short muse_pixtable_origin_get_slice ( uint32_t  aOrigin)

Get the slice number from the encoded 32bit origin number.

Parameters
aOriginThe encoded (32bit) integer.
Returns
The decoded slice number or 0 on error.
Exceptions
set CPL_ERROR_ILLEGAL_OUTPUT, return 0decoded slice number is out of range

Definition at line 290 of file muse_pixtable.c.

Referenced by muse_basicproc_apply_illum(), muse_basicproc_load_reduced(), muse_lsf_average_cube_all(), muse_lsf_check_arc_line(), muse_lsf_fit_slice(), muse_lsf_params_fit(), muse_pixtable_erase_ifu_slice(), muse_sky_subtract_lines(), and muse_sky_subtract_lines_old().

unsigned int muse_pixtable_origin_get_x ( uint32_t  aOrigin,
muse_pixtable aPixtable,
cpl_size  aRow 
)

Get the horizontal coordinate from the encoded 32bit origin number.

Parameters
aOriginThe encoded (32bit) unsigned integer.
aPixtableThe pixel table itself, the header component is needed to find the slice offset.
aRowThe row index (starting at zero).
Returns
The decoded x coordinate or 0 on error.

The row index is needed because the horizontal position on a CCD is measured within each slice and the offset of each slice may depend on the exposure number and the IFU. If the row index is unknown or does not matter (because the pixel table only contains one exposure of one IFU), pass a negative number.

Exceptions
set CPL_ERROR_ILLEGAL_OUTPUT, return 0decoded horizontal coordinate value is out of range

Definition at line 212 of file muse_pixtable.c.

References muse_pixtable_get_expnum(), and muse_pixtable_origin_get_offset().

Referenced by muse_pixtable_dump(), and muse_resampling_params_delete().

unsigned int muse_pixtable_origin_get_y ( uint32_t  aOrigin)

Get the vertical coordinate from the encoded 32bit origin number.

Parameters
aOriginThe encoded (32bit) integer.
Returns
The decoded y coordinate or 0 on error.
Exceptions
set CPL_ERROR_ILLEGAL_OUTPUT, return 0decoded vertical coordinate value is out of range

Definition at line 246 of file muse_pixtable.c.

Referenced by muse_resampling_params_delete().

unsigned int muse_pixtable_origin_set_offset ( muse_pixtable aPixtable,
cpl_polynomial *  aLTrace,
unsigned short  aIFU,
unsigned short  aSlice 
)

Set the slice offset from the pixel table header.

Parameters
aPixtableThe pixel table.
aLTraceThe tracing polynomial for the left edge of the slice.
aIFUThe relevant IFU number.
aSliceThe relevant slice number.
Returns
The computed slice offset or 0 on error.

This function computes the offset for a given slice of a given IFU, using the trace function, and stores it in the FITS header of the pixel table.

Exceptions
set CPL_ERROR_NULL_INPUT, return 0pixel table or its header are NULL
propagate CPL error, return 0trace polynomial could not be evalutated

Definition at line 320 of file muse_pixtable.c.

References header, and MUSE_HDR_PT_IFU_SLICE_OFFSET.

Referenced by muse_pixtable_create().

cpl_error_code muse_pixtable_reset_dq ( muse_pixtable aPixtable,
unsigned int  aDQ 
)

Reset a given bad pixel status (DQ flag) for all pixels in the table.

Parameters
aPixtablethe pixel table
aDQthe (Euro3D) flag to reset
Returns
CPL_ERROR_NONE on success, another CPL error code on failure.
Exceptions
return CPL_ERROR_NULL_INPUTaPixtable is NULL

Definition at line 2619 of file muse_pixtable.c.

References MUSE_PIXTABLE_DQ, muse_pixtable_get_nrow(), and table.

Referenced by muse_dar_check(), muse_resampling_spectrum_iterate(), and muse_wcs_locate_sources().

cpl_error_code muse_pixtable_restrict_wavelength ( muse_pixtable aPixtable,
double  aLow,
double  aHigh 
)

Restrict a pixel table to a certain wavelength range.

Parameters
aPixtablethe pixel table
aLowlow wavelength limit [Angstrom]
aHighhigh wavelength limit [Angstrom]
Return values
CPL_ERROR_NONEEverything went OK.

Cut the data in the pixel table to the exact range [aLow, aHigh].

If it exists cut the ffspec component of aPixtable to [aLow-2.5, aHigh+2.5] to allow for more interpolation at the edges.

The exact wavelength range of entries left in aPixtable->table (and aPixtable->ffspec) of course depends on the incoming entries.

Exceptions
set CPL_ERROR_NULL_INPUT, return NULL(aPixtable && aPixtable->table) not fulfilled

Definition at line 2163 of file muse_pixtable.c.

References ffspec, header, MUSE_HDR_PT_LHI, MUSE_HDR_PT_LLO, muse_pixtable_compute_limits(), MUSE_PIXTABLE_FFLAMBDA, muse_pixtable_fix_exp_headers(), MUSE_PIXTABLE_LAMBDA, and table.

Referenced by muse_basicproc_load_reduced(), muse_pixtable_load_restricted_wavelength(), and muse_sky_subtract_continuum().

cpl_error_code muse_pixtable_restrict_xpos ( muse_pixtable aPixtable,
double  aLo,
double  aHi 
)

Restrict a pixel table to a certain x coordinate range.

Parameters
aPixtablethe pixel table
aLolow xpos limit
aHihigh xpos limit
Returns
CPL_ERROR_NONE on success, another CPL error code on failure.
Exceptions
return CPL_ERROR_NULL_INPUTaPixtable or one of its components is NULL

Definition at line 2214 of file muse_pixtable.c.

References header, MUSE_HDR_PT_XHI, MUSE_HDR_PT_XLO, muse_pfits_get_crval(), muse_pixtable_compute_limits(), muse_pixtable_fix_exp_headers(), MUSE_PIXTABLE_WCS_CELSPH, muse_pixtable_wcs_check(), MUSE_PIXTABLE_XPOS, and table.

cpl_error_code muse_pixtable_restrict_ypos ( muse_pixtable aPixtable,
double  aLo,
double  aHi 
)

Restrict a pixel table to a certain y coordinate range.

Parameters
aPixtablethe pixel table
aLolow ypos limit
aHihigh ypos limit
Returns
CPL_ERROR_NONE on success, another CPL error code on failure.
Exceptions
return CPL_ERROR_NULL_INPUTaPixtable or one of its components is NULL

Definition at line 2254 of file muse_pixtable.c.

References header, MUSE_HDR_PT_YHI, MUSE_HDR_PT_YLO, muse_pfits_get_crval(), muse_pixtable_compute_limits(), muse_pixtable_fix_exp_headers(), MUSE_PIXTABLE_WCS_CELSPH, muse_pixtable_wcs_check(), MUSE_PIXTABLE_YPOS, and table.

cpl_error_code muse_pixtable_save ( muse_pixtable aPixtable,
const char *  aFilename 
)

Save a MUSE pixel table to a file on disk.

Parameters
aPixtableinput MUSE pixel table
aFilenamename of the output file
Returns
CPL_ERROR_NONE on success or the relevant cpl_error_code on error

Simply calls cpl_propertylist_save() using the keywords in the header element of the muse_pixtable structure for construction of the primary header.

If the environment variable MUSE_PIXTABLE_SAVE_AS_TABLE is set to a positive integer, the pixel table is saved as FITS binary table using cpl_table_save(). Otherwise all columns are saved as separate FITS image extensions where the table column names are converted to EXTNAME of each extension and the column units are saved as BUNIT.

Exceptions
set and return CPL_ERROR_NULL_INPUTaPixtable is NULL
set error message, propagate CPL error codefailure to save headers
propagate CPL error codefailure to save table

Definition at line 1191 of file muse_pixtable.c.

References ffspec, header, muse_pfits_get_bunit(), muse_pfits_get_extname(), muse_pfits_get_naxis(), MUSE_PIXTABLE_DATA, MUSE_PIXTABLE_FF_EXT, and table.

Referenced by muse_flux_integrate_std(), muse_processing_save_table(), and muse_wcs_locate_sources().

cpl_error_code muse_pixtable_spectrum_apply ( muse_pixtable aPixtable,
const cpl_array *  aLambdas,
const cpl_array *  aFlux,
muse_pixtable_operation  aOperation 
)

Apply a spectrum given by two arrays with an operation to a pixel table.

Parameters
aPixtablepixel table to be changed
aLambdaswavelength array of the spectrum
aFluxflux array of the spectrum
aOperationthe operation to be performed
Returns
CPL_ERROR_NONE on success, another cpl_error_code on failure

Supported operations so far are MUSE_PIXTABLE_OPERATION_SUBTRACT, MUSE_PIXTABLE_OPERATION_MULTIPLY, and MUSE_PIXTABLE_OPERATION_DIVIDE, any other aOperation leads to an error.

The arrays aLambdas and aFlux are expected to be of type CPL_TYPE_DOUBLE, and have to have the same lengths. These arrays are used to linearly interpolate the spectrum to the exact wavelengths of the pixels in the pixel table before applying the values to all pixels with the given aOperation.

This function assumes that the operation is corrective, so that it leaves keywords related to flux units untouched.

Exceptions
set and return CPL_ERROR_NULL_INPUTaPixtable or its table component are NULL
set and return CPL_ERROR_NULL_INPUTaLambdas and/or aFlux are NULL
set and return CPL_ERROR_ILLEGAL_INPUTthe lengths of aLambdas and/or aFlux are not equal or not positive
set and return CPL_ERROR_INCOMPATIBLE_INPUTthe types of aLambdas and/or aFlux are not CPL_TYPE_DOUBLE
set and return CPL_ERROR_UNSUPPORTED_MODEaOperation is not MUSE_PIXTABLE_OPERATION_SUBTRACT or MUSE_PIXTABLE_OPERATION_MULTIPLY

Definition at line 1994 of file muse_pixtable.c.

References muse_cplarray_interpolate_linear(), muse_cpltable_extract_column(), MUSE_PIXTABLE_DATA, muse_pixtable_extracted_delete(), muse_pixtable_extracted_get_size(), muse_pixtable_extracted_get_slices(), MUSE_PIXTABLE_LAMBDA, MUSE_PIXTABLE_STAT, and table.

Referenced by muse_pixtable_load_merge_channels(), muse_postproc_revert_ffspec_maybe(), and muse_sky_subtract_continuum().

muse_imagelist* muse_pixtable_to_imagelist ( muse_pixtable aPixtable)

Project a pixel table with data from one IFU back onto its image.

Parameters
aPixtablethe pixel table
Returns
A muse_imagelist on success or NULL on error.

For each processed slice, an approximation of its horizontal center is written to the header of the respective image, in the form ESO.DRS.MUSE.SLICEi.CENTER (as float). The DQ extension for the gaps between slices and for locations not recorded in the input pixel table is set to EURO3D_MISSDATA.

Exceptions
set CPL_ERROR_NULL_INPUT, return NULLaPixtable or its header component are NULL
set CPL_ERROR_ILLEGAL_INPUT, return NULLaPixtable contains data from more than one exposure

Definition at line 2654 of file muse_pixtable.c.

References muse_image::data, muse_image::dq, muse_image::header, header, muse_image_new(), muse_imagelist_new(), muse_imagelist_set(), MUSE_PIXTABLE_DATA, MUSE_PIXTABLE_DQ, muse_pixtable_extracted_delete(), muse_pixtable_extracted_get_size(), muse_pixtable_extracted_get_slices(), muse_pixtable_get_expnum(), muse_pixtable_get_nrow(), MUSE_PIXTABLE_ORIGIN, muse_pixtable_origin_get_offset(), MUSE_PIXTABLE_STAT, and muse_image::stat.

muse_pixtable_wcs muse_pixtable_wcs_check ( muse_pixtable aPixtable)

Check the state of the world coordinate system of a pixel table.

Parameters
aPixtablethe pixel table
Returns
the WCS state or MUSE_PIXTABLE_WCS_UNKNOWN on error

This function check the column units of the MUSE_PIXTABLE_XPOS and MUSE_PIXTABLE_YPOS pixel table columns, to check the state of the WCS of the pixel table. If no column unit was set at all or xpos and ypos have different units, someone fiddled with the pixel table. In that case, we may get unwanted side effects, so set an error state.

Exceptions
set CPL_ERROR_NULL_INPUT, return MUSE_PIXTABLE_WCS_UNKNOWNaPixtable is NULL
set CPL_ERROR_DATA_NOT_FOUND, return MUSE_PIXTABLE_WCS_UNKNOWNcoordinate column without unit or not present
set CPL_ERROR_INCOMPATIBLE_INPUT, return MUSE_PIXTABLE_WCS_UNKNOWNcoordinate column units for x and y are different
set CPL_ERROR_ILLEGAL_INPUT, return MUSE_PIXTABLE_WCS_UNKNOWNcoordinate column unit is neither "pix" nor "deg" or "rad"

Definition at line 2527 of file muse_pixtable.c.

References MUSE_PIXTABLE_WCS_CELSPH, MUSE_PIXTABLE_WCS_NATSPH, MUSE_PIXTABLE_WCS_PIXEL, MUSE_PIXTABLE_WCS_UNKNOWN, MUSE_PIXTABLE_XPOS, MUSE_PIXTABLE_YPOS, and table.

Referenced by muse_dar_check(), muse_dar_correct(), muse_pixgrid_create(), muse_pixtable_compute_limits(), muse_pixtable_dump(), muse_pixtable_restrict_xpos(), muse_pixtable_restrict_ypos(), muse_resampling_collapse_pixgrid(), muse_resampling_cube(), muse_resampling_euro3d(), muse_resampling_image(), muse_resampling_params_delete(), muse_wcs_position_celestial(), muse_wcs_project_tan(), and muse_xcombine_tables().

Variable Documentation

const muse_cpltable_def muse_pixtable_def[]

MUSE pixel table definition.

The MUSE pixel table has the following columns:

  • 'xpos': the relative x-pixel position in the output datacube
  • 'ypos': the relative y-pixel position in the output datacube
  • 'lambda': wavelength of this pixel
  • 'data': the data value in this pixel, this is in count (= electrons) units at time of table creation
  • 'dq': the Euro3D bad pixel status of this pixel
  • 'stat': the data variance of this pixel, in count**2 (= electrons**2) units at time of table creation
  • 'origin': encoded value of IFU and slice number, as well as x and y position in the raw (trimmed) data

It may additionally contain a column 'weight' which per-pixel weight information to be used for resampling.

Definition at line 502 of file muse_pixtable.c.

Referenced by muse_lsf_create_arcpixtable(), muse_phys_air_to_vacuum(), muse_resampling_spectrum(), muse_resampling_spectrum_iterate(), muse_sky_subtract_continuum(), and muse_sky_subtract_lines().

const muse_cpltable_def muse_pixtable_def[]
Initial value:
= {
{ MUSE_PIXTABLE_XPOS, CPL_TYPE_FLOAT, "pix", "%7.2f",
"relative x-pixel position in the output datacube", CPL_TRUE},
{ MUSE_PIXTABLE_YPOS, CPL_TYPE_FLOAT, "pix", "%7.2f",
"relative y-pixel position in the output datacube", CPL_TRUE},
{ MUSE_PIXTABLE_LAMBDA, CPL_TYPE_FLOAT, "Angstrom", "%8.2f",
"wavelength of this pixel", CPL_TRUE},
{ MUSE_PIXTABLE_DATA, CPL_TYPE_FLOAT, "count", "%e",
"data value in this pixel", CPL_TRUE},
{ MUSE_PIXTABLE_DQ, CPL_TYPE_INT, NULL, "%#x",
"Euro3D bad pixel status of this pixel", CPL_TRUE},
{ MUSE_PIXTABLE_STAT, CPL_TYPE_FLOAT, "count**2", "%e",
"data variance of this pixel", CPL_TRUE},
{ MUSE_PIXTABLE_ORIGIN, CPL_TYPE_INT, NULL, "0x%08x",
"encoded value of IFU and slice number, as well as x and y "
"position in the raw (trimmed) data", CPL_TRUE},
{ NULL, 0, NULL, NULL, NULL, CPL_FALSE }
}
#define MUSE_PIXTABLE_DQ
Definition: muse_pixtable.h:49
#define MUSE_PIXTABLE_XPOS
Definition: muse_pixtable.h:51
#define MUSE_PIXTABLE_DATA
Definition: muse_pixtable.h:48
#define MUSE_PIXTABLE_ORIGIN
Definition: muse_pixtable.h:54
#define MUSE_PIXTABLE_STAT
Definition: muse_pixtable.h:50
#define MUSE_PIXTABLE_LAMBDA
Definition: muse_pixtable.h:53
#define MUSE_PIXTABLE_YPOS
Definition: muse_pixtable.h:52

MUSE pixel table definition.

The MUSE pixel table has the following columns:

  • 'xpos': the relative x-pixel position in the output datacube
  • 'ypos': the relative y-pixel position in the output datacube
  • 'lambda': wavelength of this pixel
  • 'data': the data value in this pixel, this is in count (= electrons) units at time of table creation
  • 'dq': the Euro3D bad pixel status of this pixel
  • 'stat': the data variance of this pixel, in count**2 (= electrons**2) units at time of table creation
  • 'origin': encoded value of IFU and slice number, as well as x and y position in the raw (trimmed) data

It may additionally contain a column 'weight' which per-pixel weight information to be used for resampling.

Definition at line 502 of file muse_pixtable.c.

Referenced by muse_lsf_create_arcpixtable(), muse_phys_air_to_vacuum(), muse_resampling_spectrum(), muse_resampling_spectrum_iterate(), muse_sky_subtract_continuum(), and muse_sky_subtract_lines().