# Barometric Compensation Method - Technical Details

This section presents the details of how the Pressure values are computed, and how Pressure and Temperature values are converted to Water Level or Sensor Depth depending on the information supplied by the user. Where relevant to the discussion, equations are included.

## Glossary of Terms

Traw        Raw 12-bit Temperature value from logger

Treal        Temperature value after being run through the transfer function

Tref          Temperature value at the reference time

Praw        Raw 14-bit Pressure value from logger

Preal        Pressure value after being run through the transfer function, which is a function of raw pressure and raw temperature.

Pbaro0     Barometric pressure at the reference time selected by user

Pconst      Constant value for barometric pressure

Dref         Calculated reference water depth at the reference time, extracted from the downwell pressure data

Dbaro0     Calculated barometric “depth” at the reference time, extracted from the barometric pressure data

Dreal[]      An array of actual computed sensor depth values

Lmeas      Manually measured reference water level from a fixed reference, such as a well cap or sea level.

Lreal[]       An array of actual computed water level values

ρ             Density

k             Barometric compensation constant

## Pressure Calculation

Barometric Compensation is performed by a set of Java classes that encapsulate the process of performing the conversion of pressure values to true depth readings. Before performing barometric compensation, the raw values from the logger must be converted into real pressure. HOBOware’s communications interface is responsible for extracting the raw A/D pressure and temperature data (raw counts) from the logger and performing the initial processing into real pressure and temperature, as follows.

1.Extract raw 12-bit Temperature values (Traw) from logger.

2.Extract raw 14-bit Pressure values (Praw) from logger.

3.Extract transfer function/calibration constants (Kn … K2, K1, Kand Jn … J2, J1, J0) from the EEPROM inside the logger.

4.Apply transfer function to the Traw data to generate Treal.

5.Apply transfer function to the Praw data to generate Preal.

6.Store Treal and Preal values in separate channels in the resultant dataset.

The resultant dataset is then passed to the HOBOware user-interface for post-processing in the BCA.  This post-processing is described next.

## Water Level / Depth Calculation

There are several options for computing water level or sensor depth that can be grouped into two categories: using and not using a reference water level. The recommended method is to use a measured reference water level; therefore, it is presented first.

### Using a Reference Water level

Note that this option results in the calculation of a Water Level relative to a fixed reference point, not a Fluid Depth.

First, a temperature and density corrected depth array is computed. This is the depth assuming all pressure is from hydraulic head (no air pressure).

To compute this array, first the fluid density is computed. This is either determined by the user-selected density, or is computed from the temperature at the reference time, via:

ρ = (999.83952 + 16.945176 Tref - 7.9870401e-03 Tref2 - 46.170461e-06 Tref3 + 105.56302e-09 Tref4 - 280.54253e-12 Tref5) / (1 + 16.879850e-03 Tref)         

Density is converted to lb/ft3 via:

ρ = 0.0624279606 ρ    

The array of downwell pressure values, P,  are then converted to a density dependent fluid depth array, D[], via:

D[]= FEET_TO_METERS * (KPA_TO_PSI * PSI_TO_PSF * P) / ρ           

Where,

FEET_TO_METERS = 0.3048

KPA_TO_PSI = 0.1450377

PSI_TO_PSF = 144.0

The density dependent depth value at the reference time is then extracted from the array:

Dref = D[Ref Time]

The remaining steps to compute water level values can be done in one of three ways, as follows:

Using a Barometric Datafile

If the user chooses to compensate with a barometric datafile, the following steps are taken.

The Pressure value in the barometric dataset closest to the selected reference time is determined.  If there is not a time in the barometric pressure channel that coincides with the reference time, a value is determined via linear interpolation. This reference pressure is referred to as Pbaro0.

Next, the fluid density at the reference time is determined. This is either the user-entered density, or is computed from Equations 1 & 2, resulting in ρref.

The pressure at the reference time is converted to a barometric “depth” using Equation 3, resulting in Dbaro0.

The compensation constant, k, is determined by:

k = Lmeas - (Dref - Dbaro0)         

At this point, the compensation constant is applied to each downwell barometric depth reading in the array, D. An important step here is to determine the proper barometric pressure value to use.  Since the BCA does not require that then barometric pressure channel have the same sample times as the downwell pressure channel, individual values for barometric pressure, Pbaro, may sometimes be interpolated between the points closest to the downwell pressure value of interest.

Loop through the entire downwell channel, applying the compensation constant to the density dependent fluid depth values computed above. This is the step that adjusts the density dependent depth values for fluctuations in barometric pressure. This is determined by:

Lreal[]= D[] – Dbaro[] + k       

Where Lreal[] is an array of the actual water level values (from a fixed reference point), D is the density dependent fluid depth array computed earlier, Dbaro is the barometric depth at the time index in the array (using Equation 3), and k is the compensation constant. The values of Lreal are stored in a new Water Level channel and added to the list of available channels to plot.

### Using No Barometric Data

If the user chooses not to use a barometric datafile, the process of generating a water level is simple, although less accurate.  The resultant water level values in this case do not take into account fluctuations in barometric pressure.  In this case, the compensation constant is defined as:

k = Lmeas - Dref             

Loop through the entire downwell channel, applying the compensation constant to the density dependent fluid depth values computed above.  The array of actual water level values is computed using:

Lreal[] = D[] + k          

The values of Lreal are stored in a new Water Level channel and added to the list of available channels to plot.

### Using a Constant Barometric Pressure

The equations used to generate water level using a reference water level and a constant barometric pressure result in the constant pressure term falling out. Since the constant barometric pressure value does not affect the resulting water level, this option is intentionally disabled in the BCA.

## Not Using a Reference Water Level

If no reference water level data is available, the only option is to compute sensor depth below the water surface. This can be done using a barometric datafile or a constant barometric pressure value supplied by the user. Using a barometric datafile is the more accurate of the two methods and is presented first.

### Using a Barometric Datafile

Loop through the entire downwell data array. First generate the fluid density, ρ, for each time in the array. This is either determined by the user-selected density, or is computed from the temperature at the reference time, using Equations 1 & 2.

Next, compute the hydraulic pressure at each time, Phyd[], using:

Phyd[t] = Preal[t] – Pbaro[t]     

Where Preal[] is the array of measured downwell pressure values and Pbaro[] is the array of measured barometric pressure values.

Finally, convert the hydraulic pressure to sensor depth, Dreal, using Equation 3.  The values of Dreal are stored in a new Sensor Depth channel and added to the list of available channels to plot.

### Using a Constant Barometric Pressure

The first step is to grab the value of constant barometric pressure, Pconst, and convert to kPa if necessary.

Next, loop through the entire downwell data array. First generate the fluid density, ρ, for each time in the array. This is either determined by the user-selected density, or is computed from the temperature at the reference time, using Equations 1 & 2.

Next, compute the hydraulic pressure at each time, Phyd[], using:

Phyd[t] = Preal[t] – Pconst         

Where Preal[] is the array of measured downwell pressure.

Finally, convert the hydraulic pressure to sensor depth, Dreal, using Equation 3.  The values of Dreal are stored in a new Sensor Depth channel and added to the list of available channels to plot.

Associated Products
General Reason