OMEGA Pipeline Reference Manual  1.0.6
Functions
Header Manipulation

Functions

int omega_compare_extname (cpl_propertylist *plist1, cpl_propertylist *plist2)
 Compare the EXTNAME value of two headers. More...
 
int omega_pfits_check_instrume (const cpl_frame *fr)
 Check if INSTRUME is WFI or OMEGA. More...
 
void omega_pfits_get_airmass (const cpl_propertylist *plist1, double *start, double *end)
 Reads the airmass keywords from the header. More...
 
const char * omega_pfits_get_arcfile (const cpl_propertylist *plist)
 Get the ARCFILE keyword value from the header. More...
 
double omega_pfits_get_cd11 (const cpl_propertylist *plist)
 Get the value of cd1_1. More...
 
double omega_pfits_get_cd12 (const cpl_propertylist *plist)
 Get the value of cd1_2. More...
 
double omega_pfits_get_cd21 (const cpl_propertylist *plist)
 Get the value of cd2_1. More...
 
double omega_pfits_get_cd22 (const cpl_propertylist *plist)
 Get the value of cd2_2. More...
 
double omega_pfits_get_cdelt2 (const cpl_propertylist *plist)
 Get the value of CDELT2. More...
 
void omega_pfits_get_chip_size (const cpl_propertylist *plist, int *xs, int *ys)
 Get the size of a CCD excluding the pre/overscan regions. More...
 
const char * omega_pfits_get_chipid (const cpl_propertylist *plist)
 Get CHIP ID from header. More...
 
void omega_pfits_get_conad (cpl_propertylist *plist, double *conad)
 Get the value of the keyword CONAD. More...
 
int omega_pfits_get_detlive (const cpl_propertylist *plist, int *detlive)
 Get the value of DET_LIVE. More...
 
double omega_pfits_get_dit (const cpl_propertylist *plist)
 Get the DIT keyword value from the header. More...
 
double omega_pfits_get_dither_offsetx (cpl_propertylist *plist)
 Read offset X keyword of DITHER header. More...
 
double omega_pfits_get_dither_offsety (cpl_propertylist *plist)
 Read offset Y keyword of DITHER header. More...
 
double omega_pfits_get_exptime (const cpl_propertylist *plist)
 Get the EXPTIME value. More...
 
const char * omega_pfits_get_extname (const cpl_propertylist *plist)
 Get the EXTNAME keyword of a header. More...
 
cpl_propertylist * omega_pfits_get_filter_info (const cpl_propertylist *main)
 Gets filter information from header. More...
 
void omega_pfits_get_gain (cpl_propertylist *plist, double *gain)
 Read the gain value from an image. More...
 
int omega_pfits_get_instrume (const cpl_propertylist *plist)
 Get the INSTRUME keyword value. More...
 
double omega_pfits_get_jitter_offset (cpl_propertylist *plist)
 Read offset keyword of JITTER header. More...
 
void omega_pfits_get_mean_airmass (const cpl_propertylist *plist, double *airm)
 Calculates the mean airmass from a FITS header. More...
 
double omega_pfits_get_mjdobs (const cpl_propertylist *plist)
 Get the MJD-OBS. More...
 
double omega_pfits_get_offset_alpha (cpl_propertylist *plist)
 Read offset ALPHA keyword of OFFSET header. More...
 
double omega_pfits_get_offset_delta (cpl_propertylist *plist)
 Read offset DELTA keyword of OFFSET header. More...
 
int omega_pfits_get_orientation (const char *chip)
 Get chip orientation based on chip name. More...
 
int omega_pfits_get_overscan (const cpl_frame *frame, int xn)
 Get the DRS keyword of the overscan method used to reduce the image. More...
 
cpl_vector * omega_pfits_get_preovscan (const cpl_propertylist *plist)
 This function gets the prescan and overscan keywords from the header. More...
 
void omega_pfits_get_readnoise (cpl_propertylist *plist, double *rn)
 Get the read noise value from a header. More...
 
const char * omega_pfits_get_templateid (const cpl_propertylist *plist)
 Get the template ID. More...
 
void omega_pfits_get_xysize (const char *chip, int *xs, int *ys)
 Get xy sizes of a chip. More...
 
int omega_pfits_update_header (cpl_propertylist *to, const cpl_propertylist *from)
 Copy all properties from one plist to another. More...
 

Detailed Description

Synopsis
These functions manipulate the FITS headers.
#include omega_pfits.h
#include omega_stats.h
#include omega_utils.h

Function Documentation

int omega_compare_extname ( cpl_propertylist *  plist1,
cpl_propertylist *  plist2 
)

Compare the EXTNAME value of two headers.

Parameters
plist1First header
plist2Second header
Returns
It returns 0 if the values of both keywords are the same or -1 if they are different.

Definition at line 1109 of file omega_pfits.c.

int omega_pfits_check_instrume ( const cpl_frame *  fr)

Check if INSTRUME is WFI or OMEGA.

Parameters
frFrame
Returns
0 if OMEGA, 1 if WFI or -1 in case of error.

Definition at line 785 of file omega_pfits.c.

Referenced by omega_readnoise_save(), and omega_shift_refpix().

void omega_pfits_get_airmass ( const cpl_propertylist *  plist1,
double *  start,
double *  end 
)

Reads the airmass keywords from the header.

Parameters
plist1A propertylist with the necessary information (ESO TEL AIRM START,END)
startA pointer to the keyword ESO TEL AIRM START
endA pointer to the keyword ESO TEL AIRM END
Returns
Nothing

It updates the already allocated pointers to the double values of the start and end airmasses

Definition at line 745 of file omega_pfits.c.

const char* omega_pfits_get_arcfile ( const cpl_propertylist *  plist)

Get the ARCFILE keyword value from the header.

Prototypes of functions to access FITS header information.

Parameters
plistproperty list to read from
Returns
pointer to statically allocated character string

Definition at line 142 of file omega_pfits.c.

double omega_pfits_get_cd11 ( const cpl_propertylist *  plist)

Get the value of cd1_1.

Parameters
plistproperty list to read from
cd11requested value of cd1_1
Returns
The CD1_1 value or 0 in case of error.

Definition at line 1743 of file omega_pfits.c.

double omega_pfits_get_cd12 ( const cpl_propertylist *  plist)

Get the value of cd1_2.

Parameters
plistproperty list to read from
cd12requested value of cd1_2
Returns
The CD1_2 value or 0 in case of error.

Definition at line 1761 of file omega_pfits.c.

double omega_pfits_get_cd21 ( const cpl_propertylist *  plist)

Get the value of cd2_1.

Parameters
plistproperty list to read from
cd21requested value of cd2_1
Returns
the CD2_1 value or 0 in case of error

Definition at line 1780 of file omega_pfits.c.

double omega_pfits_get_cd22 ( const cpl_propertylist *  plist)

Get the value of cd2_2.

Parameters
plistproperty list to read from
cd22requested value of cd2_2
Returns
The CD2_2 value or 0 in case of error.

Definition at line 1799 of file omega_pfits.c.

Referenced by omega_tel_offsets().

double omega_pfits_get_cdelt2 ( const cpl_propertylist *  plist)

Get the value of CDELT2.

Parameters
plistproperty list to read from
cd22requested value of cd2_2
Returns
The CDELT2 value or 0 in case of error

Definition at line 1818 of file omega_pfits.c.

Referenced by omega_tel_offsets().

void omega_pfits_get_chip_size ( const cpl_propertylist *  plist,
int *  xs,
int *  ys 
)

Get the size of a CCD excluding the pre/overscan regions.

Parameters
plistProperty list containing keywords
xOutput X size
yOutput Y size
Returns
Nothing

Definition at line 1838 of file omega_pfits.c.

References omega_pfits_get_preovscan().

const char* omega_pfits_get_chipid ( const cpl_propertylist *  plist)

Get CHIP ID from header.

@ header Header to read keyword from

Returns
string Get the CHIP ID from the header
Parameters
plistProperty list
Returns
ID of the chip as written in header

Definition at line 1044 of file omega_pfits.c.

Referenced by omega_get_scan_coord(), and omega_photom_tbl().

void omega_pfits_get_conad ( cpl_propertylist *  plist,
double *  conad 
)

Get the value of the keyword CONAD.

Parameters
plistProperty list containing the keyword
conadOutput with the CONAD value return nothing

Definition at line 995 of file omega_pfits.c.

Referenced by omega_jitter_process(), omega_match_points(), omega_mdome_combine(), and omega_mflat_combine().

int omega_pfits_get_detlive ( const cpl_propertylist *  plist,
int *  detlive 
)

Get the value of DET_LIVE.

Parameters
plistproperty list to read from
detliverequested value of DET_LIVE
Return values
0if everything went right or -1 if there was an error

Definition at line 214 of file omega_pfits.c.

Referenced by omega_darkcurrent_combine(), omega_mbias_combine(), omega_mdome_combine(), and omega_mflat_combine().

double omega_pfits_get_dit ( const cpl_propertylist *  plist)

Get the DIT keyword value from the header.

Parameters
plistproperty list to read from
Returns
The DIT value

Definition at line 154 of file omega_pfits.c.

double omega_pfits_get_dither_offsetx ( cpl_propertylist *  plist)

Read offset X keyword of DITHER header.

Parameters
plistProperty list
Returns
Value stored in keyword TEL.TARG.OFFSETSIZEX or 0 in case of error.

Definition at line 1658 of file omega_pfits.c.

Referenced by omega_tel_offsets().

double omega_pfits_get_dither_offsety ( cpl_propertylist *  plist)

Read offset Y keyword of DITHER header.

Parameters
plistProperty list
Returns
Value stored in keyword TEL.TARG.OFFSETSIZEY or 0 in case of error.

Definition at line 1679 of file omega_pfits.c.

Referenced by omega_tel_offsets().

double omega_pfits_get_exptime ( const cpl_propertylist *  plist)

Get the EXPTIME value.

Parameters
plistproperty list to read from
Returns
the requested value or 0.0 otherwise

Definition at line 193 of file omega_pfits.c.

Referenced by omega_darkcurrent_combine(), omega_jitter_process(), and omega_photom_tbl().

const char* omega_pfits_get_extname ( const cpl_propertylist *  plist)

Get the EXTNAME keyword of a header.

Parameters
plistProperty list to read keyword from
Returns
EXTNAME value

Definition at line 1087 of file omega_pfits.c.

cpl_propertylist* omega_pfits_get_filter_info ( const cpl_propertylist *  main)

Gets filter information from header.

Parameters
mainMain propertylist
Returns
1 newly allocated propertylist or NULL in error case

This function gets the following information from the main aheader HIERARCH ESO INS FILT1 ID HIERARCH ESO INS FILT1 NAME

and associate these values to other information, to return a new propertylist with the following format:

const char *FILT_ID const char *FILT_NAME const char *REF_FILT_NAME float CWL int HAS_FRINGES

Definition at line 1154 of file omega_pfits.c.

Referenced by omega_match_points(), and omega_photom_tbl().

void omega_pfits_get_gain ( cpl_propertylist *  plist,
double *  gain 
)

Read the gain value from an image.

Parameters
plistHeader to read gain value from
gainOutput value of the gain
Returns
nothing

Definition at line 952 of file omega_pfits.c.

Referenced by omega_mdome_combine(), and omega_mflat_combine().

int omega_pfits_get_instrume ( const cpl_propertylist *  plist)

Get the INSTRUME keyword value.

Parameters
plistprimary header
Returns
0 if OMEGA, 1 if WFI or -1 in case of error
Note
plist must be primary header unit

Definition at line 834 of file omega_pfits.c.

double omega_pfits_get_jitter_offset ( cpl_propertylist *  plist)

Read offset keyword of JITTER header.

-------------------------------------------------------------—*

Parameters
plistProperty list
Returns
Value stored in keyword TEL.TARG.OFFSETSIZE or 0 in case of error.

Definition at line 1637 of file omega_pfits.c.

Referenced by omega_tel_offsets().

void omega_pfits_get_mean_airmass ( const cpl_propertylist *  plist,
double *  airm 
)

Calculates the mean airmass from a FITS header.

Parameters
plistA propertylist with the necessary information (ESO TEL AIRM START,END)
airmOutput pointer to the value of the mean airmass
Returns
Nothing

It updates the pointer with the double value of the mean airmass which is calculated here.

Definition at line 697 of file omega_pfits.c.

Referenced by omega_jitter_process(), and omega_photom_tbl().

double omega_pfits_get_mjdobs ( const cpl_propertylist *  plist)

Get the MJD-OBS.

Parameters
plistproperty list to read from
Returns
the requested value

Definition at line 181 of file omega_pfits.c.

double omega_pfits_get_offset_alpha ( cpl_propertylist *  plist)

Read offset ALPHA keyword of OFFSET header.

Parameters
plistProperty list
Returns
Value stored in keyword TEL.TARG.OFFSETALPHA or 0 in case of error.

Definition at line 1700 of file omega_pfits.c.

Referenced by omega_tel_offsets().

double omega_pfits_get_offset_delta ( cpl_propertylist *  plist)

Read offset DELTA keyword of OFFSET header.

Parameters
plistProperty list
Returns
Value stored in keyword TEL.TARG.OFFSETDELTA or 0 in case of error.

Definition at line 1721 of file omega_pfits.c.

Referenced by omega_tel_offsets().

int omega_pfits_get_orientation ( const char *  chip)

Get chip orientation based on chip name.

Parameters
chipChip name
Returns
The chip orientation

Takes the string with the chip name and returns its orientation.

Definition at line 245 of file omega_pfits.c.

Referenced by omega_get_scan_coord(), and omega_pfits_get_xysize().

int omega_pfits_get_overscan ( const cpl_frame *  frame,
int  xn 
)

Get the DRS keyword of the overscan method used to reduce the image.

Parameters
frameFrame to get keyword from
xnFITS extension to load
Returns
The overscan method used

Definition at line 912 of file omega_pfits.c.

Referenced by omega_fringes_flat_process(), and omega_nsky_process().

cpl_vector* omega_pfits_get_preovscan ( const cpl_propertylist *  plist)

This function gets the prescan and overscan keywords from the header.

Parameters
plistProperty list containing the keywords
Returns
cpl_vector with the keywords in the following order PRSCX, PRSCY, OVSCX, OVSCY

Definition at line 1564 of file omega_pfits.c.

Referenced by get_trim_region(), omega_get_scan_coord(), omega_get_trim_region(), and omega_pfits_get_chip_size().

void omega_pfits_get_readnoise ( cpl_propertylist *  plist,
double *  rn 
)

Get the read noise value from a header.

Parameters
plistHeader with read noise keyword
rnOutput with the value of the readnoise
Returns
nothing

Definition at line 870 of file omega_pfits.c.

Referenced by omega_mbias_combine().

const char* omega_pfits_get_templateid ( const cpl_propertylist *  plist)

Get the template ID.

Parameters
plistproperty list to read from
Returns
pointer to statically allocated character string

Definition at line 169 of file omega_pfits.c.

void omega_pfits_get_xysize ( const char *  chip,
int *  xs,
int *  ys 
)

Get xy sizes of a chip.

Parameters
chipChip name
xsSize of x-axis
ysSize of y-axis
Returns
Nothing

Based on the chip name, it reads the X and Y sizes of the image.

Definition at line 319 of file omega_pfits.c.

References omega_pfits_get_orientation().

int omega_pfits_update_header ( cpl_propertylist *  to,
const cpl_propertylist *  from 
)

Copy all properties from one plist to another.

Parameters
toProperty list to copy to
fromProperty list to copy from
Returns
It returns 0 on success or -1 in case of error.

Definition at line 1522 of file omega_pfits.c.

Referenced by omega_jitter_process(), omega_save_image(), omega_save_table(), and omega_std_process().