getsonde             package:RadioSonde             R Documentation

_r_e_a_d _a _r_a_d_i_o_s_o_n_d_e _f_i_l_e _t_o _a_n _R _d_a_t_a_f_r_a_m_e.

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

filename: Full path and file name of radiosonde data.

 datakey: character string identifying the line preceeding the
          datastream.  The string gets compared to the first N
          characters of each line, so  all whitespace is important!

  varkey: character string identifying the line containing the variable
          names. The string gets compared to the first N characters of
          each line, so  all whitespace is important!

 unitkey: character string identifying the line containing the units of
          the variables. The string gets compared to the first N
          characters of each line, so  all whitespace is important!

_D_e_t_a_i_l_s:

     `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 <URL: http://www.cgd.ucar.edu/stats/RadioSonde> or look at
     the example in  `RadioSonde/data/ExampleSonde.txt'

_V_a_l_u_e:

     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'.

_W_a_r_n_i_n_g:

     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.

_N_o_t_e:

     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).

_A_u_t_h_o_r(_s):

     Tim Hoar, Eric Gilleland, Doug Nychka

_S_e_e _A_l_s_o:

     `plotsonde' ,  `skewt.points' ,  `skewt.lines'

_E_x_a_m_p_l_e_s:

     # Read a typical radiosonde (ASCII) datafile, headers and all.
     # The datakey,varkey,and unitkey arguments come from examining 
     # the datafile. The whitespace is important.

     filename <- system.file("exampleData", "ExampleSonde.txt", package = "RadioSonde")   
     datakey  <- "------"
     varkey   <- " Time"
     unitkey  <- "  sec"
     sample.sonde <- getsonde(filename,datakey,varkey,unitkey)
     attr(sample.sonde,"units")
     attr(sample.sonde,"metadata")
     plotsonde(sample.sonde,title=filename)
     #
     # Read the same radiosonde dataset, but ignore the units ... 
     #
     datakey  <- "------"
     varkey   <- " Time"
     sample.sonde <- getsonde(filename,datakey,varkey)
     attr(sample.sonde,"metadata")

