getsonde {RadioSonde}R Documentation

read a radiosonde file to an R dataframe.


getsonde takes a common radiosonde data file and reads it in as an R dataframe.


 getsonde(filename, datakey="------", varkey=" Time", unitkey="  sec") 


filename Full path and file name of radiosonde data.
datakey character string identifying the line preceeding the datastream
varkey character string identifying the line containing the variable names
unitkey character string identifying the line containing the units of the variables


getsonde assumes the data is in a very common format for radiosonde data. The files are typically ASCII files with a header of unknown length stating such things as the location and time of the data collection etc. Appended to this is a table of data where each column is a particular quantity and each row corresponds to the time of the observation. This typically has a header identifying the quantity in each of the columns and is separated from the data by a particular character string. The location of this string in the file is crucial in deciphering the start of the datastream from the metadata. For much more about the file format, go to the Discussion section or look at the example (RadioSonde/example.shtml)


Returns a dataframe with the following items, if present in the input file. Note that each of these items can be present in any order in the input file.

time time in seconds since weather balloon launched or recording begins.
press Pressure in mb.
temp Dry-bulb Temperature in degrees C.
dewpt Dew point temperature in degrees C.
rhum Relative Humidity (Percent).
uwind East-West wind component (m/s).
vwind North-South wind component (m/s).
wspd Wind speed (m/s).
wdir Wind direction (deg.).
dz Ascension rate of weather balloon (m/s).
lon Longitude of weather balloon.
lat Latitude of weather balloon .
rng Range (see warning below)
az Azimuth of weather balloon from originating station (see warning below)
alt Altitude of weather balloon (m).
qp Quality Control (QC) flag for pressure (see note below)
qt QC flag for temperature (see note below)
qh QC flag for humidity (see note below)
qu QC flag for U Component (see note below)
qv QC flag for V Component (see note below)
quv QC flag for Ascension rate (see note below)

If the units are avialable in the datafile, they are included in the dataframe as the attribute units.

Rather than throw away the original header information, which usually contains valuable metadata, it is included as another attribute: metadata.


The connotation of fields is not exactly standard. Different recording systems use these fields in different ways. Hence, they cannot be automatically interpreted without knowledge of the recording system.


The Quality Control information (flags): qp, qt, qh, qu, qv, and quv are generated at JOSS are based on the automated or visual checks made. The JOSS QC flags are as follows:
99.0 means it is unchecked,
1.0 implies datum seems physically reasonable (good),
2.0 implies datum seems questionable on physical basis (maybe),
3.0 implies datum seems to be in error (bad),
4.0 implies datum is interpolated (estimated), and
9.0 implies datum was missing in original file (missing).


Tim Hoar, Eric Gilleland, Doug Nychka

See Also

plotsonde, plotwind, skewt.points, skewt.lines


# Read a typical radiosonde (ASCII) dataset, headers and all.

filename <- paste(.path.package("RadioSonde"),"data","ExampleSonde.txt",sep="/")
sample.sonde <- getsonde(filename)

[Package Contents]