Example #1
0
        public static GatedDetectorData ExtractFromBlock(Block b, GatedDetectorExtractSpec gate)
        {
            GatedDetectorData            gd = new GatedDetectorData();
            GatedDetectorExtractFunction f;

            if (gate.Integrate)
            {
                f = new GatedDetectorExtractFunction(b.GetTOFIntegralArray);
            }
            else
            {
                f = new GatedDetectorExtractFunction(b.GetTOFMeanArray);
            }
            double[] rawData = f(gate.Index, gate.GateLow, gate.GateHigh);
            //if (gate.BackgroundSubtract)
            //{
            //TOFFitResults results = (new TOFFitter()).FitTOF(b.GetAverageTOF(gate.Index));
            //double bg = results.Background * (gate.GateHigh - gate.GateLow);
            //double[] bgSubData = new double[rawData.Length];
            //for (int i = 0; i < rawData.Length; i++) bgSubData[i] = rawData[i] - bg;
            //gd.PointValues.AddRange(bgSubData);
            //gd.SubtractedBackground = bg;
            //}
            //else
            //{
            gd.PointValues.AddRange(rawData);
            //}
            gd.Gate = gate;
            return(gd);
        }
Example #2
0
        private double[] GetGatedDetectorData(Block b, string detector, Gate gate)
        {
            int           detectorIndex = b.detectors.IndexOf(detector);
            List <double> gatedData     = new List <double>();
            GatedDetectorExtractFunction f;

            if (gate.Integrate)
            {
                f = new GatedDetectorExtractFunction(b.GetTOFIntegralArray);
            }
            else
            {
                f = new GatedDetectorExtractFunction(b.GetTOFMeanArray);
            }
            double[] rawData = f(detectorIndex, gate.GateLow, gate.GateHigh);
            return(rawData);
        }
Example #3
0
 public static GatedDetectorData ExtractFromBlock(Block b, GatedDetectorExtractSpec gate)
 {
     GatedDetectorData gd = new GatedDetectorData();
     GatedDetectorExtractFunction f;
     if (gate.Integrate) f = new GatedDetectorExtractFunction(b.GetTOFIntegralArray);
     else f = new GatedDetectorExtractFunction(b.GetTOFMeanArray);
     double[] rawData = f(gate.Index, gate.GateLow, gate.GateHigh);
     //if (gate.BackgroundSubtract)
     //{
         //TOFFitResults results = (new TOFFitter()).FitTOF(b.GetAverageTOF(gate.Index));
         //double bg = results.Background * (gate.GateHigh - gate.GateLow);
         //double[] bgSubData = new double[rawData.Length];
         //for (int i = 0; i < rawData.Length; i++) bgSubData[i] = rawData[i] - bg;
         //gd.PointValues.AddRange(bgSubData);
         //gd.SubtractedBackground = bg;
     //}
     //else
     //{
         gd.PointValues.AddRange(rawData);
     //}
     gd.Gate = gate;
     return gd;
 }