///  Writes three spectra files to disk so that the data can be compared before and after summing
        public void GetSummedSpectrumTestWriteToDisk()
        {
            var testfile =
                @"\\proto-5\BionetXfer\People\ScottK\2012_01_12 SPIN QTOF3\GLY06_11JAN12_LYNX_SN7980_TOP4wList_75000_SPIN_2.d";

            Run run = new DeconTools.Backend.Runs.AgilentDRun(testfile);

            var primaryScan = 10000;
            //Scan A
            var scansetA = new ScanSet(primaryScan - 1);
            var xydata   = new XYData();

            xydata = run.GetMassSpectrum(scansetA, 0, 6000);

            TestUtilities.WriteToFile(xydata, @"P:\ScanA.txt");

            TestUtilities.DisplayXYValues(xydata);
            Console.WriteLine("numPoints = " + run.XYData.Xvalues.Length);
            Assert.AreEqual(258899, run.XYData.Xvalues.Length);

            //Scan B
            var scansetB = new ScanSet(primaryScan);

            xydata = run.GetMassSpectrum(scansetB, 0, 6000);

            TestUtilities.WriteToFile(run.XYData, @"P:\ScanB.txt");

            TestUtilities.DisplayXYValues(run.XYData);
            Console.WriteLine("numPoints = " + run.XYData.Xvalues.Length);
            Assert.AreEqual(258899, run.XYData.Xvalues.Length);

            //Scan C
            var scansetC = new ScanSet(primaryScan + 1);

            xydata = run.GetMassSpectrum(scansetC, 0, 6000);

            TestUtilities.WriteToFile(run.XYData, @"P:\ScanC.txt");

            TestUtilities.DisplayXYValues(run.XYData);
            Console.WriteLine("numPoints = " + run.XYData.Xvalues.Length);
            Assert.AreEqual(258899, run.XYData.Xvalues.Length);

            //Scan ABC summed
            var scansetSum = new ScanSet(primaryScan, primaryScan - 1, primaryScan + 1);//primary, min, max

            xydata = run.GetMassSpectrum(scansetSum, 0, 6000);

            TestUtilities.WriteToFile(run.XYData, @"P:\ScanABC.txt");

            TestUtilities.DisplayXYValues(run.XYData);
            Console.WriteLine("numPoints = " + run.XYData.Xvalues.Length);
            Assert.AreEqual(258899, run.XYData.Xvalues.Length);
        }
        ///checks the length of a non-summed and summed spectra
        public void GetSummedSpectrumTest1()
        {
            var testfile =
                @"\\proto-5\BionetXfer\People\ScottK\2012_01_12 SPIN QTOF3\GLY06_11JAN12_LYNX_SN7980_TOP4wList_75000_SPIN_2.d";

            var stopWatch = new Stopwatch();


            Run run = new DeconTools.Backend.Runs.AgilentDRun(testfile);

            var scanset = new ScanSet(25);

            stopWatch.Start();

            var xydata = new XYData();

            xydata = run.GetMassSpectrum(scanset);

            stopWatch.Stop();
            var singleSpectraLoadTime = stopWatch.Elapsed;

            TestUtilities.DisplayXYValues(run.XYData);
            Console.WriteLine("numPoints = " + run.XYData.Xvalues.Length);
            Assert.AreEqual(258899, run.XYData.Xvalues.Length);


            var scansetSum = new ScanSet(25, 24, 26);

            stopWatch.Start();

            xydata = run.GetMassSpectrum(scansetSum);

            stopWatch.Stop();
            var threeScanSumSpectraLoadTime = stopWatch.Elapsed;


            TestUtilities.DisplayXYValues(run.XYData);
            Console.WriteLine("numPoints = " + run.XYData.Xvalues.Length);
            Console.WriteLine("This took " + singleSpectraLoadTime + " seconds to load one scan");
            Console.WriteLine("This took " + threeScanSumSpectraLoadTime + " seconds to load and sum three scans");
            Assert.AreEqual(258899, run.XYData.Xvalues.Length);
        }
        public void GetSpectrumTest1()
        {
            Run run = new DeconTools.Backend.Runs.AgilentDRun(agilentDataset1);

            var scanset = new ScanSet(25);
            var xydata  = new XYData();

            xydata = run.GetMassSpectrum(scanset, 0, 6000);
            //TestUtilities.DisplayXYValues(xydata);
            Console.WriteLine("numPoints = " + xydata.Xvalues.Length);
            Assert.AreEqual(156723, xydata.Xvalues.Length);
        }