Exemplo n.º 1
0
        private static void ProcessData(Culture culture, float blankValue, bool doFit, string trueODCalibartionFunction, bool skipMonotonicFilter)
        {
            var raw = culture.GrowthMeasurements.GetMeasurements(DataType.Raw);

            raw = NNsmoothRawData(false, raw);
            SetThinRawData(false, ref culture, blankValue, trueODCalibartionFunction);

            var   count   = 0;
            float maxPeak = 0;
            var   treated = Modules.ProccessedDatapoints(raw, blankValue, trueODCalibartionFunction, out count, out maxPeak, false, false, skipMonotonicFilter);

            treated = NNSmoothProcessedData(false, raw, treated, blankValue, trueODCalibartionFunction, count, maxPeak);

            SetRawFilteredData(false, raw, ref culture);
            SetRawUnFilteredData(false, raw, ref culture, blankValue);

            var uncalibrated = Modules.ProccessedDatapoints(raw, blankValue, trueODCalibartionFunction, out count, out maxPeak, false, true);

            culture.GrowthMeasurements.SetMeasurements(Modules.ConvertBioScreenTimeToHrs(uncalibrated), DataType.ProcessedUncalibrated);

            if (count > 0)
            {
                SessionVariables.Peaks.Add(new Peak {
                    Well = culture.Container, MaxPeak = maxPeak, Number = count
                });
            }

            culture.GrowthMeasurements.SetMeasurements(treated, DataType.Processed);

            var firstDeriv = Modules.CalculateFirstDerivative(treated, FirstDerivWindow);

            culture.GrowthMeasurements.SetMeasurements(firstDeriv, DataType.FirstDerivative);
            SetNNSmoothFirstDeriv(false, firstDeriv, ref culture);

            culture.GrowthMeasurements.SetMeasurements(Modules.ConvertBioScreenTimeToHrs(raw), DataType.Raw);

            if (doFit)
            {
                SetNNSmoothProcessed(culture, treated);
            }
        }
Exemplo n.º 2
0
        public static void ReProcess(Culture culture)
        {
            var raw = culture.GrowthMeasurements.GetMeasurements(DataType.Raw);

            var thinRaw = culture.GrowthMeasurements.GetMeasurements(DataType.RawThinned);

            if (thinRaw != null)
            {
                var processesThinned = Modules.ProccessedDatapoints(thinRaw, BlankValue, TrueODCalibartionFunction);
                culture.GrowthMeasurements.SetMeasurements(processesThinned, DataType.ProcessedThinned);

                if (!Modules.NoGrowth(processesThinned))
                {
                    var metaDataThinned = new GrowthVariableMetaData();
                    var macroLagData    = Modules.GetLag(processesThinned);
                    metaDataThinned.Lag = macroLagData.InterceptStretchs;
                    var macroYieldData = Modules.GetYield(processesThinned);
                    metaDataThinned.Yield = macroYieldData.YieldAnchors;
                    var macroRateData = Modules.GetGT(processesThinned);
                    metaDataThinned.Rate = macroRateData.RateSlopeAnchors;
                    culture.GrowthMeasurements.SetMetaData(DataType.ProcessedThinned, metaDataThinned);
                }
            }
            var smooth = Modules.ProccessedDatapoints(raw, BlankValue, TrueODCalibartionFunction);

            culture.GrowthMeasurements.SetMeasurements(smooth, DataType.Processed);
            var firstDeriv = Modules.CalculateFirstDerivative(smooth, FirstDerivWindow);

            culture.GrowthMeasurements.SetMeasurements(firstDeriv, DataType.FirstDerivative);
            culture.GrowthMeasurements.SetMeasurements(Modules.ConvertBioScreenTimeToHrs(raw), DataType.Raw);

            double lag;
            double yield;
            double gt;
            var    metaData  = new GrowthVariableMetaData();
            var    processed = culture.GrowthMeasurements.GetMeasurements(DataType.Processed);

            if (Modules.NoGrowth(processed))
            {
                lag   = 48;
                yield = double.NaN;
                gt    = double.NaN;
            }
            else
            {
                var macroLagData = Modules.GetLag(processed);
                lag          = macroLagData.Lag;
                metaData.Lag = macroLagData.InterceptStretchs;
                var macroYieldData = Modules.GetYield(processed);
                yield          = macroYieldData.Yield;
                metaData.Yield = macroYieldData.YieldAnchors;
                var macroRateData = Modules.GetGT(processed);
                gt            = macroRateData.GT;
                metaData.Rate = macroRateData.RateSlopeAnchors;
            }

            culture.Lag   = lag;
            culture.Rate  = gt;
            culture.Yield = yield;
            culture.GrowthMeasurements.SetMetaData(DataType.Processed, metaData);
        }