public GetSpecialChannelValueAndError ( string name, string detector ) : double[] | ||
name | string | |
detector | string | |
Résultat | double[] |
public static QuickEDMAnalysis AnalyseDBlock(DemodulatedBlock dblock) { QuickEDMAnalysis analysis = new QuickEDMAnalysis(); BlockConfig config = dblock.Config; //edm factor calculation double dbStep = ((AnalogModulation)config.GetModulationByName("DB")).Step; double magCal = (double)config.Settings["magnetCalibration"]; double eField = cField((double)config.Settings["ePlus"], (double)config.Settings["eMinus"]);//arguments are in volts not kV double edmFactor = (bohrMagneton * dbStep * magCal * Math.Pow(10, -9)) / (electronCharge * saturatedEffectiveField * polarisationFactor(eField)); //Get relevant channel values and errors analysis.SIGValAndErr = dblock.GetChannelValueAndError(new string[] { "SIG" }, "top"); analysis.BValAndErr = dblock.GetChannelValueAndError(new string[] { "B" }, "top"); analysis.DBValAndErr = dblock.GetChannelValueAndError(new string[] { "DB" }, "top"); analysis.EValAndErr = dblock.GetChannelValueAndError(new string[] { "E" }, "top"); analysis.EBValAndErr = dblock.GetChannelValueAndError(new string[] { "E", "B" }, "top"); //edm error calculation analysis.RawEDM = edmFactor * (analysis.EBValAndErr[0] / analysis.DBValAndErr[0]); analysis.RawEDMErr = Math.Abs(analysis.RawEDM) * Math.Sqrt(Math.Pow(analysis.EBValAndErr[1] / analysis.EBValAndErr[0], 2) + Math.Pow(analysis.DBValAndErr[1] / analysis.DBValAndErr[0], 2)); //same again for normed data. analysis.SIGValAndErrNormed = dblock.GetChannelValueAndError(new string[] { "SIG" }, "topNormed"); analysis.BValAndErrNormed = dblock.GetChannelValueAndError(new string[] { "B" }, "topNormed"); analysis.DBValAndErrNormed = dblock.GetChannelValueAndError(new string[] { "DB" }, "topNormed"); analysis.EValAndErrNormed = dblock.GetChannelValueAndError(new string[] { "E" }, "topNormed"); analysis.EBValAndErrNormed = dblock.GetChannelValueAndError(new string[] { "E", "B" }, "topNormed"); //normed edm error analysis.RawEDMNormed = edmFactor * (analysis.EBValAndErrNormed[0] / analysis.DBValAndErrNormed[0]); analysis.RawEDMErrNormed = Math.Abs(analysis.RawEDMNormed) * Math.Sqrt(Math.Pow(analysis.EBValAndErrNormed[1] / analysis.EBValAndErrNormed[0], 2) + Math.Pow(analysis.DBValAndErrNormed[1] / analysis.DBValAndErrNormed[0], 2)); //leakage currents analysis.NorthCurrentValAndError = dblock.GetChannelValueAndError(new string[] { "SIG" }, "NorthCurrent"); analysis.SouthCurrentValAndError = dblock.GetChannelValueAndError(new string[] { "SIG" }, "SouthCurrent"); analysis.NorthECorrCurrentValAndError = dblock.GetChannelValueAndError(new string[] { "E" }, "NorthCurrent"); analysis.SouthECorrCurrentValAndError = dblock.GetChannelValueAndError(new string[] { "E" }, "SouthCurrent"); //magnetometer (I know it is not signed right but I just want the noise so any waveform will do) analysis.MagValandErr = dblock.GetChannelValueAndError(new string[] { "SIG" }, "magnetometer"); //laser freq analysis.LFValandErr = dblock.GetChannelValueAndError(new string[] { "LF1" }, "top"); //analysis.LF1DBDB = dblock.ChannelValues[6].GetSpecialValue("LF1DBDB"); // 5 is topNormed TODO: make GetSpecialValuesAndError work //analysis.LF2DBDB = dblock.ChannelValues[6].GetSpecialValue("LF2DBDB"); analysis.LF1DBDB = dblock.GetSpecialChannelValueAndError("LF1DBDB", "topNormed"); // 5 is topNormed TODO: make GetSpecialValuesAndError work analysis.LF2DBDB = dblock.GetSpecialChannelValueAndError("LF2DBDB", "top"); //rf freq analysis.rf1FreqAndErr = dblock.GetChannelValueAndError(new string[] { "RF1F" }, "top"); analysis.rf2FreqAndErr = dblock.GetChannelValueAndError(new string[] { "RF2F" }, "top"); //rf amp analysis.rf1AmpAndErr = dblock.GetChannelValueAndError(new string[] { "RF1A" }, "top"); analysis.rf2AmpAndErr = dblock.GetChannelValueAndError(new string[] { "RF2A" }, "top"); //photodiodes analysis.probePD = dblock.GetChannelValueAndError(new string[] { "SIG" }, "ProbePD"); analysis.pumpPD = dblock.GetChannelValueAndError(new string[] { "SIG" }, "PumpPD"); //rfAmmeter analysis.rfCurrent = dblock.GetChannelValueAndError(new string[] { "SIG" }, "rfCurrent"); return(analysis); }
public static QuickEDMAnalysis AnalyseDBlock(DemodulatedBlock dblock) { QuickEDMAnalysis analysis = new QuickEDMAnalysis(); BlockConfig config = dblock.Config; //edm factor calculation double dbStep = ((AnalogModulation)config.GetModulationByName("DB")).Step; double magCal = (double)config.Settings["magnetCalibration"]; double eField = cField((double)config.Settings["ePlus"], (double)config.Settings["eMinus"]);//arguments are in volts not kV double edmFactor = (bohrMagneton * dbStep * magCal * Math.Pow(10, -9)) / (electronCharge * saturatedEffectiveField * polarisationFactor(eField)); //Get relevant channel values and errors analysis.SIGValAndErr = dblock.GetChannelValueAndError(new string[] { "SIG" }, "top"); analysis.BValAndErr = dblock.GetChannelValueAndError(new string[] { "B" }, "top"); analysis.DBValAndErr = dblock.GetChannelValueAndError(new string[] { "DB" }, "top"); analysis.EValAndErr = dblock.GetChannelValueAndError(new string[] { "E" }, "top"); analysis.EBValAndErr = dblock.GetChannelValueAndError(new string[] { "E", "B" }, "top"); //edm error calculation analysis.RawEDM = edmFactor * (analysis.EBValAndErr[0] / analysis.DBValAndErr[0]); analysis.RawEDMErr = Math.Abs(analysis.RawEDM) * Math.Sqrt(Math.Pow(analysis.EBValAndErr[1] / analysis.EBValAndErr[0], 2) + Math.Pow(analysis.DBValAndErr[1] / analysis.DBValAndErr[0], 2)); //same again for normed data. analysis.SIGValAndErrNormed = dblock.GetChannelValueAndError(new string[] { "SIG" }, "topNormed"); analysis.BValAndErrNormed = dblock.GetChannelValueAndError(new string[] { "B" }, "topNormed"); analysis.DBValAndErrNormed = dblock.GetChannelValueAndError(new string[] { "DB" }, "topNormed"); analysis.BDBValAndErrNormed = dblock.GetSpecialChannelValueAndError( "BDB", "topNormed" ); analysis.EValAndErrNormed = dblock.GetChannelValueAndError(new string[] { "E" }, "topNormed"); analysis.EBValAndErrNormed = dblock.GetChannelValueAndError(new string[] { "E", "B" }, "topNormed"); //normed edm error analysis.RawEDMNormed = edmFactor * (analysis.EBValAndErrNormed[0] / analysis.DBValAndErrNormed[0]); analysis.RawEDMErrNormed = Math.Abs(analysis.RawEDMNormed) * Math.Sqrt(Math.Pow(analysis.EBValAndErrNormed[1] / analysis.EBValAndErrNormed[0], 2) + Math.Pow(analysis.DBValAndErrNormed[1] / analysis.DBValAndErrNormed[0], 2)); //leakage currents analysis.NorthCurrentValAndError = dblock.GetChannelValueAndError(new string[] { "SIG" }, "NorthCurrent"); analysis.SouthCurrentValAndError = dblock.GetChannelValueAndError(new string[] { "SIG" }, "SouthCurrent"); analysis.NorthECorrCurrentValAndError = dblock.GetChannelValueAndError(new string[] { "E" }, "NorthCurrent"); analysis.SouthECorrCurrentValAndError = dblock.GetChannelValueAndError(new string[] { "E" }, "SouthCurrent"); //magnetometer (I know it is not signed right but I just want the noise so any waveform will do) analysis.MagValandErr = dblock.GetChannelValueAndError(new string[] { "SIG" }, "magnetometer"); //laser freq analysis.LFValandErr = dblock.GetChannelValueAndError(new string[] { "LF1" }, "top"); analysis.LF1DBDB = dblock.GetSpecialChannelValueAndError( "LF1DBDB", "topNormed" ); analysis.LF2DBDB = dblock.GetSpecialChannelValueAndError( "LF2DBDB", "top" ); //rf freq analysis.rf1FreqAndErr = dblock.GetChannelValueAndError(new string[] { "RF1F" }, "top"); analysis.rf2FreqAndErr = dblock.GetChannelValueAndError(new string[] { "RF2F" }, "top"); analysis.rf1FreqAndErrNormed = dblock.GetChannelValueAndError(new string[] { "RF1F" }, "topNormed"); analysis.rf2FreqAndErrNormed = dblock.GetChannelValueAndError(new string[] { "RF2F" }, "topNormed"); analysis.RF1FDBDB = dblock.GetSpecialChannelValueAndError( "RF1FDBDB", "topNormed" ); analysis.RF2FDBDB = dblock.GetSpecialChannelValueAndError( "RF2FDBDB", "topNormed" ); //rf amp analysis.rf1AmpAndErr = dblock.GetChannelValueAndError(new string[] { "RF1A" }, "top"); analysis.rf2AmpAndErr = dblock.GetChannelValueAndError(new string[] { "RF2A" }, "top"); analysis.rf1AmpAndErrNormed = dblock.GetChannelValueAndError(new string[] { "RF1A" }, "topNormed"); analysis.rf2AmpAndErrNormed = dblock.GetChannelValueAndError(new string[] { "RF2A" }, "topNormed"); analysis.RF1ADBDB = dblock.GetSpecialChannelValueAndError( "RF1ADBDB", "topNormed" ); analysis.RF2ADBDB = dblock.GetSpecialChannelValueAndError( "RF2ADBDB", "topNormed" ); //photodiodes analysis.probePD = dblock.GetChannelValueAndError(new string[] { "SIG" }, "ProbePD"); analysis.pumpPD = dblock.GetChannelValueAndError(new string[] {"SIG"}, "PumpPD"); //rfAmmeter analysis.rfCurrent = dblock.GetChannelValueAndError(new string[] { "SIG" }, "rfCurrent"); return analysis; }