Beispiel #1
0
        public static async Task <WideScan> GenerateAsync(string directory)
        {
            var scan = new WideScan();
            await scan.LoadFromAsync(directory);

            return(scan);
        }
Beispiel #2
0
        // とりあえず.
        public static WideScan Generate(string directory)
        {
            var scan = new WideScan();

            scan.LoadFrom(directory);
            return(scan);
        }
Beispiel #3
0
        /// <summary>
        /// 与えられたパラメータによりシフトされたデータ列を返します.
        /// </summary>
        /// <param name="parameter">エネルギー軸の範囲の情報だけを用いています.</param>
        /// <param name="m"></param>
        /// <returns></returns>
        public async Task <IList <decimal> > GetDataAsync(ScanParameter parameter, int m, decimal shift = 0, decimal gain = 1)
        {
            if (m <= 0)
            {
                throw new ArgumentException("mには正の値を与えて下さい.");
            }
            var ws = await WideScan.GenerateAsync(this.DirectoryName);

            return(ws.Differentiate(m)
                   .GetInterpolatedData(parameter.Start - shift, parameter.Step, parameter.PointsCount)
                   .Select(d => d * ws.Parameter.NormalizationGain / parameter.NormalizationGain * gain).ToList());
        }
Beispiel #4
0
        static List <List <decimal> > LoadShiftedStandardsData(ICollection <ReferenceSpectrum> references, ScanParameter parameter)
        {
            List <List <decimal> > standards = new List <List <decimal> >();

            foreach (var item in references)
            {
                var ws = WideScan.Generate(item.DirectoryName);
                standards.Add(
                    ws.Differentiate(3)
                    .GetInterpolatedData(parameter.Start, parameter.Step, parameter.PointsCount)
                    .Select(d => d * ws.Parameter.NormalizationGain / parameter.NormalizationGain).ToList()
                    );
            }
            return(standards);
        }