Miscellaneous Utilities


Functions

int hawki_apply_harmonization (cpl_imagelist *in, double h1, double h2, double h3, double h4)
 Apply the harmonization.
cpl_image * hawki_compute_darkbpm (const cpl_image *in, double sigma)
 Compute the bpm from the dark (hot pixels).
cpl_image * hawki_compute_flatbpm (const cpl_image *in, double sigma, double lowval, double highval)
 Compute the bpm from the flat (aka cold pixels mask).
int hawki_compute_harmonization (const cpl_imagelist *in, double *h1, double *h2, double *h3, double *h4, double *h)
 Compute the harmonization.
cpl_image * hawki_compute_lsbg (const cpl_image *in)
 Compute the large scale background.
int * hawki_detectors_labelise (const cpl_frameset *in)
 Get the frames in which the star is for a given chip.
int hawki_detectors_locate_star (const cpl_frameset *in, double star_ra, double star_dec, int *labels)
 Get the frames in which the star is for a given chip.
const char * hawki_extract_first_filename (const cpl_frameset *in, const char *tag)
 Extract the filename ffor the first frame of the given tag.
hawki_band hawki_get_band (const char *f)
 Get the band.
cpl_bivector * hawki_get_header_tel_offsets (const cpl_frameset *fset)
 Get the nominal header offsets from a set of frames.
const char * hawki_get_license (void)
 Get the pipeline copyright and license.
double hawki_get_mean_airmass (cpl_frameset *set)
 Get the mean airmass for a set of frames.
const char * hawki_get_version (void)
 Returns the version of the pipeline.
cpl_error_code hawki_image_inverse_threshold (cpl_image *image_in, double lo_valid, double hi_valid, double assign_in_range, double assign_out_range)
 Create an image with a given value for pixels within a range and another value for pixels outside that range.
cpl_image * hawki_images_stitch (cpl_image **ima, double *x, double *y)
 Apply the stitching.
void hawki_print_banner (void)
 Issue a banner with the pipeline version.
const char * hawki_std_band_name (hawki_band band)
 Return a band name.
double hawki_vector_get_max_select (const cpl_vector *self, const cpl_vector *valid)
 Gets the maximum value of a vector according to an array of flags.
double hawki_vector_get_min_select (const cpl_vector *self, const cpl_vector *valid)
 Gets the minimum value of a vector according to an array of flags.
double hawki_vector_get_mode (cpl_vector *vec)
 Compute the histogram mode.

Function Documentation

int hawki_apply_harmonization ( cpl_imagelist *  in,
double  h1,
double  h2,
double  h3,
double  h4 
)

Apply the harmonization.

Parameters:
in the input images
h1 the factor to apply to chip 1
h2 the factor to apply to chip 2
h3 the factor to apply to chip 3
h4 the factor to apply to chip 4
Returns:
0 if ok, -1 otherwise

Definition at line 385 of file hawki_utils.c.

cpl_image* hawki_compute_darkbpm ( const cpl_image *  in,
double  sigma 
)

Compute the bpm from the dark (hot pixels).

Parameters:
in the input image
sigma the sigma for the threshold
Returns:
The bad pixels map

Definition at line 120 of file hawki_utils.c.

cpl_image* hawki_compute_flatbpm ( const cpl_image *  in,
double  sigma,
double  lowval,
double  highval 
)

Compute the bpm from the flat (aka cold pixels mask).

Parameters:
in the input image
sigma the sigma for the threshold
lowval the lower value for the threshold
highval the upper value for the threshold
Returns:
The bad pixels map
This function creates a mask of pixels below and above a certain limit (lowval, highval) and pixels a certain number of sigmas (sigma) above the background (which is obtained smoothing with a 3x3 kernel the input image).

Definition at line 165 of file hawki_utils.c.

References hawki_image_inverse_threshold().

int hawki_compute_harmonization ( const cpl_imagelist *  in,
double *  h1,
double *  h2,
double *  h3,
double *  h4,
double *  h 
)

Compute the harmonization.

Parameters:
in the input images
h1 the factor to apply to chip 1
h2 the factor to apply to chip 2
h3 the factor to apply to chip 3
h4 the factor to apply to chip 4
h the general factor
Returns:
0 if ok, -1 otherwise
chip3 | | chip4 ------ ------ ------ ------ chip1 | |chip2

the edges averages avgi of all chips i are computed -> h=avg(avgi) hi = h/avgi

Definition at line 423 of file hawki_utils.c.

cpl_image* hawki_compute_lsbg ( const cpl_image *  in  ) 

Compute the large scale background.

Parameters:
the input image
Returns:
The background or NULL in error case

Definition at line 532 of file hawki_utils.c.

int* hawki_detectors_labelise ( const cpl_frameset *  in  ) 

Get the frames in which the star is for a given chip.

Parameters:
in the input frameset
Returns:
The newly allocated frameset
The signs of the header offsets in x and y are used:

Definition at line 783 of file hawki_utils.c.

References hawki_get_header_tel_offsets().

int hawki_detectors_locate_star ( const cpl_frameset *  in,
double  star_ra,
double  star_dec,
int *  labels 
)

Get the frames in which the star is for a given chip.

Parameters:
in the input frameset
Returns:
The newly allocated frameset

Definition at line 838 of file hawki_utils.c.

References hawki_get_ext_from_detector(), hawki_pfits_get_naxis1(), and hawki_pfits_get_naxis2().

const char* hawki_extract_first_filename ( const cpl_frameset *  in,
const char *  tag 
)

Extract the filename ffor the first frame of the given tag.

Parameters:
in A non-empty frameset
tag The tag of the requested file
Returns:
Pointer to the file

Definition at line 640 of file hawki_utils.c.

hawki_band hawki_get_band ( const char *  f  ) 

Get the band.

Parameters:
f the filter name from the header
Returns:
the band

Definition at line 658 of file hawki_utils.c.

cpl_bivector* hawki_get_header_tel_offsets ( const cpl_frameset *  fset  ) 

Get the nominal header offsets from a set of frames.

Parameters:
fset the set of frames
Returns:
The offsets in a bivector or NULL in error case
The offsets returned are the telescope offsets, a mirror transformation must be performed to use them in as the image offsets, which is the cpl convention.

Definition at line 696 of file hawki_utils.c.

References hawki_pfits_get_cumoffsetx(), and hawki_pfits_get_cumoffsety().

Referenced by hawki_detectors_labelise().

const char* hawki_get_license ( void   ) 

Get the pipeline copyright and license.

Returns:
The copyright and license string
The function returns a pointer to the statically allocated license string. This string should not be modified using the returned pointer.

Definition at line 65 of file hawki_utils.c.

double hawki_get_mean_airmass ( cpl_frameset *  set  ) 

Get the mean airmass for a set of frames.

Parameters:
set the input frame set
Returns:
The mean airmass of all the input frames.

Definition at line 741 of file hawki_utils.c.

References hawki_pfits_get_airmass_end(), and hawki_pfits_get_airmass_start().

const char* hawki_get_version ( void   ) 

Returns the version of the pipeline.

Definition at line 106 of file hawki_utils.c.

Referenced by hawki_print_banner().

cpl_error_code hawki_image_inverse_threshold ( cpl_image *  image_in,
double  lo_valid,
double  hi_valid,
double  assign_in_range,
double  assign_out_range 
)

Create an image with a given value for pixels within a range and another value for pixels outside that range.

Parameters:
image_in Image to threshold.
lo_valid Lower bound of the valid range
hi_valid Higher bound of the valid range
assign_in_range Value to assign to pixels within valid range
assign_out_range Value to assign to pixels outside valid range
Returns:
the _cpl_error_code_ or CPL_ERROR_NONE
Images can be CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE. lo_cut must be smaller than or equal to hi_cut.

Possible _cpl_error_code_ set in this function:

Definition at line 242 of file hawki_utils.c.

Referenced by hawki_compute_flatbpm().

cpl_image* hawki_images_stitch ( cpl_image **  ima,
double *  x,
double *  y 
)

Apply the stitching.

Parameters:
ima The HAWKI_NB_DETECTORS input images
x The HAWKI_NB_DETECTORS x positions
y The HAWKI_NB_DETECTORS y positions
Returns:
The stitched image or NULL in error case.

Definition at line 306 of file hawki_utils.c.

void hawki_print_banner ( void   ) 

Issue a banner with the pipeline version.

Definition at line 93 of file hawki_utils.c.

References hawki_get_version().

const char* hawki_std_band_name ( hawki_band  band  ) 

Return a band name.

Parameters:
band a BB
Returns:
1 pointer to a static band name.

Definition at line 675 of file hawki_utils.c.

double hawki_vector_get_max_select ( const cpl_vector *  self,
const cpl_vector *  valid 
)

Gets the maximum value of a vector according to an array of flags.

Parameters:
self The input vector with the values
valid Vector of flags (>=-0.5: valid, <-0.5: invalid)
Returns:
The minimum value.

Definition at line 919 of file hawki_utils.c.

double hawki_vector_get_min_select ( const cpl_vector *  self,
const cpl_vector *  valid 
)

Gets the minimum value of a vector according to an array of flags.

Parameters:
self The input vector with the values
valid Vector of flags (>=-0.5: valid, <-0.5: invalid)
Returns:
The minimum value.

Definition at line 953 of file hawki_utils.c.

double hawki_vector_get_mode ( cpl_vector *  vec  ) 

Compute the histogram mode.

Parameters:
vec the vector
Returns:
the mode or -1 in error case

Definition at line 984 of file hawki_utils.c.


Generated on Thu Feb 17 17:13:08 2011 for HAWKI Pipeline Reference Manual by  doxygen 1.4.7