private Segment GetSegment(ManualGaugingRecord gauging, VelocityObservation velocityObservation, Vertical precedingVertical) { var segmentVelocity = CalculateSegmentVelocity(velocityObservation, precedingVertical); var segmentWidth = CalculateSegmentWidth(gauging, precedingVertical); var segmentDepth = CalculateSegmentDepth(gauging, precedingVertical); var segmentArea = segmentDepth * segmentWidth; var segmentDischarge = segmentVelocity * segmentArea; Log.Info( $"Segment: Velocity={segmentVelocity} m/s, Depth={segmentDepth} m, Width={segmentWidth} m, Area={segmentArea} m^2, Discharge={segmentDischarge} m^3/s"); return(new Segment { Area = segmentArea, Discharge = segmentDischarge, IsDischargeEstimated = false, Velocity = segmentVelocity, Width = segmentWidth }); }
private VelocityObservation GetVelocityObservation(ManualGaugingRecord gauging) { var meterCalibration = GetMeterCalibration(); var depthObservations = GetVelocityDepthObservations(gauging, meterCalibration); var meanVelocity = CalculateMeanVelocity(depthObservations); var observationMethod = FieldVisit.DischargeActivity.ObservationMethodType; var velocityObservation = new VelocityObservation { MeanVelocity = meanVelocity, VelocityObservationMethod = observationMethod, MeterCalibration = meterCalibration, DeploymentMethod = DeploymentMethodType.Unspecified }; foreach (var observation in depthObservations) { velocityObservation.Observations.Add(observation); } Log.Info($"VelocityObservation: VMV={meanVelocity}, observationMethod={observationMethod}"); return(velocityObservation); }
private static double CalculateSegmentVelocity(VelocityObservation velocityObservation, Vertical precedingVertical) { return((precedingVertical.VelocityObservation.MeanVelocity + velocityObservation.MeanVelocity) / 2); }