private static void AddFixedSliceConfig(string name, double centre, double width)
{
// the slow half of the fwhm
DemodulationConfigBuilder dcb = delegate(Block b)
{
DemodulationConfig dc;
GatedDetectorExtractSpec dg0, dg1, dg2, dg3, dg4, dg5, dg6, dg7;
//This dodgy bit of code is to make sure that the reflected rf power meters
// only select a single point in the centre of the rf pulse. It won't work
// if either of the rf pulses is centred at a time not divisible w/o rem. by 10us
int rf1CT = (int)b.Config.Settings["rf1CentreTime"];
int rf2CT = (int)b.Config.Settings["rf2CentreTime"];
int clock = (int)b.Config.Settings["clockFrequency"];
int conFac = clock / 1000000;
dc = new DemodulationConfig();
dc.AnalysisTag = name;
dg0 = new GatedDetectorExtractSpec();
dg0.Index = 0;
dg0.Name = "top";
dg0.BackgroundSubtract = false;
dg0.GateLow = (int)(centre - width);
dg0.GateHigh = (int)(centre + width);
dg1 = new GatedDetectorExtractSpec();
dg1.Index = 1;
dg1.Name = "norm";
dg1.BackgroundSubtract = false;
dg1.GateLow = (int)((centre - width) / kDetectorDistanceRatio);
dg1.GateHigh = (int)((centre + width) / kDetectorDistanceRatio);
dg2 = GatedDetectorExtractSpec.MakeWideGate(2);
dg2.Name = "magnetometer";
dg2.Integrate = false;
dg3 = GatedDetectorExtractSpec.MakeWideGate(3);
dg3.Name = "gnd";
dg3.Integrate = false;
dg4 = GatedDetectorExtractSpec.MakeWideGate(4);
dg4.Name = "battery";
dg4.Integrate = false; //Add this in to analyse By in 3 axis internal magnetometer tests
dg5 = GatedDetectorExtractSpec.MakeWideGate(5);
dg5.Name = "rfCurrent";
dg5.Integrate = false;
dg6 = new GatedDetectorExtractSpec();
dg6.Index = 6;
dg6.Name = "reflectedrf1Amplitude";
dg6.BackgroundSubtract = false;
dg6.GateLow = 800;
dg6.GateHigh = 1800;
//dg6.GateLow = (rf1CT / conFac) - 1;
//dg6.GateHigh = (rf1CT / conFac) + 1;
dg7 = new GatedDetectorExtractSpec();
dg7.Index = 7 ;
dg7.Name = "reflectedrf2Amplitude";
dg7.BackgroundSubtract = false;
//dg7.GateLow = (rf2CT / conFac) - 1;
//dg7.GateHigh = (rf2CT / conFac) + 1;
dg7.GateLow = 800;
dg7.GateHigh =1800;
dc.GatedDetectorExtractSpecs.Add(dg0.Name, dg0);
dc.GatedDetectorExtractSpecs.Add(dg1.Name, dg1);
dc.GatedDetectorExtractSpecs.Add(dg2.Name, dg2);
dc.GatedDetectorExtractSpecs.Add(dg3.Name, dg3);
dc.GatedDetectorExtractSpecs.Add(dg4.Name, dg4);
dc.GatedDetectorExtractSpecs.Add(dg5.Name, dg5);
dc.GatedDetectorExtractSpecs.Add(dg6.Name, dg6);
dc.GatedDetectorExtractSpecs.Add(dg7.Name, dg7);
dc.PointDetectorChannels.Add("MiniFlux1");
dc.PointDetectorChannels.Add("MiniFlux2");
dc.PointDetectorChannels.Add("MiniFlux3");
dc.PointDetectorChannels.Add("NorthCurrent");
dc.PointDetectorChannels.Add("SouthCurrent");
dc.PointDetectorChannels.Add("PumpPD");
dc.PointDetectorChannels.Add("ProbePD");
dc.PointDetectorChannels.Add("PhaseLockFrequency");
//dc.PointDetectorChannels.Add("CplusV");
//dc.PointDetectorChannels.Add("CminusV");
return dc;
};
standardConfigs.Add(name, dcb);
}