Skip to contents

This function is for reading from an observations file. The data should be at geographic points and either at a single vertical level, or multiple vertical levels.

Usage

read_obs_file(
  file_name,
  parameter,
  param_defs = get("harp_params"),
  dttm = NULL,
  stations = NULL,
  file_format = NULL,
  file_format_opts = list(),
  ...
)

Arguments

file_name

The full path of the file to be read.

parameter

Parameters to extract from the file. If missing or NULL, all parameters are extracted from the file.

param_defs

A list of parameter definitions that includes the file format to be read. By default the built in list harp_params is used. Modifications and additions to this list can be made using modify_param_def and add_param_def respectively.

dttm

The date times to extract from the file. If NULL, all date times are extracted from the file. seq_dttm can be used to generate a vector of equally spaced date-time strings.

stations

Station IDs to extract from file. If NULL, all station IDs are extracted from the file.

file_format

The format of the file to read.

file_format_opts

Options specific to the file format as a named list.

...

Not used - absorbs other arguments from calling environment.

Value

A named list with up to four elements

  • synop - a data frame of observations at a single vertical level.

  • temp - a data frame of observations at multiple vertical levels.

  • synop_params - a data frame of the units and accumulation times of the parameters in synop.

  • temp_params - a data frame of units and accumulation times of the parameters in temp.

Details

The file format will be guessed if it is not explicitly passed and options for each file format should be passed as a list via the file_format_opts argument.

No interpolation is done with this function. For reading and interpolating gridded observations, use read_analysis.