public void AcquisitionFinished(Block b) { this.Block = b; mainWindow.AppendToTextArea("Demodulating block."); b.AddDetectorsToBlock(); DBlock = blockDemodulator.QuickDemodulateBlock(b); AnalysedDBlock = QuickEDMAnalysis.AnalyseDBlock(DBlock); liveViewer.AddAnalysedDBlock(AnalysedDBlock); //config.g haveBlock = true; appState = AppState.stopped; mainWindow.AppendToTextArea("Acquisition finished"); SetStatusReady(); }
//public void Clear() //{ //} public void AddDBlock(DemodulatedBlock dblock) { QuickEDMAnalysis analysis = QuickEDMAnalysis.AnalyseDBlock(dblock); //Append LiveViewer text with edm errors, B, DB & DB/SIG AppendStatusText( (Math.Pow(10, 26) * analysis.RawEDMErr).ToString("G3") + "\t" + (Math.Pow(10, 26) * analysis.RawEDMErrNormed).ToString("G3") + "\t\t" + (analysis.BValAndErr[0]).ToString("N2") + "\t" + (analysis.DBValAndErr[0]).ToString("N2") + "\t" + (analysis.DBValAndErr[0] / analysis.SIGValAndErr[0]).ToString("N3") + Environment.NewLine); // Rollings values of edm error clusterVariance = ((clusterVariance * (blockCount - 1)) + analysis.RawEDMErr * analysis.RawEDMErr) / blockCount; double edmPerDay = Math.Sqrt(clusterVariance / blocksPerDay); clusterVarianceNormed = ((clusterVarianceNormed * (blockCount - 1)) + analysis.RawEDMErrNormed * analysis.RawEDMErrNormed) / blockCount; double edmPerDayNormed = Math.Sqrt(clusterVarianceNormed / blocksPerDay); UpdateClusterStatusText( "errorPerDay: " + edmPerDay.ToString("E3") + "\terrorPerDayNormed: " + edmPerDayNormed.ToString("E3") + Environment.NewLine + "block count: " + blockCount); //Update Plots AppendToSigScatter(new double[] { blockCount }, new double[] { analysis.SIGValAndErr[0] }); AppendToSigNoiseScatter(new double[] { blockCount }, new double[] { analysis.SIGValAndErr[1] }); AppendToBScatter(new double[] { blockCount }, new double[] { analysis.BValAndErr[0] }); AppendToDBScatter(new double[] { blockCount }, new double[] { analysis.DBValAndErr[0] }); AppendToEDMScatter(new double[] { blockCount }, new double[] { Math.Pow(10, 26) * analysis.RawEDMErr }); AppendToEDMNormedScatter(new double[] { blockCount }, new double[] { Math.Pow(10, 26) * analysis.RawEDMErrNormed }); AppendSigmaToSIGScatter(new double[] { blockCount }, new double[] { analysis.SIGValAndErr[0] + analysis.SIGValAndErr[1] }, new double[] { analysis.SIGValAndErr[0] - analysis.SIGValAndErr[1] }); AppendSigmaToBScatter(new double[] { blockCount }, new double[] { analysis.BValAndErr[0] + analysis.BValAndErr[1] }, new double[] { analysis.BValAndErr[0] - analysis.BValAndErr[1] }); AppendSigmaToDBScatter(new double[] { blockCount }, new double[] { analysis.DBValAndErr[0] + analysis.DBValAndErr[1] }, new double[] { analysis.DBValAndErr[0] - analysis.DBValAndErr[1] }); AppendToNorthLeakageScatter(new double[] { blockCount }, new double[] { analysis.NorthCurrentValAndError[0] }); AppendToSouthLeakageScatter(new double[] { blockCount }, new double[] { analysis.SouthCurrentValAndError[0] }); AppendToNorthLeakageErrorScatter(new double[] { blockCount }, new double[] { analysis.NorthCurrentValAndError[1] }); AppendToSouthLeakageErrorScatter(new double[] { blockCount }, new double[] { analysis.SouthCurrentValAndError[1] }); AppendToNorthECorrLeakageScatter(new double[] { blockCount }, new double[] { analysis.NorthECorrCurrentValAndError[0] }); AppendToSouthECorrLeakageScatter(new double[] { blockCount }, new double[] { analysis.SouthECorrCurrentValAndError[0] }); AppendToMagNoiseScatter(new double[] { blockCount }, new double[] { analysis.MagValandErr[1] }); AppendToRfCurrentScatter(new double[] { blockCount }, new double[] { analysis.rfCurrent[0] }); AppendToLF1Scatter(new double[] { blockCount }, new double[] { analysis.LFValandErr[0] }); AppendToLF1NoiseScatter(new double[] { blockCount }, new double[] { analysis.LFValandErr[1] }); AppendToRF1AScatter(new double[] { blockCount }, new double[] { analysis.rf1AmpAndErr[0] }); AppendToRF2AScatter(new double[] { blockCount }, new double[] { analysis.rf2AmpAndErr[0] }); AppendToRF1FScatter(new double[] { blockCount }, new double[] { analysis.rf1FreqAndErr[0] }); AppendToRF2FScatter(new double[] { blockCount }, new double[] { analysis.rf2FreqAndErr[0] }); if (blockCount == 1) { initProbePD = analysis.probePD[0]; initPumpPD = analysis.pumpPD[0]; } AppendTopProbePDScatter(new double[] { blockCount }, new double[] { analysis.probePD[0] / initProbePD }); AppendTopPumpPDScatter(new double[] { blockCount }, new double[] { analysis.pumpPD[0] / initPumpPD }); AppendToLF1DBDBScatter(new double[] { blockCount }, new double[] { analysis.LF1DBDB[0] }); AppendToLF2DBDBScatter(new double[] { blockCount }, new double[] { analysis.LF2DBDB[0] }); AppendSigmaToLF1Scatter(new double[] { blockCount }, new double[] { analysis.LF1DBDB[0] + analysis.LF1DBDB[1] }, new double[] { analysis.LF1DBDB[0] - analysis.LF1DBDB[1] }); AppendSigmaToLF2Scatter(new double[] { blockCount }, new double[] { analysis.LF2DBDB[0] + analysis.LF2DBDB[1] }, new double[] { analysis.LF2DBDB[0] - analysis.LF2DBDB[1] }); blockCount = blockCount + 1; }