| Title: | Reconstruct water level time series from satellite altimetry data |
|---|---|
| Description: | What the package does (one paragraph). |
| Authors: | Karina Nielsen [aut, cre] (ORCID: YOUR-ORCID-ID) |
| Maintainer: | Karina Nielsen <[email protected]> |
| License: | `use_mit_license()`, `use_gpl3_license()` or friends to pick a license |
| Version: | 0.0.0.9000 |
| Built: | 2026-05-16 05:40:20 UTC |
| Source: | https://github.com/cavios/tshydro |
This function saves the predicted water levels to a file
export.tsHydro(x, filename = "ts.dat", exportPar = FALSE)export.tsHydro(x, filename = "ts.dat", exportPar = FALSE)
x |
An object of class "tsHydro" |
filename |
Name of output file |
exportPar |
Logic variable to specify if the estimated model parameters are saved to a file "tsPar.dat". |
addError |
To add error bars |
The following elements
oupfile("ts.dat") A text file that contains three colunms; "time", "wl", "wlsd". "time" is the time of each pass, where the water level is estimated. "wl" is the estimated water level and "wlsd" is the standard deviation of the estimated water level.
"tspar.dat" A text file that contains the optimized model parameters
data(lakelevels) fit<-get.TS(lakelevels) export.tsHydro(fit,file="myTS.dat",exportPar=TRUE)data(lakelevels) fit<-get.TS(lakelevels) export.tsHydro(fit,file="myTS.dat",exportPar=TRUE)
Estimate the model parameters and return the estimated water levels
get.TS( dat, init.h = 0, init.logsigmarw = 0, init.logSigma = getSigmaInit(dat$satid), bias = rep(0, length(unique(dat$satid)) - 1), init.logit = log(0.1/(1 - 0.1)), priorHeight = numeric(0), priorSd = numeric(0), estP = FALSE, silent = TRUE, weights = rep(1, nrow(dat)), varPerTrack = FALSE, varPerQuality = FALSE, newdat = NULL, ... )get.TS( dat, init.h = 0, init.logsigmarw = 0, init.logSigma = getSigmaInit(dat$satid), bias = rep(0, length(unique(dat$satid)) - 1), init.logit = log(0.1/(1 - 0.1)), priorHeight = numeric(0), priorSd = numeric(0), estP = FALSE, silent = TRUE, weights = rep(1, nrow(dat)), varPerTrack = FALSE, varPerQuality = FALSE, newdat = NULL, ... )
dat |
A data.frame containing at least the columns: time, height, and track |
init.h |
Initial value for the mean water levels. The default value is 0. |
init.logsigmarw |
Initial value for the log of the standard deviation of the random walk |
init.logSigma |
Initial value for the log of the standard deviation of the random walk |
bias |
Optional, vector of length N-1 with Initial values of the bias estimates, where N is the numbers of satellite missions used. To estimate the bias "dat" must have a column "satid" with the ids of the satellites for each observation, 0,1,2,3,..,N-1. The number of bias estimates is N-1. The bias estimates is w.r.t. the satellite with the largest id. If dat$satid is provided the observation standard deviation is estimated pr satellite |
init.logit |
Initial value for the log of the standard deviation of the observation noise |
priorHeight |
... |
priorSd |
... |
estP |
A logic value |
weights |
Optional vector of weights. |
varPerTrack |
Optional, a logic value: If TRUE, an observation standard deviation is "logSigma" is estimated per track. |
varPerQuality |
Optional, a logic value: If TRUE, an observation standard deviation is "logSigma" is estimated per quality id. If this option is used "dat" must have a column named "qf" |
newdat |
Optional, a data frame which at least should include a column named "time", containing the time in decimal years where the modeled water level is predicted. newdat may also include a column named "group" with a group id for each observation. Groups could be based on month, years, or something else. If "group" is provided a average water level pr group is also provided |
exportPar |
Logic variable to specify if the estimated model parameters are saved to a file "tsPar.dat". |
The function can handle the observation based standard deviation in different ways; either pr satellite, pr track, or pr quality. However, these options cannot be used together.
An object of class "tsHydro" with the following elements
oupfile("ts.dat") A text file that contains three colunms; "time", "wl", "wlsd". "time" is the time of each pass, where the water level is estimated. "wl" is the estimated water level and "wlsd" is the standard deviation of the estimated water level.
"tspar.dat" A text file that contains the optimized model parameters
data(lakelevels) fit<-get.TS(lakelevels)data(lakelevels) fit<-get.TS(lakelevels)
Plot an object returned by the function get.TS()
## S3 method for class 'tsHydro' plot( x, addRawDat = TRUE, addLine = TRUE, addError = FALSE, zoomOut = FALSE, lwd = 4, col = "blue", ... )## S3 method for class 'tsHydro' plot( x, addRawDat = TRUE, addLine = TRUE, addError = FALSE, zoomOut = FALSE, lwd = 4, col = "blue", ... )
x |
Object returned by get.TS() |
addLine |
To add a line between the points that represents the estimated water levels. |
addError |
To add error bars |
zoomOut |
To zoom out. This option creates a plot which displays the range of the water level data. |
lwd |
Line width |
col |
Color |
... |
Additional argumants to plot |
addRawdat |
Adds the data, which the estimated water levels are based on |
data(lakelevels) fit<-get.TS(lakelevels) #Plot with error bars plot(fit,addError=TRUE,col='blue') #plot that includes the water level data #and displays the entire data range plot(fit,zoomOut=TRUE,col='red')data(lakelevels) fit<-get.TS(lakelevels) #Plot with error bars plot(fit,addError=TRUE,col='blue') #plot that includes the water level data #and displays the entire data range plot(fit,zoomOut=TRUE,col='red')
This function presents a summary of the output
## S3 method for class 'tsHydro' summary(x)## S3 method for class 'tsHydro' summary(x)
x |
An object of class "tsHydro" |
Summary of output