22 #ifndef MUSE_PIXTABLE_H 23 #define MUSE_PIXTABLE_H 32 #include "muse_image.h" 33 #include "muse_imagelist.h" 34 #include "muse_mask.h" 35 #include "muse_cplwrappers.h" 41 typedef unsigned int uint32_t;
48 #define MUSE_PIXTABLE_DATA "data" 49 #define MUSE_PIXTABLE_DQ "dq" 50 #define MUSE_PIXTABLE_STAT "stat" 51 #define MUSE_PIXTABLE_XPOS "xpos" 52 #define MUSE_PIXTABLE_YPOS "ypos" 53 #define MUSE_PIXTABLE_LAMBDA "lambda" 54 #define MUSE_PIXTABLE_ORIGIN "origin" 56 #define MUSE_PIXTABLE_WEIGHT "weight" 59 #define MUSE_PIXTABLE_FF_EXT "PIXTABLE_FLAT_FIELD" 60 #define MUSE_PIXTABLE_FFLAMBDA MUSE_PIXTABLE_LAMBDA 61 #define MUSE_PIXTABLE_FFDATA MUSE_PIXTABLE_DATA 63 extern const muse_cpltable_def muse_pixtable_def[]; 74 #define MUSE_HDR_PT_IFU_SLICE_OFFSET "ESO DRS MUSE PIXTABLE EXP%u IFU%02hu SLICE%02hu XOFFSET" 75 #define MUSE_HDR_PT_IFU_SLICE_OFFSET_COMMENT "x-offset of given slice in given IFU of given exposure" 83 #define MUSE_HDR_PT_TYPE "ESO DRS MUSE PIXTABLE TYPE" 84 #define MUSE_PIXTABLE_STRING_SIMPLE "SIMPLE" 85 #define MUSE_PIXTABLE_STRING_FULL "GEOFULL" 86 #define MUSE_PIXTABLE_COMMENT_SIMPLE "pixel table without y coordinates" 87 #define MUSE_PIXTABLE_COMMENT_FULL "pixel table with full geometry information" 93 #define MUSE_HDR_PT_EXP_FST "ESO DRS MUSE PIXTABLE EXP%u FIRST" 98 #define MUSE_HDR_PT_EXP_LST "ESO DRS MUSE PIXTABLE EXP%u LAST" 99 #define MUSE_HDR_PT_EXP_FST_COMMENT "Exposure %u first row index" 100 #define MUSE_HDR_PT_EXP_LST_COMMENT "Exposure %u last row index" 101 #define MUSE_HDR_PT_EXP_REGEXP "ESO DRS MUSE PIXTABLE EXP[0-9]+ (FIRST|LAST)" 104 #define MUSE_HDR_PT_ILLUMi "ESO DRS MUSE PIXTABLE ILLUM%hu" 106 #define MUSE_HDR_PT_ILLUM_MEAN "ESO DRS MUSE PIXTABLE ILLUM MEAN" 108 #define MUSE_HDR_PT_ILLUM_STDEV "ESO DRS MUSE PIXTABLE ILLUM STDEV" 110 #define MUSE_HDR_PT_ILLUM_REGEXP "^ESO DRS MUSE PIXTABLE ILLUM" 117 #define MUSE_HDR_PT_XLO "ESO DRS MUSE PIXTABLE LIMITS X LOW" 122 #define MUSE_HDR_PT_XHI "ESO DRS MUSE PIXTABLE LIMITS X HIGH" 127 #define MUSE_HDR_PT_YLO "ESO DRS MUSE PIXTABLE LIMITS Y LOW" 132 #define MUSE_HDR_PT_YHI "ESO DRS MUSE PIXTABLE LIMITS Y HIGH" 137 #define MUSE_HDR_PT_LLO "ESO DRS MUSE PIXTABLE LIMITS LAMBDA LOW" 142 #define MUSE_HDR_PT_LHI "ESO DRS MUSE PIXTABLE LIMITS LAMBDA HIGH" 147 #define MUSE_HDR_PT_ILO "ESO DRS MUSE PIXTABLE LIMITS IFU LOW" 152 #define MUSE_HDR_PT_IHI "ESO DRS MUSE PIXTABLE LIMITS IFU HIGH" 157 #define MUSE_HDR_PT_SLO "ESO DRS MUSE PIXTABLE LIMITS SLICE LOW" 162 #define MUSE_HDR_PT_SHI "ESO DRS MUSE PIXTABLE LIMITS SLICE HIGH" 164 #define MUSE_HDR_PT_LIMITS_REGEXP "^ESO DRS MUSE PIXTABLE LIMITS " 168 #define MUSE_HDR_PT_PREDAR_XLO "ESO DRS MUSE PIXTABLE PREDAR LIMITS XLO" 170 #define MUSE_HDR_PT_PREDAR_XHI "ESO DRS MUSE PIXTABLE PREDAR LIMITS XHI" 172 #define MUSE_HDR_PT_PREDAR_YLO "ESO DRS MUSE PIXTABLE PREDAR LIMITS YLO" 174 #define MUSE_HDR_PT_PREDAR_YHI "ESO DRS MUSE PIXTABLE PREDAR LIMITS YHI" 178 #define MUSE_HDR_PT_FFCORR "ESO DRS MUSE PIXTABLE FFCORR" 179 #define MUSE_HDR_PT_FFCORR_COMMENT "Pixel table corrected for flat-field spectrum" 181 #define MUSE_HDR_PT_MERGED "ESO DRS MUSE PIXTABLE MERGED" 182 #define MUSE_HDR_PT_MERGED_COMMENT "Merged IFUs that went into this pixel table" 184 #define MUSE_HDR_PT_SKYSUB "ESO DRS MUSE PIXTABLE SKYSUB" 185 #define MUSE_HDR_PT_SKYSUB_COMMENT "Pixel table was sky-subtracted" 188 #define MUSE_HDR_PT_DAR_NAME "ESO DRS MUSE PIXTABLE DAR CORRECT" 189 #define MUSE_HDR_PT_DAR_COMMENT "[Angstrom] ref. lambda for DAR correction" 190 #define MUSE_HDR_PT_DAR_C_SKIP "skipped DAR correction!" 192 #define MUSE_HDR_PT_DAR_CHECK "ESO DRS MUSE PIXTABLE DAR CHECK" 193 #define MUSE_HDR_PT_DAR_CHECK_C "[arcsec] maximum residual DAR offsets found" 195 #define MUSE_HDR_PT_DAR_CORR "ESO DRS MUSE PIXTABLE DAR CORRECT RESIDUAL" 196 #define MUSE_HDR_PT_DAR_CORR_C "[Angstrom] ref. lambda for residual DAR correction" 198 #define MUSE_HDR_PT_RVCORR "ESO DRS MUSE PIXTABLE RVCORR" 199 #define MUSE_HDR_PT_RVCORR_C "[km/s] %scentric correction was applied" 201 #define MUSE_HDR_PT_FLUXCAL "ESO DRS MUSE PIXTABLE FLUXCAL" 202 #define MUSE_HDR_PT_FLUXCAL_COMMENT "Pixel table was flux-calibrated" 204 #define MUSE_HDR_PT_WCS "ESO DRS MUSE PIXTABLE WCS" 206 #define MUSE_HDR_PT_WCS_PROJ "projected (intermediate)" 207 #define MUSE_HDR_PT_WCS_COMMENT_PROJ "Gnomonic projection applied to this pixel table" 209 #define MUSE_HDR_PT_WCS_POSI "positioned (final)" 210 #define MUSE_HDR_PT_WCS_COMMENT_POSI "Positioned this pixel table to sky coordinates" 212 #define MUSE_HDR_PT_WEIGHTED "ESO DRS MUSE PIXTABLE WEIGHTED" 213 #define MUSE_HDR_PT_WEIGHTED_COMMENT "Pixel table was weighted relative to other exposures" 215 #define MUSE_HDR_PT_COMBINED "ESO DRS MUSE PIXTABLE COMBINED" 216 #define MUSE_HDR_PT_COMBINED_COMMENT "Combined exposures that went into this pixel table" 218 #define MUSE_HDR_PT_SPEC_TYPE "ESO DRS MUSE PIXTABLE SPECTYPE" 219 #define MUSE_HDR_PT_SPEC_TYPE_COMMENT "FITS spectral type code of wavelength" 223 #define MUSE_HDR_PT_REGEXP "^ESO DRS MUSE PIXTABLE " 283 MUSE_PIXTABLE_OPERATION_SUBTRACT = 0,
284 MUSE_PIXTABLE_OPERATION_MULTIPLY,
285 MUSE_PIXTABLE_OPERATION_DIVIDE
muse_pixtable_wcs
State of the astrometric calibration of a MUSE pixel table.
unsigned int muse_pixtable_get_expnum(muse_pixtable *, cpl_size)
Get the exposure number of a given row in a pixel table.
Structure definition for a collection of muse_images.
void muse_pixtable_extracted_delete(muse_pixtable **)
Delete a pixel table array.
muse_pixtable * muse_pixtable_load(const char *)
Load the table itself and the FITS headers of a MUSE pixel table from a file.
unsigned short muse_pixtable_origin_get_slice(uint32_t)
Get the slice number from the encoded 32bit origin number.
muse_pixtable * muse_pixtable_duplicate(muse_pixtable *)
Make a copy of the pixtanle.
cpl_size muse_pixtable_extracted_get_size(muse_pixtable **)
Get the size of an array of extracted pixel tables.
unsigned int muse_pixtable_origin_set_offset(muse_pixtable *, cpl_polynomial *, unsigned short, unsigned short)
Set the slice offset from the pixel table header.
muse_pixtable ** muse_pixtable_extracted_get_slices(muse_pixtable *)
Extract one pixel table per IFU and slice.
cpl_size muse_pixtable_get_nrow(const muse_pixtable *)
get the number of rows within the pixel table
int muse_pixtable_get_type(muse_pixtable *)
Determine the type of pixel table.
cpl_error_code muse_pixtable_and_selected_mask(muse_pixtable *, muse_mask *)
Select all pixels where the (x,y) positions are enabled in the given mask.
cpl_error_code muse_pixtable_erase_ifu_slice(muse_pixtable *, unsigned char, unsigned short)
Erase pixel table rows related to one slice of one IFU.
cpl_error_code muse_pixtable_dump(muse_pixtable *, cpl_size, cpl_size, unsigned char)
Dump a MUSE pixel table to the screen, resolving the origin column.
Structure definition of MUSE three extension FITS file.
cpl_table * table
The pixel table.
cpl_error_code muse_pixtable_origin_copy_offsets(muse_pixtable *, muse_pixtable *, unsigned int)
Copy MUSE_HDR_PT_IFU_SLICE_OFFSET keywords between pixel tables.
cpl_error_code muse_pixtable_reset_dq(muse_pixtable *, unsigned int)
Reset a given bad pixel status (DQ flag) for all pixels in the table.
muse_imagelist * muse_pixtable_to_imagelist(muse_pixtable *)
Project a pixel table with data from one IFU back onto its image.
cpl_error_code muse_pixtable_append_ff(muse_pixtable *, muse_image *, cpl_table *, cpl_table *, float)
Create flat-field spectrum and append to pixel table.
cpl_error_code muse_pixtable_restrict_wavelength(muse_pixtable *, double, double)
Restrict a pixel table to a certain wavelength range.
cpl_boolean muse_pixtable_is_skysub(muse_pixtable *)
Determine whether the pixel table is sky subtracted.
unsigned int muse_pixtable_origin_get_x(uint32_t, muse_pixtable *, cpl_size)
Get the horizontal coordinate from the encoded 32bit origin number.
Structure definition of MUSE pixel table.
muse_pixtable_wcs muse_pixtable_wcs_check(muse_pixtable *)
Check the state of the world coordinate system of a pixel table.
cpl_boolean muse_pixtable_is_fluxcal(muse_pixtable *)
Determine whether the pixel table is flux calibrated.
muse_pixtable_type
Type of a MUSE pixel table.
cpl_table * ffspec
A flat-field spectrum.
unsigned int muse_pixtable_origin_get_offset(muse_pixtable *, unsigned int, unsigned short, unsigned short)
Get the slice offset from the pixel table header.
uint32_t muse_pixtable_origin_encode(unsigned int, unsigned int, unsigned short, unsigned short, unsigned int)
Encode the three CCD coordinates defining the origin of one MUSE pixel into a 32bit integer...
muse_pixtable * muse_pixtable_load_window(const char *, cpl_size, cpl_size)
Load a range of rows from the table and all the FITS headers of a MUSE pixel table from a file...
muse_pixtable_operation
Type of operation to apply to a MUSE pixel table.
muse_pixtable * muse_pixtable_create(muse_image *, cpl_table *, cpl_table *, cpl_table *)
Create the pixel table for one CCD.
muse_pixtable * muse_pixtable_load_restricted_wavelength(const char *, double, double)
Load a pixel table from file and cut down the wavelength range.
cpl_error_code muse_pixtable_save(muse_pixtable *, const char *)
Save a MUSE pixel table to a file on disk.
unsigned short muse_pixtable_origin_get_ifu(uint32_t)
Get the IFU number from the encoded 32bit origin number.
muse_pixtable * muse_pixtable_load_merge_channels(cpl_table *, double, double)
Load and merge the pixel tables of the 24 MUSE sub-fields.
cpl_error_code muse_pixtable_restrict_xpos(muse_pixtable *, double, double)
Restrict a pixel table to a certain x coordinate range.
cpl_error_code muse_pixtable_from_imagelist(muse_pixtable *, muse_imagelist *)
Get pixel table values back from a per-IFU imagelist.
Handling of "mask" files.
cpl_error_code muse_pixtable_spectrum_apply(muse_pixtable *, const cpl_array *, const cpl_array *, muse_pixtable_operation)
Apply a spectrum given by two arrays with an operation to a pixel table.
unsigned int muse_pixtable_origin_get_y(uint32_t)
Get the vertical coordinate from the encoded 32bit origin number.
void muse_pixtable_delete(muse_pixtable *)
Deallocate memory associated to a pixel table object.
cpl_error_code muse_pixtable_restrict_ypos(muse_pixtable *, double, double)
Restrict a pixel table to a certain y coordinate range.
cpl_error_code muse_pixtable_compute_limits(muse_pixtable *)
(Re-)Compute the limits of the coordinate columns of a pixel table.
cpl_propertylist * header
The FITS header.
cpl_error_code muse_pixtable_flux_multiply(muse_pixtable *, double)
Scale the flux of a pixel table with correct treatment of variance.
cpl_boolean muse_pixtable_is_rvcorr(muse_pixtable *)
Determine whether the pixel table is radial-velocity corrected.