GRAVI Pipeline Reference Manual  1.2.3
Functions
Acquisition Camera

Functions

cpl_error_code gravi_acqcam_get_pup_ref (cpl_propertylist *header, cpl_size tel, cpl_vector *output)
 Re-arrange the sub-aperture position into the output vector. More...
 
cpl_error_code gravi_acqcam_get_diode_ref (cpl_propertylist *header, cpl_size tel, cpl_vector *output)
 Read the diode position from header into the vector output. More...
 
cpl_error_code gravi_acqcam_spot_imprint (cpl_image *img, cpl_vector *a)
 Imprint a cross (pixel=0) in the image of the pupil spot. More...
 
cpl_error_code gravi_acqcam_fit_spot (cpl_image *img, cpl_size ntry, cpl_vector *a, int fitAll, int *nspot)
 Fit a pupil spot pattern into an image. More...
 
double gravi_acqcam_z2meter (double PositionPixels, gravi_data *static_param_data)
 Convert z_shift from [pixel] to [meters] Formula extracted from gvacqPupilTracker.c.
 
cpl_error_code gravi_acqcam_pupil (cpl_image *mean_img, cpl_imagelist *acqcam_imglist, cpl_propertylist *header, cpl_table *acqcam_table, cpl_propertylist *o_header, gravi_data *static_param_data)
 Reduce the images of pupil from ACQ. More...
 
cpl_error_code gravi_acqcam_field (cpl_image *mean_img, cpl_imagelist *acqcam_imglist, cpl_propertylist *header, cpl_table *acqcam_table, cpl_propertylist *o_header, gravi_data *static_param_data)
 Reduce the images of field from ACQ. More...
 
cpl_error_code gravi_acq_fit_gaussian (cpl_image *img, double *x, double *y, double *ex, double *ey, cpl_size size)
 Fit a Gaussian into an image, and mark the position. More...
 
cpl_error_code gravi_preproc_acqcam (gravi_data *output_data, gravi_data *input_data, gravi_data *bad_map)
 Preprocess the ACQ images: correct bad pixels, clean from pupil background via blinking, filter median bias. More...
 
cpl_error_code gravi_reduce_acqcam (gravi_data *output_data, gravi_data *input_data, gravi_data *static_param_data)
 Reduce the ACQ camera images. More...
 

Detailed Description

This module process the data of the acquisition camera. The main function called by the recipe gravity_vis is gravi_reduce_acqcam(). Two kind of acquisition camera images are reduced as described in section Algorithms/Processing ACQ :

Function Documentation

cpl_error_code gravi_acq_fit_gaussian ( cpl_image *  img,
double *  x,
double *  y,
double *  ex,
double *  ey,
cpl_size  size 
)

Fit a Gaussian into an image, and mark the position.

Parameters
imginput image
x,yinput/output position (guess and best fit)
ex,eyoutput uncertainties on x and y
sizesize of box to consider
Exceptions
CPL_ERROR_NULL_INPUTinput data is missing

The function use cpl_fit_image_gaussian to fit a Gaussian into the image The best-fit position is then fill with 0 in the image.

Definition at line 925 of file gravi_acqcam.c.

Referenced by gravi_acqcam_field().

cpl_error_code gravi_acqcam_field ( cpl_image *  mean_img,
cpl_imagelist *  acqcam_imglist,
cpl_propertylist *  header,
cpl_table *  acqcam_table,
cpl_propertylist *  o_header,
gravi_data *  static_param_data 
)

Reduce the images of field from ACQ.

Parameters
mean_imginput mean image
acqcam_imglistinput image list
headerinput header
acqcam_tableoutput table
o_headeroutput header
Exceptions
CPL_ERROR_NULL_INPUTinput data is missing
CPL_ERROR_ILLEGAL_INPUTCannot find the data of the expected telescope

The routine analyse the field from ACQ and create QC parameters in the header, as well as columns in the acqcam_table.

Definition at line 1234 of file gravi_acqcam.c.

References gravi_acq_fit_gaussian(), gravi_data_get_plist(), and gravi_data_get_table().

Referenced by gravi_reduce_acqcam().

cpl_error_code gravi_acqcam_fit_spot ( cpl_image *  img,
cpl_size  ntry,
cpl_vector *  a,
int  fitAll,
int *  nspot 
)

Fit a pupil spot pattern into an image.

Parameters
imginput image
ntrynumber of random starting point
avector of parameter, modified in-place
fitAllif set to 1, the high order of sub-aperture position (more than center and focus), the diode scaling, and the diode intensities are let free.
nspotis filled with the number of detected spots.

Fit a pupil spot pattern into an image. The global minimum is found first with a fit with a large capture range in the whole image (after a 5x5 binning to minimize the computation time). The number of random starting point is given by the ntry parameter. If ntry==1, the starting is kept unmodified. Then 10x10 pixels around each expected spot are extracted and fit with true Gaussian (free FWHM and amplitude).

Definition at line 631 of file gravi_acqcam.c.

References gravi_image_get_noise_window().

Referenced by gravi_acqcam_pupil().

cpl_error_code gravi_acqcam_get_diode_ref ( cpl_propertylist *  header,
cpl_size  tel,
cpl_vector *  output 
)

Read the diode position from header into the vector output.

Parameters
headerinput header
telrequested beam (0..3)
outputoutput vector, shall be already allocated
Exceptions
CPL_ERROR_NULL_INPUTinput data is missing
CPL_ERROR_ILLEGAL_INPUTtel outside limits

Read the diode position from header into the vector output. Assume the four diodes form a rectangle centered on the pupil center.

  • output[8] = rotation [deg], set to 0.0
  • output[9] = scale [pix/m]
  • output[10] = dx [m]
  • output[11] = dy [m]

Definition at line 488 of file gravi_acqcam.c.

Referenced by gravi_acqcam_pupil().

cpl_error_code gravi_acqcam_get_pup_ref ( cpl_propertylist *  header,
cpl_size  tel,
cpl_vector *  output 
)

Re-arrange the sub-aperture position into the output vector.

Parameters
headerinput header
telrequested beam (0..3)
outputoutput vector, shall be already allocated
Exceptions
CPL_ERROR_NULL_INPUTinput data is missing
CPL_ERROR_ILLEGAL_INPUTtel outside limits

Read the sub-aperture position for the pupil sensor, and re-arrange them into the output vector

  • output[0] = x0+x1+x2+x3 (center of sub-apertures)
  • output[1] = x0-x1+x2-x3
  • output[2] = x0+x1-x2-x3
  • output[3] = x0-x1-x2+x3
  • output[4..7] = same for y

Definition at line 550 of file gravi_acqcam.c.

Referenced by gravi_acqcam_pupil().

cpl_error_code gravi_acqcam_pupil ( cpl_image *  mean_img,
cpl_imagelist *  acqcam_imglist,
cpl_propertylist *  header,
cpl_table *  acqcam_table,
cpl_propertylist *  o_header,
gravi_data *  static_param_data 
)

Reduce the images of pupil from ACQ.

Parameters
mean_imginput mean image
acqcam_imglistinput image list
headerinput header
acqcam_tableoutput table
o_headeroutput header
Exceptions
CPL_ERROR_NULL_INPUTinput data is missing

The routine analyse the pupil from ACQ and create QC parameters in the header, as well as columns in the acqcam_table.

Definition at line 1020 of file gravi_acqcam.c.

References gravi_acqcam_fit_spot(), gravi_acqcam_get_diode_ref(), gravi_acqcam_get_pup_ref(), gravi_acqcam_spot_imprint(), and gravi_acqcam_z2meter().

Referenced by gravi_reduce_acqcam().

cpl_error_code gravi_acqcam_spot_imprint ( cpl_image *  img,
cpl_vector *  a 
)

Imprint a cross (pixel=0) in the image of the pupil spot.

Parameters
imginput/output img
aparamters for spot position

Definition at line 433 of file gravi_acqcam.c.

Referenced by gravi_acqcam_pupil().

cpl_error_code gravi_preproc_acqcam ( gravi_data *  output_data,
gravi_data *  input_data,
gravi_data *  bad_map 
)

Preprocess the ACQ images: correct bad pixels, clean from pupil background via blinking, filter median bias.

Parameters
output_datathe output gravi_data where the cleaned imagelist will be saved as IMAGING_DATA_ACQ.
input_datathe input gravi_data with the raw imagelist
bad_mapthe gravi_data containing the bad pixel map for ACQ (in extension IMAGING_DATA_ACQ).
Exceptions
CPL_ERROR_NULL_INPUTinput data is missing

Definition at line 154 of file gravi_acqcam.c.

References gravi_data_add_cube(), gravi_data_get_cube(), and gravi_data_has_extension().

cpl_error_code gravi_reduce_acqcam ( gravi_data *  output_data,
gravi_data *  input_data,
gravi_data *  static_param_data 
)

Reduce the ACQ camera images.

Parameters
output_dataThe output gravi_data where the OI_VIS_ACQ table will be created, with ndit * ntel rows.
input_dataThe input gravi_data here the ACQ imagelist is read.
Exceptions
CPL_ERROR_NULL_INPUTinput data is missing

The routine process the PUPIL sensor. It creates a table with the columns PUPIL_NSPOT (number of detected spots), PUPIL_R (rotation angle) of telescope diode, PUPIL_X, PUPIL_Y, PUPIL_Z (shifts in [m]) (gravi_acqcam_pupil). The routine process also the FIELD sensor. It creates a table with the position of the FT and SC target, the fiber shift DX, DY, SCALE and the STREHL (gravi_acqcam_field). The TIME in [us] is also stored.

Definition at line 1836 of file gravi_acqcam.c.

References gravi_acqcam_field(), gravi_acqcam_pupil(), gravi_data_add_img(), gravi_data_add_table(), gravi_data_get_cube(), gravi_data_has_extension(), and gravi_pfits_get_time_acqcam().