Ejemplo n.º 1
0
    public override AnalogPatternBuilder GetAnalogPattern()
    {
        AnalogPatternBuilder p = new AnalogPatternBuilder((int)Parameters["PatternLength"]);



        p.AddChannel("MWGeneratorAM");



        p.AddAnalogValue("MWGeneratorAM", 0, (double)Parameters["MWStartPower"]);

        //Ramp the power linearly by ramping the dBm logarhythmically{
        p.AddLinFromDbRamp("MWGeneratorAM", (int)Parameters["MWStartTime"], 100000, (double)Parameters["MWOnPower"]);
        p.AddLinFromDbRamp("MWGeneratorAM", (int)Parameters["MWRampDownTime"], 5000, (double)Parameters["MWFinalPower"]);
        //}

        //Ramp the dBm linearly{
        //p.AddLinearRamp("MWGeneratorAM", 90000,100,(double)Parameters["MWOnPower"]-6.0);//switch to quarter of the input power over 10ms
        //p.AddLinearRamp("MWGeneratorAM", 90100, 400, (double)Parameters["MWOnPower"]);
        //p.AddLinearRamp("MWGeneratorAM",135000,500,(double)Parameters["MWFinalPower"]);
        //}

        //p.AddAnalogValue("TopTrappingCoilcurrent", 90000, 0.0);
        //p.AddAnalogValue("BottomTrappingCoilcurrent", 90000,0.0);


        p.SwitchAllOffAtEndOfPatternExcept(new string[] { "MWGeneratorAM" });
        return(p);
    }
    public override AnalogPatternBuilder GetAnalogPattern()
    {
        AnalogPatternBuilder p = new AnalogPatternBuilder((int)Parameters["PatternLength"]);

        MOTMasterScriptSnippet lm = new SHLoadMOT(p, Parameters); //loading the MOT

        p.AddChannel("aom1frequency");
        p.AddChannel("aom2frequency");
        p.AddChannel("aom3frequency");

        p.AddChannel("aom1amplitude");
        p.AddChannel("aom2amplitude");
        p.AddChannel("aom3amplitude");

        p.AddChannel("D1EOMfrequency");
        p.AddChannel("D1EOMamplitude");
        p.AddChannel("D2EOMfrequency");
        p.AddChannel("D2EOMamplitude");
        p.AddChannel("offsetlockfrequency");


        p.AddAnalogValue("D2EOMfrequency", 0, (double)Parameters["MotRepumpFrequency"]);
        p.AddAnalogValue("D2EOMamplitude", 0, (double)Parameters["MotRepumpAmplitude"]);
        p.AddAnalogValue("aom3frequency", 0, (double)Parameters["aom3Detuning"]);
        p.AddAnalogValue("aom3amplitude", 0, 6.0); //setting up the MOT parameters

        p.AddAnalogValue("D1EOMfrequency", 0, (double)Parameters["MolassesRepumpDetuning"]);
        p.AddAnalogValue("D1EOMamplitude", 0, (double)Parameters["MolassesRepumpAmplitude"]);
        p.AddAnalogValue("aom2frequency", 0, (double)Parameters["MolassesPrincipalFrequency"]);
        p.AddAnalogValue("aom2amplitude", 0, (double)Parameters["MolassesPrincipalStartAmplitude"]);
        p.AddAnalogValue("offsetlockfrequency", 0, (double)Parameters["offsetlockvcofrequency"]);//setting up molasses parameters

        p.AddLinearRamp("aom3amplitude", (int)Parameters["MOTEndTime"] - 10, 10, 3);
        p.AddLinearRamp("aom3frequency", (int)Parameters["MOTEndTime"] - 10, 10, 180.0);
        p.AddLinearRamp("TopTrappingCoilcurrent", (int)Parameters["MOTEndTime"] - 100, 100, 3.3);
        p.AddLinearRamp("BottomTrappingCoilcurrent", (int)Parameters["MOTEndTime"] - 100, 100, 3.3);


        p.AddAnalogValue("aom3amplitude", (int)Parameters["MOTEndTime"] + 1, 6.0);
        p.AddAnalogValue("aom3frequency", (int)Parameters["MOTEndTime"] + 1, (double)Parameters["aom3Detuning"]);

        p.AddAnalogValue("TopTrappingCoilcurrent", (int)Parameters["MOTEndTime"], 0);
        p.AddAnalogValue("BottomTrappingCoilcurrent", (int)Parameters["MOTEndTime"], 0);

        //Molasses shim currents
        p.AddAnalogValue("xcoilcurrent", (int)Parameters["MOTEndTime"] - 30, (double)Parameters["MolXShimCoilCurrent"]);
        p.AddAnalogValue("ycoilcurrent", (int)Parameters["MOTEndTime"] - 30, (double)Parameters["MolYShimCoilCurrent"]);
        p.AddAnalogValue("zcoilcurrent", (int)Parameters["MOTEndTime"] - 30, (double)Parameters["MolZShimCoilCurrent"]);


        //Taking the pictures
        p.AddAnalogValue("D2EOMfrequency", (int)Parameters["MOTEndTime"] + (int)Parameters["ImageDelay"] - 3, (double)Parameters["absImageRepumpDetuning"]);
        p.AddAnalogValue("D2EOMamplitude", (int)Parameters["MOTEndTime"] + (int)Parameters["ImageDelay"] - 3, (double)Parameters["absImageRepumpAmplitude"]);
        p.AddAnalogValue("aom1frequency", (int)Parameters["MOTEndTime"] + (int)Parameters["ImageDelay"] - 1, (double)Parameters["absImageDetuning"]);
        p.AddAnalogValue("aom1amplitude", (int)Parameters["MOTEndTime"] + (int)Parameters["ImageDelay"] - 1, (double)Parameters["absImagePower"]);
        p.AddAnalogValue("aom1amplitude", (int)Parameters["Frame1Trigger"] - 1, (double)Parameters["backgroundImagePower"]);

        p.SwitchAllOffAtEndOfPatternExcept(new string[] { "offsetlockfrequency", "xcoilCurrent", "ycoilcurrent", "zcoilcurrent" });
        return(p);
    }
Ejemplo n.º 3
0
    public override AnalogPatternBuilder GetAnalogPattern()
    {
        AnalogPatternBuilder p = new AnalogPatternBuilder((int)Parameters["PatternLength"]);

        MOTMasterScriptSnippet lm = new SHLoadMOT(p, Parameters); //loading the MOT

        p.AddChannel("aom1frequency");
        p.AddChannel("aom2frequency");
        p.AddChannel("aom3frequency");

        p.AddChannel("aom1amplitude");
        p.AddChannel("aom2amplitude");
        p.AddChannel("aom3amplitude");

        p.AddChannel("D1EOMfrequency");
        p.AddChannel("D1EOMamplitude");
        p.AddChannel("D2EOMfrequency");
        p.AddChannel("D2EOMamplitude");
        p.AddChannel("offsetlockfrequency");


        p.AddAnalogValue("D2EOMfrequency", 0, (double)Parameters["MotRepumpFrequency"]);
        p.AddAnalogValue("D2EOMamplitude", 0, (double)Parameters["MotRepumpAmplitude"]);
        p.AddAnalogValue("aom3frequency", 0, (double)Parameters["aom3Detuning"]);
        p.AddAnalogValue("aom3amplitude", 0, 6.0); //setting up the MOT parameters


        //CMOT
        p.AddLinearRamp("TopTrappingCoilcurrent", (int)Parameters["MOTEndTime"] - (int)Parameters["CMOTTime"] - (int)Parameters["CMOTHoldTime"], (int)Parameters["CMOTTime"], (double)Parameters["TopMagTrapCurrent"]);
        p.AddLinearRamp("BottomTrappingCoilcurrent", (int)Parameters["MOTEndTime"] - (int)Parameters["CMOTTime"] - (int)Parameters["CMOTHoldTime"], (int)Parameters["CMOTTime"], (double)Parameters["BottomMagTrapCurrent"]);
        p.AddLinearRamp("aom3amplitude", (int)Parameters["MOTEndTime"] - (int)Parameters["CMOTTime"] - (int)Parameters["CMOTHoldTime"], (int)Parameters["CMOTTime"], (double)Parameters["CMOTFinalPower"]);

        p.AddAnalogValue("aom3amplitude", (int)Parameters["MOTEndTime"] + 1, 6.0);
        p.AddAnalogValue("aom3frequency", (int)Parameters["MOTEndTime"] + 1, (double)Parameters["aom3Detuning"]);

        //magnetic trap
        p.AddAnalogValue("TopTrappingCoilcurrent", (int)Parameters["MOTEndTime"], (double)Parameters["TopMagTrapCurrent"]);
        p.AddAnalogValue("BottomTrappingCoilcurrent", (int)Parameters["MOTEndTime"], (double)Parameters["BottomMagTrapCurrent"]);

        p.AddAnalogValue("TopTrappingCoilcurrent", (int)Parameters["MOTEndTime"] + (int)Parameters["MagTrapHoldTime"], 0.0);
        p.AddAnalogValue("BottomTrappingCoilcurrent", (int)Parameters["MOTEndTime"] + (int)Parameters["MagTrapHoldTime"], 0.0);
        p.AddAnalogValue("xcoilcurrent", (int)Parameters["MOTEndTime"], (double)Parameters["MagXShimCoilCurrent"]);
        p.AddAnalogValue("ycoilcurrent", (int)Parameters["MOTEndTime"], (double)Parameters["MagYShimCoilCurrent"]);
        p.AddAnalogValue("zcoilcurrent", (int)Parameters["MOTEndTime"], (double)Parameters["MagZShimCoilCurrent"]);


        //Taking the pictures
        p.AddAnalogValue("D2EOMfrequency", (int)Parameters["MOTEndTime"] + (int)Parameters["ImageDelay"] + (int)Parameters["MagTrapHoldTime"] - 3, (double)Parameters["absImageRepumpDetuning"]);
        p.AddAnalogValue("D2EOMamplitude", (int)Parameters["MOTEndTime"] + (int)Parameters["ImageDelay"] + (int)Parameters["MagTrapHoldTime"] - 3, (double)Parameters["absImageRepumpAmplitude"]);
        p.AddAnalogValue("aom1frequency", (int)Parameters["MOTEndTime"] + (int)Parameters["ImageDelay"] + (int)Parameters["MagTrapHoldTime"] - 1, (double)Parameters["absImageDetuning"]);
        p.AddAnalogValue("aom1amplitude", (int)Parameters["MOTEndTime"] + (int)Parameters["ImageDelay"] + (int)Parameters["MagTrapHoldTime"] - 1, (double)Parameters["absImagePower"]);
        p.AddAnalogValue("aom1amplitude", (int)Parameters["Frame1Trigger"] - 1, (double)Parameters["backgroundImagePower"]);

        p.SwitchAllOffAtEndOfPatternExcept(new string[] { "offsetlockfrequency", "xcoilCurrent", "ycoilcurrent", "zcoilcurrent" });
        return(p);
    }
Ejemplo n.º 4
0
    public override AnalogPatternBuilder GetAnalogPattern()
    {
        AnalogPatternBuilder p = new AnalogPatternBuilder((int)Parameters["PatternLength"]);

        p.AddChannel("offsetlockfrequency");
        p.AddAnalogValue("offsetlockfrequency", 0, 9.0);

        p.SwitchAllOffAtEndOfPatternExcept(new string[] { "offsetlockfrequency" });
        return(p);
    }
Ejemplo n.º 5
0
    public override AnalogPatternBuilder GetAnalogPattern()
    {
        AnalogPatternBuilder p = new AnalogPatternBuilder((int)Parameters["PatternLength"]);

        MOTMasterScriptSnippet lm = new SHLoadMOT(p, Parameters); //loading the MOT

        p.AddChannel("aom1frequency");
        p.AddChannel("aom2frequency");
        p.AddChannel("aom3frequency");

        p.AddChannel("aom1amplitude");
        p.AddChannel("aom2amplitude");
        p.AddChannel("aom3amplitude");

        p.AddChannel("D1EOMfrequency");
        p.AddChannel("D1EOMamplitude");
        p.AddChannel("D2EOMfrequency");
        p.AddChannel("D2EOMamplitude");
        p.AddChannel("offsetlockfrequency");


        p.AddAnalogValue("D2EOMfrequency", 0, (double)Parameters["MotRepumpFrequency"]);
        p.AddAnalogValue("D2EOMamplitude", 0, (double)Parameters["MotRepumpAmplitude"]);
        p.AddAnalogValue("aom3frequency", 0, (double)Parameters["aom3Detuning"]);
        p.AddAnalogValue("aom3amplitude", 0, 6.0); //setting up the MOT parameters

        p.AddAnalogValue("offsetlockfrequency", 0, (double)Parameters["offsetlockvcofrequency"]);
        p.AddAnalogValue("D1EOMfrequency", 0, (double)Parameters["MolassesRepumpDetuning"]);
        p.AddAnalogValue("D1EOMamplitude", 0, (double)Parameters["MolassesRepumpAmplitude"]);
        p.AddAnalogValue("aom2frequency", 0, (double)Parameters["MolassesPrincipalFrequency"]);
        p.AddAnalogValue("aom2amplitude", 0, (double)Parameters["MolassesPrincipalAmplitude"]); //setting up the molasses parameters


        //CMOT
        p.AddLinearRamp("TopTrappingCoilcurrent", (int)Parameters["MOTEndTime"] - (int)Parameters["CMOTFieldRampTime"], (int)Parameters["CMOTFieldRampTime"], (double)Parameters["CMOTTopVacCurrent"]);
        p.AddLinearRamp("BottomTrappingCoilcurrent", (int)Parameters["MOTEndTime"] - (int)Parameters["CMOTFieldRampTime"], (int)Parameters["CMOTFieldRampTime"], (double)Parameters["CMOTBottomVacCurrent"]);
        p.AddAnalogValue("aom3amplitude", (int)Parameters["MOTEndTime"] - (int)Parameters["CMOTTime"], (double)Parameters["CMOTFinalPower"]);
        p.AddAnalogValue("aom3frequency", (int)Parameters["MOTEndTime"] - (int)Parameters["CMOTTime"], (double)Parameters["CMOTFinalDetuning"]);

        p.AddAnalogValue("TopTrappingCoilcurrent", (int)Parameters["MOTEndTime"], 0);
        p.AddAnalogValue("BottomTrappingCoilcurrent", (int)Parameters["MOTEndTime"], 0);

        //Setting the probe aom amplitude for repumping
        p.AddAnalogValue("aom1amplitude", (int)Parameters["MOTEndTime"] + (int)Parameters["MolStartDelay"] + (int)Parameters["MolassesPulseLength"] - 2, (double)Parameters["PumpingPower"]);

        //Taking the pictures
        p.AddAnalogValue("D2EOMfrequency", (int)Parameters["MOTEndTime"] + (int)Parameters["MolStartDelay"] + (int)Parameters["MolassesPulseLength"] + (int)Parameters["ImageDelay"] - 3, (double)Parameters["absImageRepumpDetuning"]);
        p.AddAnalogValue("D2EOMamplitude", (int)Parameters["MOTEndTime"] + (int)Parameters["MolStartDelay"] + (int)Parameters["MolassesPulseLength"] + (int)Parameters["ImageDelay"] - 3, (double)Parameters["absImageRepumpAmplitude"]);
        p.AddAnalogValue("aom1frequency", (int)Parameters["MOTEndTime"] + (int)Parameters["MolStartDelay"] + (int)Parameters["MolassesPulseLength"] + (int)Parameters["ImageDelay"] - 1, (double)Parameters["absImageDetuning"]);
        p.AddAnalogValue("aom1amplitude", (int)Parameters["MOTEndTime"] + (int)Parameters["MolStartDelay"] + (int)Parameters["MolassesPulseLength"] + (int)Parameters["ImageDelay"] - 1, (double)Parameters["absImagePower"]);
        p.AddAnalogValue("aom1amplitude", (int)Parameters["Frame1Trigger"] - 1, (double)Parameters["backgroundImagePower"]);

        p.SwitchAllOffAtEndOfPatternExcept(new string[] { "offsetlockfrequency", "xcoilCurrent", "ycoilcurrent", "zcoilcurrent" });
        return(p);
    }
Ejemplo n.º 6
0
    public override AnalogPatternBuilder GetAnalogPattern()
    {
        AnalogPatternBuilder p = new AnalogPatternBuilder((int)Parameters["PatternLength"]);

        p.AddChannel("offsetlockfrequency");

        p.AddAnalogValue("offsetlockfrequency", 0, (double)Parameters["StartOLF"]);
        p.AddLinearRamp("offsetlockfrequency", (int)Parameters["SwitchTime"], 100, (double)Parameters["FinalOLF"]);



        p.SwitchAllOffAtEndOfPatternExcept(new string[] { "offsetlockfrequency" });
        return(p);
    }
Ejemplo n.º 7
0
    public override AnalogPatternBuilder GetAnalogPattern()
    {
        AnalogPatternBuilder p = new AnalogPatternBuilder((int)Parameters["PatternLength"]);

        MOTMasterScriptSnippet lm = new SHLoadMOT(p, Parameters); //loading the MOT

        p.AddChannel("aom1frequency");
        p.AddChannel("aom2frequency");
        p.AddChannel("aom3frequency");
        p.AddChannel("aom4frequency");

        p.AddChannel("aom1amplitude");
        p.AddChannel("aom2amplitude");
        p.AddChannel("aom3amplitude");
        p.AddChannel("aom4amplitude");

        p.AddChannel("D1EOMfrequency");
        p.AddChannel("D1EOMamplitude");
        p.AddChannel("D2EOMfrequency");
        p.AddChannel("D2EOMamplitude");
        p.AddChannel("offsetlockfrequency");
        p.AddAnalogValue("offsetlockfrequency", 0, (double)Parameters["offsetlockvcofrequency"]);
        p.AddAnalogValue("D1EOMamplitude", 0, (double)Parameters["d1repumpamplitude"]);
        p.AddAnalogValue("D1EOMfrequency", 0, (double)Parameters["d1repumpfrequency"]);

        p.AddAnalogValue("D2EOMfrequency", 0, (double)Parameters["MotRepumpFrequency"]);
        p.AddAnalogValue("D2EOMamplitude", 0, (double)Parameters["MotRepumpAmplitude"]);
        p.AddAnalogValue("aom3frequency", 0, (double)Parameters["aom3Detuning"]);
        p.AddAnalogValue("aom3amplitude", 0, 6.0);                                                //setting up the MOT parameters

        p.AddAnalogValue("offsetlockfrequency", 0, (double)Parameters["offsetlockvcofrequency"]); //imaging

        p.AddAnalogValue("TopTrappingCoilcurrent", (int)Parameters["MOTEndTime"], 0);
        p.AddAnalogValue("BottomTrappingCoilcurrent", (int)Parameters["MOTEndTime"], 0);

        //Set the optical pumping power before imaging
        p.AddAnalogValue("aom4amplitude", (int)Parameters["MOTEndTime"], (double)Parameters["PumpingPower"]);

        //Taking the pictures
        p.AddAnalogValue("D2EOMfrequency", (int)Parameters["MOTEndTime"] + (int)Parameters["ImageDelay"] - 3, (double)Parameters["absImageRepumpDetuning"]);
        p.AddAnalogValue("D2EOMamplitude", (int)Parameters["MOTEndTime"] + (int)Parameters["ImageDelay"] - 3, (double)Parameters["absImageRepumpAmplitude"]);
        p.AddAnalogValue("aom1frequency", (int)Parameters["MOTEndTime"] + (int)Parameters["ImageDelay"] - 1, (double)Parameters["absImageDetuning"]);
        p.AddAnalogValue("aom1amplitude", (int)Parameters["MOTEndTime"] + (int)Parameters["ImageDelay"] - 1, (double)Parameters["absImagePower"]);
        p.AddAnalogValue("aom1amplitude", (int)Parameters["Frame1TriggerDelay"] + (int)Parameters["MOTEndTime"] - 1, (double)Parameters["backgroundImagePower"]);

        p.SwitchAllOffAtEndOfPatternExcept(new string[] { "offsetlockfrequency", "xcoilCurrent", "ycoilcurrent", "zcoilcurrent" });
        return(p);
    }
Ejemplo n.º 8
0
    public override AnalogPatternBuilder GetAnalogPattern()
    {
        AnalogPatternBuilder p = new AnalogPatternBuilder((int)Parameters["PatternLength"]);

        MOTMasterScriptSnippet lm = new SHLoadMOT(p, Parameters); //loading the MOT

        p.AddChannel("aom1frequency");
        p.AddChannel("aom2frequency");
        p.AddChannel("aom3frequency");

        p.AddChannel("aom1amplitude");
        p.AddChannel("aom2amplitude");
        p.AddChannel("aom3amplitude");

        p.AddChannel("D1EOMfrequency");
        p.AddChannel("D1EOMamplitude");
        p.AddChannel("D2EOMfrequency");
        p.AddChannel("D2EOMamplitude");
        p.AddChannel("offsetlockfrequency");

        p.AddAnalogValue("coil0current", 0, 0);
        p.AddAnalogValue("coil1current", 0, 0);

        p.AddAnalogValue("D2EOMfrequency", 0, (double)Parameters["MotRepumpFrequency"]);
        p.AddAnalogValue("D2EOMamplitude", 0, (double)Parameters["MotRepumpAmplitude"]);
        p.AddAnalogValue("aom3frequency", 0, (double)Parameters["aom3Detuning"]);
        p.AddAnalogValue("aom3amplitude", 0, 6.0); //setting up the MOT parameters

        p.AddAnalogValue("D1EOMfrequency", 0, (double)Parameters["MolassesRepumpDetuning"]);
        p.AddAnalogValue("D1EOMamplitude", 0, (double)Parameters["MolassesRepumpAmplitude"]);
        p.AddAnalogValue("aom2frequency", 0, (double)Parameters["MolassesPrincipalFrequency"]);
        p.AddAnalogValue("aom2amplitude", 0, (double)Parameters["MolassesPrincipalAmplitude"]);
        p.AddAnalogValue("offsetlockfrequency", 0, (double)Parameters["offsetlockvcofrequency"]);

        p.AddAnalogValue("coil0current", (int)Parameters["MOTEndTime"], 0);
        p.AddAnalogValue("coil1current", (int)Parameters["MOTEndTime"], 0);
        p.AddAnalogValue("xcoilcurrent", (int)Parameters["MOTEndTime"], 0);

        //Taking the pictures
        p.AddAnalogValue("D2EOMfrequency", (int)Parameters["Frame0Trigger"] - 1, (double)Parameters["absImageRepumpDetuning"]);
        p.AddAnalogValue("D2EOMamplitude", (int)Parameters["Frame0Trigger"] - 1, (double)Parameters["absImageRepumpAmplitude"]);
        p.AddAnalogValue("aom1frequency", (int)Parameters["Frame0Trigger"] - 1, (double)Parameters["absImageDetuning"]);
        p.AddAnalogValue("aom1amplitude", (int)Parameters["Frame0Trigger"] - 1, (double)Parameters["absImagePower"]);

        p.SwitchAllOffAtEndOfPatternExcept(new string[] { "offsetlockfrequency" });
        return(p);
    }
Ejemplo n.º 9
0
    public override AnalogPatternBuilder GetAnalogPattern()
    {
        AnalogPatternBuilder p = new AnalogPatternBuilder((int)Parameters["PatternLength"]);



        p.AddChannel("TopTrappingCoilcurrent");
        p.AddChannel("BottomTrappingCoilcurrent");



        p.AddAnalogValue("TopTrappingCoilcurrent", 0, (double)Parameters["TopCoilCurrent"]);
        p.AddAnalogValue("BottomTrappingCoilcurrent", 0, (double)Parameters["BottomCoilCurrent"]);
        //p.AddAnalogValue("TopTrappingCoilcurrent", 90000, 0.0);
        //p.AddAnalogValue("BottomTrappingCoilcurrent", 90000,0.0);


        p.SwitchAllOffAtEndOfPatternExcept(new string[] { });
        return(p);
    }
Ejemplo n.º 10
0
    public override AnalogPatternBuilder GetAnalogPattern()
    {
        AnalogPatternBuilder p = new AnalogPatternBuilder((int)Parameters["PatternLength"]);

        MOTMasterScriptSnippet lm = new SHLoadMOT(p, Parameters); //loading the MOT

        p.AddChannel("aom1frequency");
        p.AddChannel("aom2frequency");
        p.AddChannel("aom3frequency");
        p.AddChannel("aom4frequency");

        p.AddChannel("aom1amplitude");
        p.AddChannel("aom2amplitude");
        p.AddChannel("aom3amplitude");
        p.AddChannel("aom4amplitude");

        p.AddChannel("D1EOMfrequency");
        p.AddChannel("D1EOMamplitude");
        p.AddChannel("D2EOMfrequency");
        p.AddChannel("D2EOMamplitude");
        p.AddChannel("offsetlockfrequency");
        p.AddChannel("BottomTransportCurrent");
        p.AddChannel("TopTransportCurrent");


        p.AddAnalogValue("D2EOMfrequency", 0, (double)Parameters["MotRepumpFrequency"]);
        p.AddAnalogValue("D2EOMamplitude", 0, (double)Parameters["MotRepumpAmplitude"]);
        p.AddAnalogValue("aom3frequency", 0, (double)Parameters["aom3Detuning"]);
        p.AddAnalogValue("aom3amplitude", 0, 6.0); //setting up the MOT parameters

        p.AddAnalogValue("offsetlockfrequency", 0, (double)Parameters["offsetlockvcofrequency"]);
        p.AddAnalogValue("D1EOMfrequency", 0, (double)Parameters["MolassesRepumpDetuning"]);
        p.AddAnalogValue("D1EOMamplitude", 0, (double)Parameters["MolassesRepumpAmplitude"]);
        p.AddAnalogValue("aom2frequency", 0, (double)Parameters["MolassesPrincipalFrequency"]);
        p.AddAnalogValue("aom2amplitude", 0, (double)Parameters["MolassesPrincipalAmplitude"]); //setting up the molasses parameters

        p.AddAnalogValue("aom4frequency", 0, (double)Parameters["OPaom4frequency"]);
        p.AddAnalogValue("aom4amplitude", 0, (double)Parameters["PumpingPower"]); //setting up the optical pumping parameters


        //CMOT
        p.AddLinearRamp("TopTrappingCoilcurrent", (int)Parameters["MOTEndTime"] - (int)Parameters["CMOTFieldRampTime"], (int)Parameters["CMOTFieldRampTime"], (double)Parameters["CMOTTopVacCurrent"]);
        p.AddLinearRamp("BottomTrappingCoilcurrent", (int)Parameters["MOTEndTime"] - (int)Parameters["CMOTFieldRampTime"], (int)Parameters["CMOTFieldRampTime"], (double)Parameters["CMOTBottomVacCurrent"]);
        p.AddAnalogValue("aom3amplitude", (int)Parameters["MOTEndTime"] - (int)Parameters["CMOTTime"], (double)Parameters["CMOTFinalPower"]);
        p.AddAnalogValue("aom3frequency", (int)Parameters["MOTEndTime"] - (int)Parameters["CMOTTime"], (double)Parameters["CMOTFinalDetuning"]);

        p.AddAnalogValue("TopTrappingCoilcurrent", (int)Parameters["MOTEndTime"], 0);
        p.AddAnalogValue("BottomTrappingCoilcurrent", (int)Parameters["MOTEndTime"], 0);

        //Optical Pumping Repump Power and frequency
        p.AddAnalogValue("D1EOMamplitude", (int)Parameters["MOTEndTime"] + (int)Parameters["MolStartDelay"] + (int)Parameters["MolassesPulseLength"], (double)Parameters["OPRepumpAmplitude"]);
        p.AddAnalogValue("D1EOMfrequency", (int)Parameters["MOTEndTime"] + (int)Parameters["MolStartDelay"] + (int)Parameters["MolassesPulseLength"], (double)Parameters["OPRepumpFrequency"]);

        //Magnetic Trap

        p.AddLinearRamp("TopTrappingCoilcurrent", (int)Parameters["MOTEndTime"] + (int)Parameters["MolStartDelay"] + (int)Parameters["MolassesPulseLength"] + (int)Parameters["MagTrapDelay"], (int)Parameters["MagTrapRampTime"], (double)Parameters["TopMagTrapCurrent"]);
        p.AddLinearRamp("BottomTrappingCoilcurrent", (int)Parameters["MOTEndTime"] + (int)Parameters["MolStartDelay"] + (int)Parameters["MolassesPulseLength"] + (int)Parameters["MagTrapDelay"], (int)Parameters["MagTrapRampTime"], (double)Parameters["BottomMagTrapCurrent"]);

        //Transfer to external magnetic trap
        //Ramping up external coil currents
        p.AddLinearRamp("TopTransportCurrent", (int)Parameters["MOTEndTime"] + (int)Parameters["MolStartDelay"] + (int)Parameters["MolassesPulseLength"] + (int)Parameters["MagTrapDelay"] + (int)Parameters["MagTrapHoldTime"] + (int)Parameters["MagTrapRampTime"], (int)Parameters["MagTrapTransferTime"], (double)Parameters["TopExtTrapCurrent"]);
        p.AddLinearRamp("BottomTransportCurrent", (int)Parameters["MOTEndTime"] + (int)Parameters["MolStartDelay"] + (int)Parameters["MolassesPulseLength"] + (int)Parameters["MagTrapDelay"] + (int)Parameters["MagTrapHoldTime"] + (int)Parameters["MagTrapRampTime"], (int)Parameters["MagTrapTransferTime"], (double)Parameters["BottomExtTrapCurrent"]);
        //Ramping down internal coil currents
        p.AddLinearRamp("TopTrappingCoilcurrent", (int)Parameters["MOTEndTime"] + (int)Parameters["MolStartDelay"] + (int)Parameters["MolassesPulseLength"] + (int)Parameters["MagTrapDelay"] + (int)Parameters["MagTrapHoldTime"] + (int)Parameters["MagTrapRampTime"], (int)Parameters["MagTrapTransferTime"], 0.0);
        p.AddLinearRamp("BottomTrappingCoilcurrent", (int)Parameters["MOTEndTime"] + (int)Parameters["MolStartDelay"] + (int)Parameters["MolassesPulseLength"] + (int)Parameters["MagTrapDelay"] + (int)Parameters["MagTrapHoldTime"] + (int)Parameters["MagTrapRampTime"], (int)Parameters["MagTrapTransferTime"], 0.0);

        //Transfer back to internal magnetic trap
        //Ramping down external coil currents
        p.AddLinearRamp("TopTransportCurrent", (int)Parameters["MOTEndTime"] + (int)Parameters["MolStartDelay"] + (int)Parameters["MolassesPulseLength"] + (int)Parameters["MagTrapDelay"] + (int)Parameters["MagTrapHoldTime"] + (int)Parameters["MagTrapRampTime"] + (int)Parameters["MagTrapTransferTime"] + (int)Parameters["ExtMagTrapHoldTime"], (int)Parameters["MagTrapTransferTime"], 0.0);
        p.AddLinearRamp("BottomTransportCurrent", (int)Parameters["MOTEndTime"] + (int)Parameters["MolStartDelay"] + (int)Parameters["MolassesPulseLength"] + (int)Parameters["MagTrapDelay"] + (int)Parameters["MagTrapHoldTime"] + (int)Parameters["MagTrapRampTime"] + (int)Parameters["MagTrapTransferTime"] + (int)Parameters["ExtMagTrapHoldTime"], (int)Parameters["MagTrapTransferTime"], 0.0);
        //Ramping down internal coil currents
        p.AddLinearRamp("TopTrappingCoilcurrent", (int)Parameters["MOTEndTime"] + (int)Parameters["MolStartDelay"] + (int)Parameters["MolassesPulseLength"] + (int)Parameters["MagTrapDelay"] + (int)Parameters["MagTrapRampTime"] + (int)Parameters["MagTrapHoldTime"] + (int)Parameters["MagTrapTransferTime"] + (int)Parameters["ExtMagTrapHoldTime"], (int)Parameters["MagTrapTransferTime"], (double)Parameters["TopMagTrapCurrent"]);
        p.AddLinearRamp("BottomTrappingCoilcurrent", (int)Parameters["MOTEndTime"] + (int)Parameters["MolStartDelay"] + (int)Parameters["MolassesPulseLength"] + (int)Parameters["MagTrapDelay"] + (int)Parameters["MagTrapRampTime"] + (int)Parameters["MagTrapHoldTime"] + (int)Parameters["MagTrapTransferTime"] + (int)Parameters["ExtMagTrapHoldTime"], (int)Parameters["MagTrapTransferTime"], (double)Parameters["BottomMagTrapCurrent"]);


        //turn off magnetic trap
        p.AddAnalogValue("TopTrappingCoilcurrent", (int)Parameters["MOTEndTime"] + (int)Parameters["MolStartDelay"] + (int)Parameters["MolassesPulseLength"] + (int)Parameters["MagTrapDelay"] + (int)Parameters["MagTrapRampTime"] + (int)Parameters["MagTrapHoldTime"] + (int)Parameters["MagTrapTransferTime"] + (int)Parameters["ExtMagTrapHoldTime"] + (int)Parameters["MagTrapTransferTime"], 0.0);
        p.AddAnalogValue("BottomTrappingCoilcurrent", (int)Parameters["MOTEndTime"] + (int)Parameters["MolStartDelay"] + (int)Parameters["MolassesPulseLength"] + (int)Parameters["MagTrapDelay"] + (int)Parameters["MagTrapRampTime"] + (int)Parameters["MagTrapHoldTime"] + (int)Parameters["MagTrapTransferTime"] + (int)Parameters["ExtMagTrapHoldTime"] + (int)Parameters["MagTrapTransferTime"], 0.0);


        //Taking the pictures
        p.AddAnalogValue("D2EOMfrequency", (int)Parameters["MOTEndTime"] + (int)Parameters["MolStartDelay"] + (int)Parameters["MolassesPulseLength"] + (int)Parameters["MagTrapDelay"] + (int)Parameters["MagTrapRampTime"] + (int)Parameters["MagTrapHoldTime"] + (int)Parameters["ImageDelay"] - 3, (double)Parameters["absImageRepumpDetuning"]);
        p.AddAnalogValue("D2EOMamplitude", (int)Parameters["MOTEndTime"] + (int)Parameters["MolStartDelay"] + (int)Parameters["MolassesPulseLength"] + (int)Parameters["MagTrapDelay"] + (int)Parameters["MagTrapRampTime"] + (int)Parameters["MagTrapHoldTime"] + (int)Parameters["ImageDelay"] - 3, (double)Parameters["absImageRepumpAmplitude"]);
        p.AddAnalogValue("aom1frequency", (int)Parameters["MOTEndTime"] + (int)Parameters["MolStartDelay"] + (int)Parameters["MolassesPulseLength"] + (int)Parameters["MagTrapDelay"] + (int)Parameters["MagTrapRampTime"] + (int)Parameters["MagTrapHoldTime"] + (int)Parameters["ImageDelay"] - 1, (double)Parameters["absImageDetuning"]);
        p.AddAnalogValue("aom1amplitude", (int)Parameters["MOTEndTime"] + (int)Parameters["MolStartDelay"] + (int)Parameters["MolassesPulseLength"] + (int)Parameters["MagTrapDelay"] + (int)Parameters["MagTrapRampTime"] + (int)Parameters["MagTrapHoldTime"] + (int)Parameters["ImageDelay"] - 1, (double)Parameters["absImagePower"]);
        p.AddAnalogValue("aom1amplitude", (int)Parameters["Frame1Trigger"] - 1, (double)Parameters["backgroundImagePower"]);

        p.SwitchAllOffAtEndOfPatternExcept(new string[] { "offsetlockfrequency", "xcoilCurrent", "ycoilcurrent", "zcoilcurrent" });
        return(p);
    }