Logger Data Calculations

Calculated Parameters can be added to a Logger Event, as shown below.


Calculations can reference Parameters in the same Logger Event, or from a different Logger Event (the date ranges must overlap). A common use case for this scenario is to correct a downhole groundwater pressure sensor against a seperate barometric pressure sensor.

The script below shows an example script to calculate water depth using the sensor depth (below top of casing) and a dowhole sensor corrected for barometric pressure changes. Any valid Typescript calculation can be used, as different logger device manufactorers provide different methods for the calculation.

The script shown above is reproduced below.

function calculate(
targetTime: Date,
readings: InterpolatedReadings,
allReadings: SensorDataGroup
): CalculatedValue | null {


const downhole_pressure_psi = readings['downhole pressure psi']
const barometric_pressure_psi = readings['barometric pressure']
const depth_of_sensor_bTOC = 3.2
let estimated_water_above_sensor = null



if ( downhole_pressure_psi !== null && barometric_pressure_psi !== null )
{
//replace the calculation below as needed, incorporating barometric efficiency for the well and sensor constants
estimated_water_above_sensor = ((downhole_pressure_psi - barometric_pressure_psi)/1.012)*0.70307
}


if (estimated_water_above_sensor !== null )
{
const estimated_water_depth_bTOC = depth_of_sensor_bTOC - estimated_water_above_sensor
return {
TimeStamp: targetTime,
Measurement: estimated_water_depth_bTOC,
}
} else
{
return null;
}


}


By specifiying that the output from the calculation is an estimated groundwater depth, the result will be automatically calibrated to match manual dip readings measured for the piezometer.




The dip-corrected groundwater depths can then be output as a groundwater elevation via a simple subsequent calculated parameter.