OMEGA Pipeline Reference Manual  1.0.5
Functions
Image Bordering

Functions

void DoStatistics (const cpl_frame *frame, cpl_image *image, int extnum, cpl_stats **px, cpl_stats **py, cpl_stats **ox, cpl_stats **oy)
 This function performs several statistics on the image and populates the 4 cpl_stats with CPL_STATS_ALL from different pre and over scan regions.
cpl_vector * get_trim_region (const cpl_frame *frame, int extnum)
 Get trim regions based on orientation keyword.
cpl_vector * omega_get_scan_coord (const cpl_propertylist *plist, int iscan)
 This method calculates the FITS coordinates of the pre/overscan region in the iscan direction.
cpl_vector * omega_get_trim_region (omega_fits *ofits)
 Get trim regions based on CCD layout.
void omega_scan_stats (omega_fits *ofits, cpl_stats **px, cpl_stats **py, cpl_stats **ox, cpl_stats **oy)
 This function performs several statistics on the image and populates the 4 cpl_stats with CPL_STATS_ALL from different pre and over scan regions.
cpl_image * omega_trim_oscan_correct (omega_fits *ofits, int oscan)
 This method loads a raw image, trims it and (optionally) performs an overscan correction, using the statistics of the pre and overscan regions. This can be done with a single value for the whole image or on a per-row basis.
cpl_image * oscan_row (cpl_image *img, int x1, int x2)
 subtract median of overscan from each row
cpl_image * TrimOscanCorrect (const cpl_frame *frame, int oscan, int extn)
 This method loads a raw image, trims it and (optionally) performs an overscan correction, using the statistics of the pre and overscan regions. This can be done with a single value for the whole image or on a per-row basis.

Detailed Description

Synopsis
These are utility functions to extract an image from its pre/overscan regions, correct for the overscan, get the FITS coordinates of the trim image.
#include omega_trim.h
#include omega_pfits.h
#include omega_stats.h
#include omega_fits.h
#include omega_utils.h

Function Documentation

void DoStatistics ( const cpl_frame *  frame,
cpl_image *  image,
int  extnum,
cpl_stats **  px,
cpl_stats **  py,
cpl_stats **  ox,
cpl_stats **  oy 
)

This function performs several statistics on the image and populates the 4 cpl_stats with CPL_STATS_ALL from different pre and over scan regions.

Parameters:
frameFrame
imageImage related to frame.
extnFITS extension number to load
pxPointer to a cpl_stats of prescan_x
pyPointer to a cpl_stats of prescan_y
oxPointer to a cpl_stats of overscan_x
oyPointer to a cpl_stats of overscan_y
Returns:
nothing.

Definition at line 692 of file omega_trim.c.

References omega_get_scan_coord(), and omega_iter_stat_opts().

Referenced by TrimOscanCorrect().

cpl_vector* get_trim_region ( const cpl_frame *  frame,
int  extnum 
)

Get trim regions based on orientation keyword.

Parameters:
framecpl_frame with header keywords describing the pre/overscan layout
extnumFITS extension number to load
Returns:
A cpl_vector with the four coordinates as defined below:

vector –> (x0, ry0, x1, ry1): x0, ry0 – lower lefthand corner x1, ry1 – upper righthand corner

Definition at line 443 of file omega_trim.c.

References omega_get_chip_orientation(), and omega_pfits_get_preovscan().

Referenced by omega_shift_refpix(), and TrimOscanCorrect().

cpl_vector* omega_get_scan_coord ( const cpl_propertylist *  plist,
int  iscan 
)

This method calculates the FITS coordinates of the pre/overscan region in the iscan direction.

Parameters:
plistProperty list to read from
iscanIndex translating which keywords to read from header
Returns:
cpl_vector with the FITS coordinates in the following order x0 ry0, x1, ry1. The iscan index is: 0 = Prescan X region; 1 = Prescan Y region; 2 = Overscan X region; 3 = Overscan Y region.
  This method calculates the FITS coordinates of the pre/overscan region in the iscan direction.
Parameters:
plistProperty list to read from
iscanIndex translating which keywords to read from header
Returns:
A cpl_vector with the FITS coordinates in the following order:

x0 ry0, x1, ry1. The iscan index is: 0 = Prescan X region; 1 = Prescan Y region; 2 = Overscan X region; 3 = Overscan Y region.

Definition at line 919 of file omega_trim.c.

References omega_pfits_get_chipid(), omega_pfits_get_orientation(), and omega_pfits_get_preovscan().

Referenced by DoStatistics(), omega_scan_stats(), omega_trim_oscan_correct(), and TrimOscanCorrect().

cpl_vector* omega_get_trim_region ( omega_fits *  ofits)

Get trim regions based on CCD layout.

Parameters:
ofitsomega_fits with header keywords describing the pre/overscan layout
Returns:
Vector with the four coordinates as defined below: vector –> (x0, ry0, x1, ry1): x0, ry0 – lower left-hand corner x1, ry1 – upper right-hand corner

Note: Property list xplist must not be deallocated as it belongs to the ofits structure

Definition at line 593 of file omega_trim.c.

References omega_fits_get_ehu(), omega_fits_get_extnum(), omega_get_chip_orientation(), and omega_pfits_get_preovscan().

Referenced by omega_trim_oscan_correct().

void omega_scan_stats ( omega_fits *  ofits,
cpl_stats **  px,
cpl_stats **  py,
cpl_stats **  ox,
cpl_stats **  oy 
)

This function performs several statistics on the image and populates the 4 cpl_stats with CPL_STATS_ALL from different pre and over scan regions.

Parameters:
ofitsomega_fits structure
pxPointer to a cpl_stats of prescan_x
pyPointer to a cpl_stats of prescan_y
oxPointer to a cpl_stats of overscan_x
oyPointer to a cpl_stats of overscan_y
Returns:
nothing.

Definition at line 811 of file omega_trim.c.

References omega_fits_get_ehu(), omega_fits_get_image(), omega_get_scan_coord(), and omega_iter_stat_opts().

Referenced by omega_trim_oscan_correct().

cpl_image* omega_trim_oscan_correct ( omega_fits *  ofits,
int  oscan 
)

This method loads a raw image, trims it and (optionally) performs an overscan correction, using the statistics of the pre and overscan regions. This can be done with a single value for the whole image or on a per-row basis.

Parameters:
ofitsomega_fits with image to be trimmed and/or overscan corrected.
oscanoverscan correction method
Returns:
a new image, extracted from the trim region.

Requires: header keywords describing the pre/overscan layout

overscan_method – which overscan correction to use:
    0 – No overscan correction (default)
    1 – Use median of prescan_x
    2 – Use median of overscan_x
    3 – Use median of prescan_y
    4 – Use median of overscan_y
    5 – Use per-row value of prescan_x
    6 – Use per_rwo value of overscan_x

Definition of coordinates used in functions:

 x0, ry0 – lower lefthand corner
 x1, ry1 – upper righthand corner

Definition at line 248 of file omega_trim.c.

References omega_fits_get_ehu(), omega_fits_get_image(), omega_get_scan_coord(), omega_get_trim_region(), omega_scan_stats(), and oscan_row().

Referenced by omega_fringes_flat_process(), omega_jitter_process(), omega_nsky_process(), and omega_std_process().

cpl_image* oscan_row ( cpl_image *  img,
int  x1,
int  x2 
)

subtract median of overscan from each row

Parameters:
imgImage.
x1first column of overscan region
x2last column of overscan region
Returns:
New image, subtracted from the overscan

Definition at line 376 of file omega_trim.c.

Referenced by omega_trim_oscan_correct(), and TrimOscanCorrect().

cpl_image* TrimOscanCorrect ( const cpl_frame *  frame,
int  oscan,
int  extn 
)

This method loads a raw image, trims it and (optionally) performs an overscan correction, using the statistics of the pre and overscan regions. This can be done with a single value for the whole image or on a per-row basis.

     Methods 1-4 assume that DoStatistics() has been run.
Parameters:
frameFrame to be trimmed and/or overscan corrected.
oscanoverscan method
extnFITS extension number to load
Returns:
a new image, extracted from the trim region
      overscan_method – which overscan correction to use:
         0 – No overscan correction (default)
         1 – Use median of prescan_x
         2 – Use median of overscan_x
         3 – Use median of prescan_y
         4 – Use median of overscan_y
         5 – Use per-row value of prescan_x
         6 – Use per_rwo value of overscan_x

Definition at line 87 of file omega_trim.c.

References DoStatistics(), get_trim_region(), omega_get_scan_coord(), and oscan_row().

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