Changeset 13456


Ignore:
Timestamp:
04/26/12 11:03:20 (13 years ago)
Author:
tbretz
Message:
Changed CALIBRATION service to SI units.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/feedback.cc

    r13454 r13456  
    237237
    238238                // Average measured current
    239                 const double Im = double(fCurrentsAvg[i])/fCursorCur; // [dac]
     239                const double Im = double(fCurrentsAvg[i])/fCursorCur * conv; // [A]
    240240
    241241                // Group index (0 or 1) of the of the pixel (4 or 5 pixel patch)
     
    258258                // Offset at the calibration point (make sure that the calibration is
    259259                // valid (Im[i]>Iavg[i]) and we operate above the calibration point)
    260                 const double I = Im>Iavg[i] ? (Im - Iavg[i])*conv : 0; // [A]
     260                const double I = Im>Iavg[i] ? Im - Iavg[i]*1e-6 : 0; // [A]
    261261
    262262                // Make sure that the averaged resistor is valid
     
    373373        float *res = fCalibration.data()+BIAS::kNumChannels*2;
    374374
     375        const double conv = 5000./4096;
     376
    375377        for (int i=0; i<BIAS::kNumChannels; i++)
    376378        {
    377379            const double I = double(fCurrentsAvg[i])/fCursorCur;
    378380
    379             res[i] = fVoltGapd[i]/I * 4096/5000e-6;
    380             avg[i] = I;
    381             rms[i] = sqrt(double(fCurrentsRms[i])/fCursorCur-I*I);
     381            res[i] = fVoltGapd[i]/I / conv * 1e6;
     382            avg[i] = conv * I;
     383            rms[i] = conv * sqrt(double(fCurrentsRms[i])/fCursorCur-I*I);
    382384        }
    383385
     
    12181220        fDimCalibration("FEEDBACK/CALIBRATION", "F:416;F:416;F:416",
    12191221                        "Current offsets"
    1220                         "|Avg[dac]:Average offset (5000uA/4096dac)"
    1221                         "|Rms[dac]:Rms of offset (5000uA/4096dac)"
     1222                        "|Avg[uA]:Average offset"
     1223                        "|Rms[uA]:Rms of offset"
    12221224                        "|R[Ohm]:Measured calibration resistor"),
    12231225        fSP(BIAS::kNumChannels),
Note: See TracChangeset for help on using the changeset viewer.