GRAVI Pipeline Reference Manual 1.9.3
Loading...
Searching...
No Matches
Macros | Functions | Variables
Acquisition Camera

Macros

#define GRAVI_SPOT_NTEL   4
 
#define GRAVI_SPOT_NLENS   4
 
#define GRAVI_SPOT_NSPOT   4
 
#define GRAVI_SPOT_NFOCUS   21
 
#define GRAVI_SPOT_NSEARCH   45
 
#define GRAVI_SPOT_SWINDOW   28
 
#define GRAVI_SPOT_NA   30
 
#define GRAVI_SPOT_SUB   0
 
#define GRAVI_SPOT_ANGLE   8
 
#define GRAVI_SPOT_SCALE   9
 
#define GRAVI_SPOT_DIODE   10
 
#define GRAVI_SPOT_FWHM   13
 
#define GRAVI_SPOT_FLUX   14
 
#define GRAVI_ACQ_PUP_FLUX   1e6
 
#define CHECK_BIT(var, pos)   ((var) & (1<<(pos)))
 

Functions

double exp1 (double x)
 
double sin1 (double x)
 
int gravi_acqcam_xy_diode (const double v[], double *xd, double *yd)
 
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)
 
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.
 
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.
 
cpl_error_code gravi_acq_measure_strehl (cpl_image *img, double x, double y, double pscale, double *SR, cpl_propertylist *header)
 measure Strehl Ratio of the source at the given location
 
cpl_error_code gravi_acq_measure_max (cpl_image *img, double x, double y, double size, double *img_max)
 
cpl_error_code gravi_image_fft_correlate (cpl_image *ia, cpl_image *ib, cpl_size *xd, cpl_size *yd)
 Correlate two images using FFT.
 
cpl_error_code gravi_acqcam_pupil_v2 (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 V2.0.
 
cpl_error_code gravi_acqcam_clean_pupil_v2 (cpl_imagelist *acqcam_imglist, cpl_imagelist *pupilImage_filtered, const cpl_size ury)
 Cleaning pupil images by cross-correlation with gaussian function.
 
cpl_error_code gravi_acqcam_select_good_frames_v2 (cpl_imagelist *pupilImage_filtered, cpl_imagelist *pupilImage_onFrames, cpl_array *good_frames)
 select pupil frames with pupil beacon on. Clean pupil frames by substraction of images with pupil beacon off.
 
cpl_error_code gravi_acqcam_get_pup_ref_v2 (cpl_propertylist *header, cpl_bivector *diode_pos_subwindow)
 Get the reference pixels for the pupil guiding on the acquisition camera.
 
cpl_error_code gravi_acqcam_get_diode_ref_v2 (cpl_propertylist *header, cpl_array *good_frames, cpl_vector *scale_vector, cpl_bivector **diode_pos_telescope, int nrow_on)
 Get the position of the telescope diodes in pixels.
 
cpl_error_code gravi_acqcam_get_diode_theoretical_v2 (cpl_bivector *diode_pos_subwindow, cpl_bivector **diode_pos_telescope, cpl_bivector **diode_pos_theoretical, cpl_size nrow_on, int ury)
 Get the position of the telescope diodes in pixels.
 
cpl_error_code gravi_acqcam_spot_imprint_v2 (cpl_image *mean_img, cpl_bivector **diode_pos_offset, cpl_bivector **diode_pos_theoretical, int ury)
 imprint zeros at the postion of the detected pupil spots
 
cpl_error_code gravi_acqcam_perform_shiftandadd_v2 (cpl_imagelist *pupilImage_onFrames, cpl_imagelist **pupilImage_shiftandadd, cpl_array *good_frames, cpl_vector *focus_value, cpl_bivector **diode_pos_theoretical, cpl_bivector **diode_pos_offset, cpl_size nrow_on)
 perform shift and add of the pupil image according to the theoretical positions
 
cpl_error_code gravi_acqcam_get_pupil_offset_v2 (cpl_imagelist **pupilImage_shiftandadd, cpl_array *bad_frames_short, cpl_bivector **diode_pos_offset, cpl_propertylist *o_header, cpl_size nrow_on)
 on the images shift and added, find maximum and perform gaussian fit
 
cpl_error_code gravi_acqcam_set_pupil_table_v2 (cpl_table *acqcam_table, cpl_propertylist *header, cpl_propertylist *o_header, cpl_array *good_frames, cpl_vector *scale_vector, cpl_array *bad_frames_short, cpl_bivector **diode_pos_offset, cpl_vector *focus_value, gravi_data *static_param_data)
 store the pupil offset in the table, and create QC parameters.
 
cpl_image * gravi_image_extract (cpl_image *image_in, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury)
 extract sub window of image (similar to cpl_image_extract)
 
double gravi_acqcam_defocus_scaling (int focus)
 gives focus value as in a list of value
 
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.
 
cpl_error_code gravi_reduce_acqcam (gravi_data *output_data, gravi_data *input_data, gravi_data *sky_data, gravi_data *dark_data, gravi_data *static_param_data)
 Reduce the ACQ camera images.
 

Variables

const int * GRAVI_LVMQ_FREE = NULL
 

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 :

Macro Definition Documentation

◆ CHECK_BIT

#define CHECK_BIT (   var,
  pos 
)    ((var) & (1<<(pos)))

Definition at line 99 of file gravi_acqcam.c.

◆ GRAVI_ACQ_PUP_FLUX

#define GRAVI_ACQ_PUP_FLUX   1e6

Definition at line 97 of file gravi_acqcam.c.

◆ GRAVI_SPOT_ANGLE

#define GRAVI_SPOT_ANGLE   8

Definition at line 91 of file gravi_acqcam.c.

◆ GRAVI_SPOT_DIODE

#define GRAVI_SPOT_DIODE   10

Definition at line 93 of file gravi_acqcam.c.

◆ GRAVI_SPOT_FLUX

#define GRAVI_SPOT_FLUX   14

Definition at line 95 of file gravi_acqcam.c.

◆ GRAVI_SPOT_FWHM

#define GRAVI_SPOT_FWHM   13

Definition at line 94 of file gravi_acqcam.c.

◆ GRAVI_SPOT_NA

#define GRAVI_SPOT_NA   30

Definition at line 89 of file gravi_acqcam.c.

◆ GRAVI_SPOT_NFOCUS

#define GRAVI_SPOT_NFOCUS   21

Definition at line 85 of file gravi_acqcam.c.

◆ GRAVI_SPOT_NLENS

#define GRAVI_SPOT_NLENS   4

Definition at line 83 of file gravi_acqcam.c.

◆ GRAVI_SPOT_NSEARCH

#define GRAVI_SPOT_NSEARCH   45

Definition at line 86 of file gravi_acqcam.c.

◆ GRAVI_SPOT_NSPOT

#define GRAVI_SPOT_NSPOT   4

Definition at line 84 of file gravi_acqcam.c.

◆ GRAVI_SPOT_NTEL

#define GRAVI_SPOT_NTEL   4

Definition at line 82 of file gravi_acqcam.c.

◆ GRAVI_SPOT_SCALE

#define GRAVI_SPOT_SCALE   9

Definition at line 92 of file gravi_acqcam.c.

◆ GRAVI_SPOT_SUB

#define GRAVI_SPOT_SUB   0

Definition at line 90 of file gravi_acqcam.c.

◆ GRAVI_SPOT_SWINDOW

#define GRAVI_SPOT_SWINDOW   28

Definition at line 87 of file gravi_acqcam.c.

Function Documentation

◆ exp1()

double exp1 ( double  x)

Definition at line 291 of file gravi_acqcam.c.

◆ gravi_acq_fit_gaussian()

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 516 of file gravi_acqcam.c.

References cpl_msg_info(), CPLCHECK_MSG, FREE, gravi_msg_function_exit, and gravi_msg_function_start.

Referenced by gravi_acqcam_field(), and gravi_acqcam_get_pupil_offset_v2().

◆ gravi_acq_measure_max()

cpl_error_code gravi_acq_measure_max ( cpl_image *  img,
double  x,
double  y,
double  size,
double *  img_max 
)

Definition at line 485 of file gravi_acqcam.c.

References cpl_image_delete(), gravi_msg_function_exit, and gravi_msg_function_start.

Referenced by gravi_acqcam_field().

◆ gravi_acq_measure_strehl()

cpl_error_code gravi_acq_measure_strehl ( cpl_image *  img,
double  x,
double  y,
double  pscale,
double *  SR,
cpl_propertylist *  header 
)

measure Strehl Ratio of the source at the given location

Parameters
imginput image
x,yposition in image in FITS convention (1,1 is lower,left)
pscaleplate scale
SRreturned strehl value
headerproperty list to read the telescope (UTs or ATs)

The function extrat a sub-image of +-50pixel around the x,y position and run the hdrl_strehl_compute function.

Definition at line 423 of file gravi_acqcam.c.

References cpl_image_delete(), CPLCHECK, FREE, gravi_conf_get_telname(), gravi_msg_function_exit, gravi_msg_function_start, and header.

Referenced by gravi_acqcam_field().

◆ gravi_acqcam_clean_pupil_v2()

cpl_error_code gravi_acqcam_clean_pupil_v2 ( cpl_imagelist *  acqcam_imglist,
cpl_imagelist *  pupilImage_filtered,
const cpl_size  ury 
)

Cleaning pupil images by cross-correlation with gaussian function.

Parameters
acqcam_imglistinput acqcam_imglist
pupilImage_filteredoutput pupilImage_filtered
uryy limit of pupil beacon camera
Exceptions
CPL_ERROR_NULL_INPUTinput data is missing

Definition at line 817 of file gravi_acqcam.c.

References cpl_image_delete(), CPLCHECK_MSG, gravi_msg_function_exit, and gravi_msg_function_start.

Referenced by gravi_acqcam_pupil_v2().

◆ gravi_acqcam_defocus_scaling()

double gravi_acqcam_defocus_scaling ( int  focus)

gives focus value as in a list of value

Definition at line 2065 of file gravi_acqcam.c.

References GRAVI_SPOT_NFOCUS.

Referenced by gravi_acqcam_get_diode_theoretical_v2(), and gravi_acqcam_perform_shiftandadd_v2().

◆ 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 2092 of file gravi_acqcam.c.

References cpl_msg_debug(), cpl_msg_info(), cpl_propertylist_update_double(), CPLCHECK, CPLCHECK_MSG, DUAL_STS, gravi_acq_fit_gaussian(), gravi_acq_measure_max(), gravi_acq_measure_strehl(), gravi_conf_get_telname(), gravi_data_get_plist(), gravi_data_get_table(), gravi_msg_function_exit, gravi_msg_function_start, gravi_pfits_get_axis(), gravi_pfits_get_feed(), gravi_pfits_get_mode(), gravi_pfits_get_northangle_acqcam(), gravi_pfits_get_sobj_x(), gravi_pfits_get_sobj_y(), GRAVI_PRIMARY_HDR_EXT, gravi_table_get_column_std(), gravi_table_new_column(), header, MODE_ONAXIS, MODE_SINGLE, ntel, and SINGLE_STS.

Referenced by gravi_reduce_acqcam().

◆ gravi_acqcam_get_diode_ref_v2()

cpl_error_code gravi_acqcam_get_diode_ref_v2 ( cpl_propertylist *  header,
cpl_array *  good_frames,
cpl_vector *  scale_vector,
cpl_bivector **  diode_pos_telescope,
int  nrow_on 
)

Get the position of the telescope diodes in pixels.

Parameters
headerinput header
good_framesarray of 0 and 1, which tells when the pupil beacons are on
scale_vectoroutput vector with the scales used for each telescope
diode_pos_telescopeoutput bivector, positions of the diode in pixel unit (and camera orientation)
Exceptions
CPL_ERROR_NULL_INPUTinput data is missing

The output bi-vector is of size n_onx4x4=16 (4 telescopes, 4 diodes). To note, because of the rotation of the parralactic angle (which can be large close to zenith), the output bivector is actually an array of n_on bivector, where n_on is the number of frames with the beacons light on.

Definition at line 1142 of file gravi_acqcam.c.

References cpl_msg_info(), CPLCHECK_MSG, DUAL_STS, gravi_conf_get_telname(), gravi_msg_function_exit, gravi_msg_function_start, gravi_pfits_get_feed(), gravi_pfits_get_northangle_acqcam(), gravi_pfits_get_zenithangle_beamb_acqcam(), GRAVI_SPOT_NTEL, header, and SINGLE_STS.

Referenced by gravi_acqcam_pupil_v2().

◆ gravi_acqcam_get_diode_theoretical_v2()

cpl_error_code gravi_acqcam_get_diode_theoretical_v2 ( cpl_bivector *  diode_pos_subwindow,
cpl_bivector **  diode_pos_telescope,
cpl_bivector **  diode_pos_theoretical,
cpl_size  nrow_on,
int  ury 
)

Get the position of the telescope diodes in pixels.

Parameters
diode_pos_subwindowinput bivector, positions of the subwindows in pupil camera
diode_pos_telescopeinput bivector, positions of the diode in pixel unit (and camera orientation)
diode_pos_theoreticaloutput bivectori, expected position of the beacons on the acq camera
Exceptions
CPL_ERROR_NULL_INPUTinput data is missing

The output bi-vector is of size n_onx11x4x4x4=16 (4 telescopes, 4 diodes, 4 lenslet). To note, because of the rotation of the parralactic angle (which can be large close to zenith), the output bivector is actually an array of n_on bivector, where n_on is the number of frames with the beacons light on. Also To note, the position depends on the focus value. Therefore, we will propose 11 different positions for 11 values of defocs. The number 11 is actually a parameter defined by GRAVI_SPOT_NFOCUS. The scaling factor is defined by the function gravi_acqcam_defocus_scaling (A thrid order polynomial).

Definition at line 1307 of file gravi_acqcam.c.

References cpl_msg_info(), CPLCHECK_MSG, gravi_acqcam_defocus_scaling(), gravi_msg_function_exit, gravi_msg_function_start, GRAVI_SPOT_NFOCUS, GRAVI_SPOT_NLENS, GRAVI_SPOT_NSPOT, and GRAVI_SPOT_NTEL.

Referenced by gravi_acqcam_pupil_v2().

◆ gravi_acqcam_get_pup_ref_v2()

cpl_error_code gravi_acqcam_get_pup_ref_v2 ( cpl_propertylist *  header,
cpl_bivector *  diode_pos_subwindow 
)

Get the reference pixels for the pupil guiding on the acquisition camera.

Parameters
headerinput header
diode_pos_subwindowoutput bivector, positions of the subwindows in pupil camera
Exceptions
CPL_ERROR_NULL_INPUTinput data is missing
CPL_ERROR_ILLEGAL_INPUTtel outside limits

The output bi-vector is of size 4x4=16 (4 telescopes, 4 lenslets on the acquisition camera).

Definition at line 1072 of file gravi_acqcam.c.

References cpl_msg_info(), CPLCHECK_MSG, gravi_msg_function_exit, gravi_msg_function_start, gravi_pfits_get_ptfc_acqcam(), GRAVI_SPOT_NLENS, GRAVI_SPOT_NTEL, and header.

Referenced by gravi_acqcam_pupil_v2().

◆ gravi_acqcam_get_pupil_offset_v2()

cpl_error_code gravi_acqcam_get_pupil_offset_v2 ( cpl_imagelist **  pupilImage_shiftandadd,
cpl_array *  bad_frames_short,
cpl_bivector **  diode_pos_offset,
cpl_propertylist *  o_header,
cpl_size  nrow_on 
)

on the images shift and added, find maximum and perform gaussian fit

Parameters
pupilImage_shiftandaddinput imagelist, pupil images after shift and add
bad_frames_shortoutput array of (0/1) int which tells if the pupil offset was found.
o_headeroutput header
diode_pos_offsetoutput bivectori, the initial pupil shift caused by the shift and add algorithm
nrow_onthe number of input frames
Exceptions
CPL_ERROR_NULL_INPUTinput data is missing

The output bi-vector is of size n_onx4 (4 telescopes, n_on frames). They correspond to the x and y pupil shift observe at each 'beacon ON' frames The diode_pos_offset bivector correspond to the offset of the pupil with respect to the theoretical position

Definition at line 1601 of file gravi_acqcam.c.

References cpl_msg_info(), cpl_propertylist_update_double(), CPLCHECK_MSG, gravi_acq_fit_gaussian(), gravi_msg_function_exit, gravi_msg_function_start, GRAVI_SPOT_NSEARCH, and GRAVI_SPOT_NTEL.

Referenced by gravi_acqcam_pupil_v2().

◆ gravi_acqcam_perform_shiftandadd_v2()

cpl_error_code gravi_acqcam_perform_shiftandadd_v2 ( cpl_imagelist *  pupilImage_onFrames,
cpl_imagelist **  pupilImage_shiftandadd,
cpl_array *  good_frames,
cpl_vector *  focus_value,
cpl_bivector **  diode_pos_theoretical,
cpl_bivector **  diode_pos_offset,
cpl_size  nrow_on 
)

perform shift and add of the pupil image according to the theoretical positions

Parameters
pupilImage_onFramesinput imagelist, pupil images where the beacons are on
pupilImage_shiftandaddoutput imagelist, pupil images after shift and add
good_framesinput array of 0 and 1, which tells when the pupil beacons are on
focus_valueoutput vector, store the measured focus value.
diode_pos_theoreticalinput bivectori, expected position of the beacons on the acq camera
diode_pos_offsetoutput bivectori, the initial pupil shift caused by the shift and add algorithm
nrow_onthe number of input frames
Exceptions
CPL_ERROR_NULL_INPUTinput data is missing

The first step of this routine is to find the focus/defocus value. To do so, it use brut force to find the focus wich gives the maximum flux (over a 55x55 add and shifted image)

The output images list are the pupil plane images, but shift and added according to the theoretical positions, and the maximum focus. In other words, it co-adds all the beacon images on a single image, which has a smaller size. the size of the shigt and added images is 59*2+1 (that is fixed by the parameter GRAVI_SPOT_NSEARCH) It means that if the beacons moved by more tha 59 pixels, we will not find them. But the margin should be big enough to cover all cases.

The output bi-vector is of size n_onx4 (4 telescopes, n_on frames). They correspond to the x and y pupil shift observe at each 'beacon ON' frames Not the the diode_pos_offset bivector is just an initialisation (different from zero) resulting from the cut of the shift and add algorithm

Definition at line 1459 of file gravi_acqcam.c.

References cpl_image_delete(), cpl_msg_info(), CPLCHECK_MSG, gravi_acqcam_defocus_scaling(), gravi_image_extract(), gravi_msg_function_exit, gravi_msg_function_start, GRAVI_SPOT_NFOCUS, GRAVI_SPOT_NLENS, GRAVI_SPOT_NSEARCH, GRAVI_SPOT_NSPOT, GRAVI_SPOT_NTEL, and GRAVI_SPOT_SWINDOW.

Referenced by gravi_acqcam_pupil_v2().

◆ 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 
)

◆ gravi_acqcam_pupil_v2()

cpl_error_code gravi_acqcam_pupil_v2 ( 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 V2.0.

Parameters
mean_imginput image
acqcam_imglistinput image list
headerinput header
acqcam_tableoutput table
o_headeroutput header
static_param_datagravity static dataset
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 634 of file gravi_acqcam.c.

References cpl_image_delete(), CPLCHECK_MSG, FREE, gravi_acqcam_clean_pupil_v2(), gravi_acqcam_get_diode_ref_v2(), gravi_acqcam_get_diode_theoretical_v2(), gravi_acqcam_get_pup_ref_v2(), gravi_acqcam_get_pupil_offset_v2(), gravi_acqcam_perform_shiftandadd_v2(), gravi_acqcam_select_good_frames_v2(), gravi_acqcam_set_pupil_table_v2(), gravi_acqcam_spot_imprint_v2(), gravi_image_replace_window(), gravi_msg_function_exit, gravi_msg_function_start, GRAVI_SPOT_NFOCUS, GRAVI_SPOT_NLENS, GRAVI_SPOT_NSPOT, GRAVI_SPOT_NTEL, and header.

Referenced by gravi_reduce_acqcam().

◆ gravi_acqcam_select_good_frames_v2()

cpl_error_code gravi_acqcam_select_good_frames_v2 ( cpl_imagelist *  pupilImage_filtered,
cpl_imagelist *  pupilImage_onFrames,
cpl_array *  good_frames 
)

select pupil frames with pupil beacon on. Clean pupil frames by substraction of images with pupil beacon off.

Parameters
pupilImage_filteredinput imagelist with cleaned (filtered) images
pupilImage_onFramesoutput pupilImage with beacons on
good_framesarray of integer. It tells which frames have beacon on or off
uryy limit of pupil beacon camera
Exceptions
CPL_ERROR_NULL_INPUTinput data is missing

Not that the output imagelist is a list of n_on images, with n_on the number of good_frames at off: n_on= sum(good_frames)

Definition at line 946 of file gravi_acqcam.c.

References cpl_image_delete(), cpl_msg_info(), CPLCHECK_MSG, gravi_msg_function_exit, and gravi_msg_function_start.

Referenced by gravi_acqcam_pupil_v2().

◆ gravi_acqcam_set_pupil_table_v2()

cpl_error_code gravi_acqcam_set_pupil_table_v2 ( cpl_table *  acqcam_table,
cpl_propertylist *  header,
cpl_propertylist *  o_header,
cpl_array *  good_frames,
cpl_vector *  scale_vector,
cpl_array *  bad_frames_short,
cpl_bivector **  diode_pos_offset,
cpl_vector *  focus_value,
gravi_data static_param_data 
)

store the pupil offset in the table, and create QC parameters.

Parameters
acqcam_tableinput /output table
headerinput header
o_headeroutput header
good_framesinput array of (0/1) int which tells if the pupil beacons are "on"
scale_vectoroptional – input bivectori, the initial pupil shift caused by the shift and add algorithm
bad_frames_shortoptional – input array of (0/1) int which tells if the pupil offset was found.
diode_pos_offsetoptional – input bivectori, the initial pupil shift caused by the shift and add algorithm
focus_valueoptional – input bivectori, the initial pupil shift caused by the shift and add algorithm
static_param_dataoptional – static parameter table
Exceptions
CPL_ERROR_NULL_INPUTinput data is missing

Populate the table of in pupil offset (and u-v plane shift). if no good_frames (sum(good_frames==0), than all the other parameters can be put to NULL In that case, the table will be filled with zeros.

Definition at line 1726 of file gravi_acqcam.c.

References CHECK_BIT, cpl_msg_info(), cpl_propertylist_update_double(), CPLCHECK_MSG, gravi_acqcam_z2meter(), GRAVI_MATH_RAD_MAS, gravi_msg_function_exit, gravi_msg_function_start, gravi_pfits_get_northangle_acqcam(), gravi_pfits_get_sobj_x(), gravi_pfits_get_sobj_y(), GRAVI_SPOT_NTEL, GRAVI_SPOT_SWINDOW, gravi_table_new_column(), and header.

Referenced by gravi_acqcam_pupil_v2().

◆ gravi_acqcam_spot_imprint_v2()

cpl_error_code gravi_acqcam_spot_imprint_v2 ( cpl_image *  mean_img,
cpl_bivector **  diode_pos_offset,
cpl_bivector **  diode_pos_theoretical,
int  ury 
)

imprint zeros at the postion of the detected pupil spots

Parameters
mean_imginput / output image,
diode_pos_offsetinput bivectori, the initial pupil shift caused by the shift and add algorithm
diode_pos_theoreticalinput bivectori, expected position of the beacons on the acq camera
uryseparation between pupil images and rest of acq camera (typically 750)

Definition at line 1378 of file gravi_acqcam.c.

References CPLCHECK, gravi_msg_function_exit, gravi_msg_function_start, GRAVI_SPOT_NFOCUS, GRAVI_SPOT_NLENS, GRAVI_SPOT_NSPOT, and GRAVI_SPOT_NTEL.

Referenced by gravi_acqcam_pupil_v2().

◆ gravi_acqcam_xy_diode()

int gravi_acqcam_xy_diode ( const double  v[],
double *  xd,
double *  yd 
)

Definition at line 301 of file gravi_acqcam.c.

References GRAVI_SPOT_ANGLE, GRAVI_SPOT_DIODE, GRAVI_SPOT_SCALE, and sin1().

◆ gravi_acqcam_z2meter()

double gravi_acqcam_z2meter ( double  PositionPixels,
gravi_data static_param_data 
)

Convert z_shift from [pixel] to [meters] Formula extracted from gvacqPupilTracker.c.

Definition at line 2854 of file gravi_acqcam.c.

References cpl_msg_debug(), gravi_data_get_plist(), and GRAVI_PRIMARY_HDR_EXT.

Referenced by gravi_acqcam_set_pupil_table_v2().

◆ gravi_image_extract()

cpl_image * gravi_image_extract ( cpl_image *  image_in,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury 
)

extract sub window of image (similar to cpl_image_extract)

Parameters
image_ininput image
headerinput header
o_headeroutput header
good_framesinput array of (0/1) int which tells if the pupil beacons are "on"
scale_vectoroptional – input bivectori, the initial pupil shift caused by the shift and add algorithm
bad_frames_shortoptional – input array of (0/1) int which tells if the pupil offset was found.
diode_pos_offsetoptional – input bivectori, the initial pupil shift caused by the shift and add algorithm
focus_valueoptional – input bivectori, the initial pupil shift caused by the shift and add algorithm
static_param_dataoptional – static parameter table Pupilate output image with zero if corrdinates outside range (instead of giving error).

Definition at line 1999 of file gravi_acqcam.c.

References cpl_image_delete().

Referenced by gravi_acqcam_perform_shiftandadd_v2().

◆ gravi_image_fft_correlate()

cpl_error_code gravi_image_fft_correlate ( cpl_image *  ia,
cpl_image *  ib,
cpl_size *  xd,
cpl_size *  yd 
)

Correlate two images using FFT.

Parameters
iaInput image cut down to one telescope
ibInput Model
xdOutput x shift
ydOutput y shift

Input images are not destroyed

Definition at line 2907 of file gravi_acqcam.c.

References cpl_image_delete(), cpl_image_multiply(), FREE, gravi_msg_function_exit, and gravi_msg_function_start.

◆ gravi_preproc_acqcam()

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 208 of file gravi_acqcam.c.

References CPLCHECK_MSG, FREE, gravi_data_add_cube(), gravi_data_get_cube(), gravi_data_get_img, gravi_data_has_extension(), GRAVI_IMAGING_DATA_ACQ_EXT, gravi_msg_function_exit, gravi_msg_function_start, and gravi_msg_warning().

Referenced by gravity_vis().

◆ gravi_reduce_acqcam()

cpl_error_code gravi_reduce_acqcam ( gravi_data output_data,
gravi_data input_data,
gravi_data sky_data,
gravi_data dark_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 2754 of file gravi_acqcam.c.

References CPLCHECK_MSG, gravi_acqcam_field(), gravi_acqcam_pupil_v2(), gravi_conf_get_telname(), gravi_data_add_img(), gravi_data_add_table(), gravi_data_get_cube(), gravi_data_get_header, gravi_data_get_img, gravi_data_has_extension(), GRAVI_IMAGING_DATA_ACQ_EXT, gravi_msg_function_exit, gravi_msg_function_start, gravi_msg_warning(), GRAVI_OI_VIS_ACQ_EXT, gravi_pfits_get_time_acqcam(), header, INSNAME_ACQ, and ntel.

Referenced by gravity_vis().

◆ sin1()

double sin1 ( double  x)

Definition at line 276 of file gravi_acqcam.c.

Referenced by gravi_acqcam_xy_diode().

Variable Documentation

◆ GRAVI_LVMQ_FREE

const int * GRAVI_LVMQ_FREE = NULL

Definition at line 185 of file gravi_acqcam.c.