read.sealevel {oce}R Documentation

Read a sea-level data file

Description

Read a data file holding sea level data. BUG: the time vector assumes GMT, regardless of the GMT.offset value.

Usage

read.sealevel(file, tz=getOption("oce.tz"), log.action, debug=FALSE)

Arguments

file a connection or a character string giving the name of the file to load. See Details for the types of files that are recognized.
tz time zone. The default value, oce.tz, is set to UTC at setup. (If a time zone is present in the file header, this will supercede the value given here.)
log.action if provided, the action item to be stored in the log. (Typically only provided for internal calls; the default that it provides is better for normal calls by a user.)
debug set to TRUE to get debugging information during processing.

Details

This function starts by scanning the first line of the file, from which it determines whether the file is in one of two known formats: type 1, the format used at the Hawaii archive centre, and type 2, the comma-separated-value format used by the Marine Environmental Data Service. (The file type is inferred by checking for the existence of the string Station_Name on the first line of the file, indicating type 2.) If the file is in neither of these formats, the user might wish to scan it directly, and then to use as.sealevel to create a sealevel object.

Value

An object of class "sealevel", which is a list containing

data A data.frame containing
t
time
eta
sea level [m]
metadata A list containing
header
the header line or lines. (This may prove helpful if detail extraction fails.)
year
year in which the observations were made.
station.number
identifier for the station.
station.version
see online docs at site mentioned in References.
station.name
name of station
region
a region code.
latitude
latitude, decimal degrees, positive north of equator.
longitude
longitude, decimal degrees, positive east of Greenwich.
GMT.offset
offset from GMT time. This is read directly from files of type 1. For files of type 2, the offset is inferred from the timezone, but this is a somewhat risky business, since timezone names are not standard.
decimation.method
see online docs at sites mentioned in References.
reference.offset
a reference offset; see online docs at sites mentioned in References.
reference.code
a reference code; see online docs at site mentioned in References.
units
unit of observations in the original file (normally "MM")
n
number of observations.
sampling.interval
hours between samples in the timeseries.
processing.log A processing log, in the standard oce format.

Author(s)

Dan Kelley

References

The Hawaii archive site at http://ilikai.soest.hawaii.edu/uhslc/datai.html provides a graphical interface for downloading sealevel data in Type 1 (the format is described at ftp://ilikai.soest.hawaii.edu/rqds/hourly.fmt). The MEDS repository provides Type 2 data, at http://www.meds-sdmm.dfo-mpo.gc.ca/meds/Databases/TWL/TWL_inventory_e.htm.

See Also

The generic function read.oce provides an alternative to this. A sealevel object may be summarized with summary.sealevel. Use plot.sealevel to produce a summary plot, and use tidem to fit a tidal model to the data.

A "sealevel" object can also be constructed with as.sealevel (and, in fact, read.sealevel uses this routine to actually create the "sealevel" object.)

Examples

## Not run: 
library(oce)
# San Francisco data
# ftp://ilikai.soest.hawaii.edu/rqds/pacific/hourly/h551a.zip
h <- read.sealevel("h551a/h551a01.dat")
summary(h)
plot(h)
## End(Not run)

[Package oce version 0.1-76 Index]