Exemplo n.º 1
0
        /// <summary>Sets the analysis thickness.</summary>
        /// <param name="analysis">The analysis.</param>
        /// <param name="thickness">The thickness to change the analysis to.</param>
        private static void SetAnalysisThickness(Analysis analysis, double[] thickness)
        {
            if (analysis != null && !MathUtilities.AreEqual(thickness, analysis.Thickness))
            {

                string[] metadata = StringUtilities.CreateStringArray("Mapped", thickness.Length);

                analysis.Al = MapConcentration(analysis.Al, analysis.Thickness, thickness, MathUtilities.LastValue(analysis.Al));
                analysis.AlMetadata = metadata;
                analysis.Ca = MapConcentration(analysis.Ca, analysis.Thickness, thickness, MathUtilities.LastValue(analysis.Ca));
                analysis.CaMetadata = metadata;
                analysis.CEC = MapConcentration(analysis.CEC, analysis.Thickness, thickness, MathUtilities.LastValue(analysis.CEC));
                analysis.CECMetadata = metadata;
                analysis.CL = MapConcentration(analysis.CL, analysis.Thickness, thickness, MathUtilities.LastValue(analysis.CL));
                analysis.CLMetadata = metadata;
                analysis.EC = MapConcentration(analysis.EC, analysis.Thickness, thickness, MathUtilities.LastValue(analysis.EC));
                analysis.ECMetadata = metadata;
                analysis.ESP = MapConcentration(analysis.ESP, analysis.Thickness, thickness, MathUtilities.LastValue(analysis.ESP));
                analysis.ESPMetadata = metadata;
                analysis.K = MapConcentration(analysis.K, analysis.Thickness, thickness, MathUtilities.LastValue(analysis.K));
                analysis.KMetadata = metadata;
                analysis.Mg = MapConcentration(analysis.Mg, analysis.Thickness, thickness, MathUtilities.LastValue(analysis.Mg));
                analysis.MgMetadata = metadata;
                analysis.Mn = MapConcentration(analysis.Mn, analysis.Thickness, thickness, MathUtilities.LastValue(analysis.Mn));
                analysis.MnMetadata = metadata;
                analysis.MunsellColour = null;
                analysis.Na = MapConcentration(analysis.Na, analysis.Thickness, thickness, MathUtilities.LastValue(analysis.Na));
                analysis.NaMetadata = metadata;
                analysis.ParticleSizeClay = MapConcentration(analysis.ParticleSizeClay, analysis.Thickness, thickness, MathUtilities.LastValue(analysis.ParticleSizeClay));
                analysis.ParticleSizeClayMetadata = metadata;
                analysis.ParticleSizeSand = MapConcentration(analysis.ParticleSizeSand, analysis.Thickness, thickness, MathUtilities.LastValue(analysis.ParticleSizeSand));
                analysis.ParticleSizeSandMetadata = metadata;
                analysis.ParticleSizeSilt = MapConcentration(analysis.ParticleSizeSilt, analysis.Thickness, thickness, MathUtilities.LastValue(analysis.ParticleSizeSilt));
                analysis.ParticleSizeSiltMetadata = metadata;
                analysis.PH = MapConcentration(analysis.PH, analysis.Thickness, thickness, MathUtilities.LastValue(analysis.PH));
                analysis.PHMetadata = metadata;
                analysis.Rocks = MapConcentration(analysis.Rocks, analysis.Thickness, thickness, MathUtilities.LastValue(analysis.Rocks));
                analysis.RocksMetadata = metadata;
                analysis.Texture = null;
                analysis.Thickness = thickness;

            }
        }
Exemplo n.º 2
0
        /// <summary>Converst PH to water units.</summary>
        /// <param name="ph">The ph.</param>
        /// <param name="units">The current units.</param>
        /// <returns>The converted values</returns>
        private static double[] PHWater(double[] ph, Analysis.PHUnitsEnum units)
        {
            if (units == Analysis.PHUnitsEnum.Water || ph == null)
                return ph;

            // pH in water = (pH in CaCl X 1.1045) - 0.1375
            return MathUtilities.Subtract_Value(MathUtilities.Multiply_Value(ph, 1.1045), 0.1375);
        }