Calibration routines


Files

file  bpm_calibration.h
 calibration routines
file  calibrate.c
file  calibrate_svd.c
file  load_calibration.c
file  save_calibration.c
file  setup_calibration.c
file  update_freq_tdecay.c

Functions

EXTERN int setup_calibration (bpmconf_t *cnf, bpmproc_t *proc, int npulses, int startpulse, int stoppulse, double angle, double startpos, double endpos, int num_steps, beamconf_t *beam)
EXTERN int calibrate (bpmconf_t *bpm, beamconf_t *beam, bpmproc_t *proc, int npulses, bpmcalib_t *cal)
EXTERN int update_freq_tdecay (bpmproc_t *proc, int npulses, bpmcalib_t *cal)
EXTERN int calibrate_svd (beamconf_t **beam, bpmconf_t **bpm, bpmproc_t **proc, int npulses, int nbpms, int *bpmidx, bpmcalib_t *cal)
EXTERN int save_calibration (char *fname, bpmconf_t *bpm, bpmcalib_t *cal, int num_bpms)
EXTERN int load_calibration (char *fname, bpmconf_t *bpm, bpmcalib_t *cal, int num_bpms)


Function Documentation

EXTERN int setup_calibration ( bpmconf_t cnf,
bpmproc_t proc,
int  npulses,
int  startpulse,
int  stoppulse,
double  angle,
double  startpos,
double  endpos,
int  num_steps,
beamconf_t beam 
)

This routine basically defines the calibration steps and returns them into the array of beam structures. It needs an array of processed waveform structures, of dimension npulses from a single BPM. From this it determines the corresponding corrector/mover steps and puts them back into the array of beam structures given the bpm configurations.

Startpulse and stoppulse have to be in the first and last calib steps & will need some extensive error checking for e.g. missed calibration steps...

NOTE: This is not definitive yet - more checking, etc. required!

Parameters:
proc array of processed waveforms for a single bpm, so array of pulses
cnf array of bpm configuration structures
npulses number of pulses in the calibration
startpulse start of calibration range
stoppulse stop of calibration range
angle 
startpos start position of calibration
endpos end position of calibration
num_steps number of calibration steps
beam the returned beamconf array which represents where the beam is supposed to be in each bpm during each calibration step
Returns:
BPM_SUCCESS upon success, BPM_FAILURE upon failure

Definition at line 8 of file setup_calibration.c.

References bpm_error(), and beamconf::bpmhit.

EXTERN int calibrate ( bpmconf_t bpm,
beamconf_t beam,
bpmproc_t proc,
int  npulses,
bpmcalib_t cal 
)

Gets the calibration constants from an array of npulses of beam positions and processed waveform structures and returns an updated calibration structure. Note that this routine updates the IQ phase, the position scale and the tilt scale but DOES NOT touch the frequency, decay time or the t0Offset.

Parameters:
bpm Bpm structures
beam An array of beam structures, one for each pulse, so essentially this corresponds to where we expect the beam to be in each pulse, so representing corrector positions or mover positions. This information should be filled by the routine setup_calibration( ... )
proc An array of processed waveforms, one for each pulse, which correspond to calculated positions that were calculated using IQ phase = 0 and scales equal to 1.
npulses The number of pulses in the arrays
*cal The returned calibration structure for the BPM that was calibrated
Returns:
BPM_SUCCESS upon succes, BPM_FAILURE upon failure

Definition at line 9 of file calibrate.c.

References bpm_error(), beamconf::bpmhit, bpmconf::cav_polarisation, bpmproc::ddc_Q, get_pos(), horiz, bpmcalib::IQphase, and nr_fit().

EXTERN int update_freq_tdecay ( bpmproc_t proc,
int  npulses,
bpmcalib_t cal 
)

Gets the list of processed pulses and refills the calib structure with updated frequencies and decay constants

NOT IMPLEMENTED YET !

Parameters:
proc array of processed waveforms
npulses the number of pulses
cal the refilled calibration structure
Returns:
BPM_SUCCESS upon succes, BPM_FAILURE upon failure

Definition at line 8 of file update_freq_tdecay.c.

References bpm_error().

EXTERN int calibrate_svd ( beamconf_t **  beam,
bpmconf_t **  bpm,
bpmproc_t **  proc,
int  npulses,
int  nbpms,
int *  bpmidx,
bpmcalib_t cal 
)

The 2D arrays in this routine represent a set of collected pulses for all the bpms, so having beam[iBPM][iPulse], cnf[iBPM][iPulse] and proc[iBPM][iPulse],

Parameters:
npulses The number of pulses collected for calibration
Used for mover calibrations with at least 2 spectator bpms. eats something of the sort bpms[bpmidx][pulseidx], for a number of pulse and. nbpms specifies the total number of bpms involved in the regression bpmidx specifies the indexes of the bpms involve in the regression, bpmidx[0] gives the central bpm, for which the calibration is calculated the rest ( bpmidx[1] -> bpmidx[nbpms-1]) gives the indexes of the spectator bpms.

NOT IMPLEMENTED YET !

Parameters:
beam 
bpm 
proc 
npulses 
nbpms The total number of BPMs that will be used in the regression
bpmidx An array of bpm indexes, where bpmidx[0] corresponds to the index of the bpm in the main array that we will calibrate, and the rest of the indices corresponds to the BPMs we will regress against, so basically the spectator BPMs, when doing a mover calibration
cal This structure is filled with the calculated iqphase, and position and resolution scales
Returns:
BPM_SUCCESS upon success, BPM_FAILURE upon failure

Definition at line 8 of file calibrate_svd.c.

References bpm_error().

EXTERN int save_calibration ( char *  fname,
bpmconf_t bpm,
bpmcalib_t cal,
int  num_bpms 
)

Save the given calibrations with the given filename.

Parameters:
fname The filename to save as
bpm BPM configs - to provide a name and index
cal The calibrations to save
num_bpms The number of bpm cals to save
Returns:
BPM_SUCCESS upon succes, BPM_FAILURE upon failure

Definition at line 8 of file save_calibration.c.

References bpm_error().

EXTERN int load_calibration ( char *  fname,
bpmconf_t bpm,
bpmcalib_t cal,
int  num_bpms 
)

Load the calibration from the given filename.

Parameters:
fname The filename to load#
bpm BPM configs - to provide a name and index
cal The calibrations to load
num_bpms The number of bpm cals to load
Returns:
BPM_SUCCESS upon succes, BPM_FAILURE upon failure

Definition at line 8 of file load_calibration.c.

References bpm_error(), bpmcalib::ddcepsFilt, bpmcalib::ddcfiltBW, bpmcalib::freq, bpmcalib::IQphase, bpmcalib::posscale, bpmcalib::slopescale, bpmcalib::t0Offset, and bpmcalib::tdecay.


Generated on Thu Jan 10 10:18:34 2008 for libbpm by  doxygen 1.5.1