CalculateRampVoltages() public method

public CalculateRampVoltages ( ) : double[]
return double[]
Beispiel #1
0
 private void displayData(ScanParameters sp, CavityScanData data)
 {
     ui.ScatterGraphPlot(ui.SlaveLaserIntensityScatterGraph,
                         ui.SlaveDataPlot, sp.CalculateRampVoltages(), data.SlavePhotodiodeData);
     ui.ScatterGraphPlot(ui.MasterLaserIntensityScatterGraph, ui.MasterDataPlot,
                         sp.CalculateRampVoltages(), data.MasterPhotodiodeData);
 }
Beispiel #2
0
        private void displaySlaveFit(ScanParameters sp, double[] fitCoefficients)
        {
            double[] fitPoints = new double[sp.Steps];
            double[] ramp      = sp.CalculateRampVoltages();
            double   n         = fitCoefficients[3];
            double   q         = fitCoefficients[2];
            double   c         = fitCoefficients[1];
            double   w         = fitCoefficients[0];

            for (int i = 0; i < sp.Steps; i++)
            {
                if (w == 0)
                {
                    w = 0.001;         // watch out for divide by zero
                }
                fitPoints[i] = n + q * (1 / (1 + (((ramp[i] - c) * (ramp[i] - c)) / ((w / 2) * (w / 2)))));
            }
            ui.ScatterGraphPlot(ui.SlaveLaserIntensityScatterGraph,
                                ui.SlaveFitPlot, ramp, fitPoints);
        }
Beispiel #3
0
        /// <summary>
        /// A function to scan across the voltage range set by the limits high and low.
        /// Reads from the two photodiodes and spits out an array.
        /// The basic unit of the program.
        /// </summary>
        private CavityScanData scan(ScanParameters sp)
        {
            CavityScanData scanData = new CavityScanData(sp.Steps, 2);

            scanData.parameters = sp;

            double[] voltages = sp.CalculateRampVoltages();

            tcl.ScanCavity(voltages, false);
            tcl.StartScan();

            Thread.Sleep(1);
            tcl.SendScanTriggerAndWaitUntilDone();

            scanData.PhotodiodeData = tcl.ReadPhotodiodes(sp.Steps);

            tcl.StopScan();

            return(scanData);
        }
Beispiel #4
0
        /// <summary>
        /// A function to scan across the voltage range set by the limits high and low. 
        /// Reads from the two photodiodes and spits out an array.
        /// The basic unit of the program.
        /// </summary>
        private CavityScanData scan(ScanParameters sp)
        {
            CavityScanData scanData = new CavityScanData(sp.Steps, 2);
            scanData.parameters = sp;

            double[] voltages = sp.CalculateRampVoltages();

            tcl.ScanCavity(voltages, false);
            tcl.StartScan();

            Thread.Sleep(1);
            tcl.SendScanTriggerAndWaitUntilDone();

            scanData.PhotodiodeData = tcl.ReadPhotodiodes(sp.Steps);

            tcl.StopScan();

            return scanData;
        }
Beispiel #5
0
 private void displaySlaveFit(ScanParameters sp, double[] fitCoefficients)
 {
     double[] fitPoints = new double[sp.Steps];
     double[] ramp = sp.CalculateRampVoltages();
     double n = fitCoefficients[3];
     double q = fitCoefficients[2];
     double c = fitCoefficients[1];
     double w = fitCoefficients[0];
     for (int i = 0; i < sp.Steps; i++)
     {
         if (w == 0) w = 0.001; // watch out for divide by zero
         fitPoints[i] = n + q * (1 / (1 + (((ramp[i] - c) * (ramp[i] - c)) / ((w / 2) * (w / 2)))));
     }
     ui.ScatterGraphPlot(ui.SlaveLaserIntensityScatterGraph,
         ui.SlaveFitPlot, ramp, fitPoints);
 }
Beispiel #6
0
 private void displayData(ScanParameters sp, CavityScanData data)
 {
     ui.ScatterGraphPlot(ui.SlaveLaserIntensityScatterGraph,
         ui.SlaveDataPlot, sp.CalculateRampVoltages(),  data.SlavePhotodiodeData);
     ui.ScatterGraphPlot(ui.MasterLaserIntensityScatterGraph, ui.MasterDataPlot,
         sp.CalculateRampVoltages(), data.MasterPhotodiodeData);
 }