예제 #1
0
        public override ReturnCode IngestFile(ChannelCompartment compartment, string fileName)
        {
            ReturnCode returnCode = spectrumParser.ParseSpectrumFile(fileName);
            Spectrum   spectrum   = spectrumParser.GetSpectrum();
            DateTime   time       = spectrum.GetStartTime();
            TimeSpan   duration   = TimeSpan.FromSeconds(spectrum.GetRealTime());
            DataFile   dataFile   = new DataFile(fileName, time, time + duration);
            int        counts     = 0;

            for (int ch = 0; ch < spectrum.GetNChannels(); ch++)
            {
                counts += spectrum.GetCounts()[ch];
            }
            channels[COUNT_RATE].AddDataPoint(compartment, time, counts / spectrum.GetLiveTime(), duration, dataFile);


            foreach (VirtualChannel chan in virtualChannels)
            {
                if (chan is ROIChannel)
                {
                    ((ROIChannel)chan).AddDataPoint(compartment, time, spectrum, duration, dataFile);
                }
            }
            return(ReturnCode.SUCCESS);
        }
예제 #2
0
파일: Spectrum.cs 프로젝트: lanl/Omniscient
 public ReturnCode Add(Spectrum spectrum)
 {
     if (spectrum.GetNChannels() != counts.Length)
     {
         return(ReturnCode.FAIL);
     }
     int[] otherCounts = spectrum.GetCounts();
     for (int i = 0; i < counts.Length; i++)
     {
         counts[i] += otherCounts[i];
     }
     realTime += spectrum.GetRealTime();
     liveTime += spectrum.GetLiveTime();
     return(ReturnCode.SUCCESS);
 }
예제 #3
0
파일: ROI.cs 프로젝트: lanl/Omniscient
 public double GetROICountRate(Spectrum spec)
 {
     return(GetROICounts(spec) / spec.GetLiveTime());
 }