CorrectHeading: CorrectHeading

CorrectHeadingR Documentation

CorrectHeading

Description

Calculate an estimate of the sequence of errors in heading.

Usage

CorrectHeading(
  .data,
  .span = 21,
  .default = -0.08,
  .Valid = NULL,
  .plotfile = "inLine"
)

Arguments

.data

A data.frame containing measurements of body accelerations (called BLATA, BLONGA, BNORMA), ground-speed components from GPS (GGVEW, GGVNS), attitude angles in units of degrees (PITCH, ROLL, THDG, the latter the heading relative to true north), and the latitude and altitude (LAT and GGALT), the latter two for finding the local acceleration of gravity. If variables named PITCHC, ROLLC, and LATC are present those will be used instead. The first two might be produced by prior use of the CorrectPitch() function. The data.frame variables must retain the original attributes from the netCDF file so that, if arbitrary "CalibrationCoefficients" have been applied these can be removed. The reason is that this routine needs the original unmodified value from the IRU for variables like THDG.

.span

The number of points (default 21) used for estimating the accelerations by differentiation and for smoothing the results.

.default

The default value to use if the routine does not find enough qualified turns to develop a valid estimate of the heading error. The default is -0.08 deg., as applies to the GV data for DEEPWAVE.

.Valid

An optional logical vector of length matching the rows in .data, which should be TRUE for qualified measurements and FALSE for measurements to exclude from the calculation. This can be used to exclude low-airspeed cases (where flaps might be deployed) or cases of rapid climbs, for example. The default is NULL, in which case the test will be skipped.

.plotfile

The name of a plot to generate (e.g., "./Plot1.pdf") that shows the results from the algorithm. The default is 'inLine', in which case the plot is generated and displayed normally. Suppress the plot with a NULL argument.

Details

For a data.frame supplied with variables representing the attitude angles, body accelerations, GPS-measured ground velocities, and altitude and latitude, estimate the error in the heading via comparison of the measured body accelerations, transformed to the Earth-relative frame, to the accelerations determined via differentiation of the GPS-measured ground-speed components. Find the correction to heading that provides the best match between these two sources of acceleration. The result is the estimated error, so this should be **subtracted** from the measured value to get the corrected value. Results are sensitive to timing delays among the variables, so these should be corrected prior to calling this routine. In addition, if there is a variable "Valid" in the data.frame, it should be logical and will be used to restrict the calculation of the corrections to the subset where Valid is TRUE. This can be used, for example, to exclude slow-flight regions where flaps might be deployed, high-rate-of-climb regions, etc.

Value

A vector of the same length as the supplied data.frame that gives an estimate of the error in heading, the negative of the correction needed.

Author(s)

William Cooper

Examples

HeadingCorrection <- CorrectHeading (RAFdata)

NCAR/Ranadu documentation built on Jan. 27, 2023, 1:09 a.m.