DECLARE SUB vcoillogvt (logfile$, m%, i1!, i2!, nave%, vtp!(), vtn!(), vt!, sigvt!) DECLARE SUB logvt (logfile$, m%, i1!, i2!, nave%, vtp!(), vtn!(), vt!, sigvt!) DECLARE SUB imagmeas (imag!) DECLARE SUB vcoilcvt (coil%, nave%, vtp!(), vtn!(), vt!, sigvt!) '**************************************************************************** 'Module BL 'This module contains subroutine bl1pt. This subroutine measures imag, 'vt, and sigvt and then computes a number of derived quantities. The 'subroutine is in its own module so it can be the only such routine 'in the HERDCOIL group. ' 'Zachary Wolf '6/3/94 '**************************************************************************** 'Open the parameter file REM $INCLUDE: 'param.inc' SUB bl1pt (m%, imag!, vt!, svt!, vtxc!, svtxc!, r!, sr!, bl!, sbl!, tf!, stf!) '**************************************************************************** 'This subroutine measures imag, vt, and svt. The coil cross calibration 'is then applied. The ratio of each magnet's integrated voltage to the 'reference magnet's integrated voltage is calculated. The integrated field 'strength is calculated. The transfer function is calculated. 'The standard deviation of each quantity is calculated. 'Note: To compute the ratios, this subroutine assumes m%=0 is followed by 'm% for the test magnets. 'Constants come from param.inc. ' 'Input: ' m%, the magnet number, used to signal m%=0 for the ratios ' 'Output: ' imag!, the measured magnet current ' vt!, the measured integrated voltage from the coil ' svt!, the standard deviation of vt! measurements ' vtxc!, vt with the coil cross calibration applied ' svtxc!, the standard deviation of vtxcal! ' r!, the ratio of vtxc!/vt_reference! ' sr!, the standard deviation of r! ' bl!, the magnet integrated field strength ' sbl!, the standard deviation of bl! ' tf!, the magnet transfer function, bl!/imag! ' stf!, the standard deviation of tf! ' 'Zachary Wolf '6/2/94 '**************************************************************************** 'Initialize STATIC vtref! 'vt for the reference magnet, used for ratios STATIC svtref! 'standard deviation of vtref STATIC imagref! 'current when the reference magnet was measured 'Redimension upon use DIM vtp!(1 TO 2) 'holds +vt values during averaging DIM vtn!(1 TO 2) 'holds -vt values during averaging 'Message IF m% = 0 THEN PRINT "Measuring the integrated field strength of the reference magnet." ELSE PRINT "Measuring the integrated field strength of magnet "; m%; "." END IF 'Measure the current before the coil measurement CALL imagmeas(ibef!) 'Measure the voltage integral 'The coil number is the same as the magnet number CALL vcoilcvt(m%, nave%, vtp!(), vtn!(), vt!, svt!) 'Measure the current after the coil measurement CALL imagmeas(iaft!) 'Write the voltage integrals to the log file IF m% = 0 THEN CALL vcoillogvt(logfile1P$, m%, ibef!, iaft!, nave%, vtp!(), vtn!(), vt!, svt!) CALL vcoillogvt(logfile2P$, m%, ibef!, iaft!, nave%, vtp!(), vtn!(), vt!, svt!) ELSEIF m% = 1 THEN CALL vcoillogvt(logfile1P$, m%, ibef!, iaft!, nave%, vtp!(), vtn!(), vt!, svt!) ELSEIF m% = 2 THEN CALL vcoillogvt(logfile2P$, m%, ibef!, iaft!, nave%, vtp!(), vtn!(), vt!, svt!) END IF 'Compute the measured magnet current imag! = (ibef! + iaft!) / 2! 'Apply the coil cross calibrations IF m% = 0 THEN coilxcal! = 1! ELSEIF m% = 1 THEN coilxcal! = coil1xcalP! ELSEIF m% = 2 THEN coilxcal! = coil2xcalP! END IF vtxc! = vt! * coilxcal! svtxc! = svt! * coilxcal! 'Compute the ratio to the reference magnet IF m% = 0 THEN imagref! = imag! 'values are saved vtref! = vt! svtref! = svt! END IF IF vtref! = 0 THEN GOTO noref: vtxcc! = vtxc! * imagref! / imag! 'current correction r! = vtxcc! / vtref! sr! = r! * SQR((svtxc! / vtxc!) ^ 2 + (svtref! / vtref!) ^ 2) noref: 'Compute the integrated field strength bl! = vtxc! * coil0constP! sbl! = svtxc! * coil0constP! 'Compute the transfer function tf! = bl! / imag! stf! = sbl! / imag! 'Message PRINT "The integrated voltage is "; vt!; " +- "; svt!; " Vs" PRINT "The integrated field strength is "; bl!; " +- "; sbl!; " Tm." END SUB