Read daily cummulated solar spectrum data file(s).

Share:

Description

Read one or more cumulated daily spectral irradiance file as output by Anders Lindors' model based on libRadTrans. The file naming conventions needed are fairly strict, and file name should contain the date in a format suitable for decoding by the function suplied as date.f.

Usage

1
2
3
4
5
6
read_fmi_cum(file, date = NULL, geocode = NULL, label = NULL, tz = NULL,
  locale = readr::default_locale(), .skip = 3, .n_max = -1,
  .date.f = lubridate::ymd)

read_m_fmi_cum(files, date = NULL, geocode = NULL, label = NULL,
  tz = NULL, .skip = 3, .n_max = -1, .date.f = lubridate::ymd)

Arguments

file

Either a path to a file, a connection, or literal data (either a single string or a raw vector).

date

a POSIXct object, but if NULL the date stored in file is used, and if NA no date variable is added

geocode

A data frame with columns lon and lat.

label

character string, but if NULL the value of file is used, and if NA the "what.measured" attribute is not set.

tz

character Time zone used for interpreting times saved in the file header.

locale

The locale controls defaults that vary from place to place. The default locale is US-centric (like R), but you can use locale to create your own locale that controls things like the default time zone, encoding, decimal mark, big mark, and day/month names.

.skip

Number of lines to skip before reading data.

.n_max

Maximum number of records to read.

.date.f

A function for extracting a date-time from the file name passed as charecter sring to its first argument and which returns a POSIXct object.

files

list or vector of paths each one with the same requirements as described for argument file.

Value

read_fmi_cum() returns a source_spct object with time.unit attribute set to "day" and when.measured attribute set to the date-time extracted from the file name.

read_m_fmi_cum returns a collection of source_mspct.

Note

See read_table for details of acceptable values for file.