marsInterpolateBaro: Interpolate barometric pressure with inverse distance...

View source: R/mars_data_fetch_write_functions.R

marsInterpolateBaroR Documentation

Interpolate barometric pressure with inverse distance weighting

Description

Returns an interpolated barometric pressure reading or NA

Usage

marsInterpolateBaro(baro_psi, smp_id, weight, target_id)

Arguments

baro_psi

vector, num, barometric pressures measured at the same timestamp

smp_id

vector, chr, SMP IDs where the measurements took place

weight

vector, num, of inverse distances weights for each baro, calculated by marsFetchBaroData

target_id

chr, single SMP ID where the user has requested data

Value

Output will be a single barometric pressure reading. If there are 4 or greater baros with data, the reading will be an inverse distance-weighted interpolation of those readings. If there are fewer than 4 readings, return NA.

See Also

marsFetchBaroData, data: marsSampleBaro

Examples


 data(marsSampleBaro)

 marsInterpolateBaro(
   baro_psi = marsSampleBaro[[1]]$baro_psi, 
   smp_id = marsSampleBaro[[1]]$smp_id, 
   weight = marsSampleBaro[[1]]$weight, 
   target_id = marsSampleBaro[[2]]
   )


taywater/pwdgsi documentation built on June 14, 2025, 9 p.m.