R/td.to.q.R

Defines functions td.to.q

Documented in td.to.q

td.to.q <- function(temp, td, p)
{
  # calculate specific humidity (g/kg) using temperature and dew-point T
  es <- 6.1121 * exp((temp * 17.67)/(temp + 243.5))
  e <- 6.1121 * exp((td * 17.67)/(td + 243.5))
  q <- (1000. * (0.62197 * e))/(p - (1. - 0.62197) * e)
  return(q)
}

Try the RadioSonde package in your browser

Any scripts or data that you put into this service are public.

RadioSonde documentation built on May 30, 2017, 1:13 a.m.