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;
45 #define MUSE_PIXTABLE_DATA "data"
46 #define MUSE_PIXTABLE_DQ "dq"
47 #define MUSE_PIXTABLE_STAT "stat"
48 #define MUSE_PIXTABLE_XPOS "xpos"
49 #define MUSE_PIXTABLE_YPOS "ypos"
50 #define MUSE_PIXTABLE_LAMBDA "lambda"
51 #define MUSE_PIXTABLE_ORIGIN "origin"
53 #define MUSE_PIXTABLE_WEIGHT "weight"
68 #define MUSE_HDR_PT_IFU_SLICE_OFFSET "ESO DRS MUSE PIXTABLE EXP%u IFU%02hu SLICE%02hu XOFFSET"
69 #define MUSE_HDR_PT_IFU_SLICE_OFFSET_COMMENT "x-offset of given slice in given IFU of given exposure"
77 #define MUSE_HDR_PT_TYPE "ESO DRS MUSE PIXTABLE TYPE"
78 #define MUSE_PIXTABLE_STRING_SIMPLE "SIMPLE"
79 #define MUSE_PIXTABLE_STRING_FULL "GEOFULL"
80 #define MUSE_PIXTABLE_COMMENT_SIMPLE "pixel table without y coordinates"
81 #define MUSE_PIXTABLE_COMMENT_FULL "pixel table with full geometry information"
87 #define MUSE_HDR_PT_EXP_FST "ESO DRS MUSE PIXTABLE EXP%u FIRST"
92 #define MUSE_HDR_PT_EXP_LST "ESO DRS MUSE PIXTABLE EXP%u LAST"
93 #define MUSE_HDR_PT_EXP_FST_COMMENT "Exposure %u first row index"
94 #define MUSE_HDR_PT_EXP_LST_COMMENT "Exposure %u last row index"
95 #define MUSE_HDR_PT_EXP_REGEXP "ESO DRS MUSE PIXTABLE EXP[0-9]+ (FIRST|LAST)"
98 #define MUSE_HDR_PT_ILLUMi "ESO DRS MUSE PIXTABLE ILLUM%hu"
100 #define MUSE_HDR_PT_ILLUM_MEAN "ESO DRS MUSE PIXTABLE ILLUM MEAN"
102 #define MUSE_HDR_PT_ILLUM_STDEV "ESO DRS MUSE PIXTABLE ILLUM STDEV"
104 #define MUSE_HDR_PT_ILLUM_REGEXP "^ESO DRS MUSE PIXTABLE ILLUM"
111 #define MUSE_HDR_PT_XLO "ESO DRS MUSE PIXTABLE LIMITS X LOW"
116 #define MUSE_HDR_PT_XHI "ESO DRS MUSE PIXTABLE LIMITS X HIGH"
121 #define MUSE_HDR_PT_YLO "ESO DRS MUSE PIXTABLE LIMITS Y LOW"
126 #define MUSE_HDR_PT_YHI "ESO DRS MUSE PIXTABLE LIMITS Y HIGH"
131 #define MUSE_HDR_PT_LLO "ESO DRS MUSE PIXTABLE LIMITS LAMBDA LOW"
136 #define MUSE_HDR_PT_LHI "ESO DRS MUSE PIXTABLE LIMITS LAMBDA HIGH"
141 #define MUSE_HDR_PT_ILO "ESO DRS MUSE PIXTABLE LIMITS IFU LOW"
146 #define MUSE_HDR_PT_IHI "ESO DRS MUSE PIXTABLE LIMITS IFU HIGH"
151 #define MUSE_HDR_PT_SLO "ESO DRS MUSE PIXTABLE LIMITS SLICE LOW"
156 #define MUSE_HDR_PT_SHI "ESO DRS MUSE PIXTABLE LIMITS SLICE HIGH"
158 #define MUSE_HDR_PT_LIMITS_REGEXP "^ESO DRS MUSE PIXTABLE LIMITS "
162 #define MUSE_HDR_PT_PREDAR_XLO "ESO DRS MUSE PIXTABLE PREDAR LIMITS XLO"
164 #define MUSE_HDR_PT_PREDAR_XHI "ESO DRS MUSE PIXTABLE PREDAR LIMITS XHI"
166 #define MUSE_HDR_PT_PREDAR_YLO "ESO DRS MUSE PIXTABLE PREDAR LIMITS YLO"
168 #define MUSE_HDR_PT_PREDAR_YHI "ESO DRS MUSE PIXTABLE PREDAR LIMITS YHI"
172 #define MUSE_HDR_PT_MERGED "ESO DRS MUSE PIXTABLE MERGED"
173 #define MUSE_HDR_PT_MERGED_COMMENT "Merged IFUs that went into this pixel table"
175 #define MUSE_HDR_PT_SKYSUB "ESO DRS MUSE PIXTABLE SKYSUB"
176 #define MUSE_HDR_PT_SKYSUB_COMMENT "Pixel table was sky-subtracted"
179 #define MUSE_HDR_PT_DAR_NAME "ESO DRS MUSE PIXTABLE DAR CORRECT"
180 #define MUSE_HDR_PT_DAR_COMMENT "[Angstrom] ref. lambda for DAR correction"
181 #define MUSE_HDR_PT_DAR_C_SKIP "skipped DAR correction!"
183 #define MUSE_HDR_PT_DAR_CHECK "ESO DRS MUSE PIXTABLE DAR CHECK"
184 #define MUSE_HDR_PT_DAR_CHECK_C "[arcsec] maximum residual DAR offsets found"
186 #define MUSE_HDR_PT_DAR_CORR "ESO DRS MUSE PIXTABLE DAR CORRECT RESIDUAL"
187 #define MUSE_HDR_PT_DAR_CORR_C "[Angstrom] ref. lambda for residual DAR correction"
189 #define MUSE_HDR_PT_RVCORR "ESO DRS MUSE PIXTABLE RVCORR"
190 #define MUSE_HDR_PT_RVCORR_C "[km/s] %scentric correction was applied"
192 #define MUSE_HDR_PT_FLUXCAL "ESO DRS MUSE PIXTABLE FLUXCAL"
193 #define MUSE_HDR_PT_FLUXCAL_COMMENT "Pixel table was flux-calibrated"
195 #define MUSE_HDR_PT_WCS "ESO DRS MUSE PIXTABLE WCS"
197 #define MUSE_HDR_PT_WCS_PROJ "projected (intermediate)"
198 #define MUSE_HDR_PT_WCS_COMMENT_PROJ "Gnomonic projection applied to this pixel table"
200 #define MUSE_HDR_PT_WCS_POSI "positioned (final)"
201 #define MUSE_HDR_PT_WCS_COMMENT_POSI "Positioned this pixel table to sky coordinates"
203 #define MUSE_HDR_PT_WEIGHTED "ESO DRS MUSE PIXTABLE WEIGHTED"
204 #define MUSE_HDR_PT_WEIGHTED_COMMENT "Pixel table was weighted relative to other exposures"
206 #define MUSE_HDR_PT_COMBINED "ESO DRS MUSE PIXTABLE COMBINED"
207 #define MUSE_HDR_PT_COMBINED_COMMENT "Combined exposures that went into this pixel table"
211 #define MUSE_HDR_PT_REGEXP "^ESO DRS MUSE PIXTABLE "
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_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.
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 * 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.
const muse_cpltable_def muse_pixtable_def[]
MUSE pixel table definition.
Definition of a cpl table structure.
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_boolean muse_pixtable_is_rvcorr(muse_pixtable *)
Determine whether the pixel table is radial-velocity corrected.