コード例 #1
0
        public static void GetPeaks(string[] args)
        {
            var fileName = args.Length < 2 ? "data/xResult" : args[1];
            var epsilon  = args.Length < 3 ? 50 : Int32.Parse(args[2]);
            var treshold = args.Length < 4 ? 300 : Int32.Parse(args[3]);

            string[] lines = File.ReadAllLines(String.Format("{0}.txt", fileName));
            var      data  = lines.Aggregate(new List <int>(), (p, c) =>
            {
                var value = Int32.Parse(c.Split(' ')[1]);
                p.Add(value);
                return(p);
            }).ToArray();


            var peaksFile = String.Format("{0}_peaks", fileName);

            Peaks.GetPeaks(peaksFile, data, epsilon, treshold);

            return;
        }