View source: R/sidfex.read.fcst.R
sidfex.read.fcst | R Documentation |
Read SIDFEx forecast data and (optionally) merge ensembles.
sidfex.read.fcst(files=NULL,data.path=NULL,GroupID=NULL,MethodID=NULL,TargetID=NULL,InitYear=NULL,InitDayOfYear=NULL,EnsMemNum=NULL,ens.merge=TRUE,checkfileformat=TRUE,verbose=TRUE,speed.fix=TRUE,speed.fix.max=80,timedupli.fix=TRUE,nrl001_xxx.ini.fix=TRUE)
files |
a character, character vector, or index data frame specifying the SIDFEx forecast file(s) to be read. If a directory is provided, all files in that directory are read. Note that |
data.path |
|
ens.merge |
a logical value specifying whether or not to merge ensemble members from individual lists (corresponding to individual files) into merged lists with shared meta data. If |
checkfileformat |
a logical value specifying whether or not to check if the file format complies with the SIDFEx conventions, using |
verbose |
a logical value specifying whether to produce warnings in |
speed.fix |
a logical value specifying whether to limit the drift speed to certain bounds. Trajectory segments with unrealistically high speeds (as set by |
speed.fix.max |
a numerical value specifying the speed threshold used to 'fix' trajectory segments with unrealistically high speeds when |
timedupli.fix |
a logical value specifying whether to remove trajectory data entries with identical times. The respective first values are kept. Note that the consistency or inconsistency of the associated coordinates are not considered. Default is |
nrl001_xxx.ini.fix |
a logical value specifying whether to fix the InitYear and InitDayOfYear of some of the nrl001 MethodIDs where the true initial times correspond to the first time entry in the data table rather than the values in the file name and header. Default is |
ens.merge |
a logical value indicating whether ensembles have been merged or not (see corresponding argument). |
res.list |
a list with one element for each individual forecast or forecast ensemble that has been read. The following subelements are included: |
...$fl |
a character with the corresponding file path and name. A vector if |
...$checkfileformat.result |
a character, provided only if |
...$SubmitYear |
Year of submission of the forecast to the DKRZ cloud. Inherited from the ensemble parent if |
...$SubmitDayOfYear |
DayOfYear of submission of the forecast to the DKRZ cloud. Inherited from the ensemble parent if |
...$ProcessedYear |
Year of processing of the forecast on the DKRZ cloud. Inherited from the ensemble parent if |
...$ProcessedDayOfYear |
DayOfYear of processing of the forecast on the DKRZ cloud. Inherited from the ensemble parent if |
...$GroupID |
the Group ID. |
...$MethodID |
the Method ID. |
...$TargetID |
the Target ID. |
...$InitYear |
Year of the initialisation time. Inherited from the ensemble parent if |
...$InitDayOfYear |
DayOfYear of the initialisation time. Inherited from the ensemble parent if |
...$InitLat |
initial latitude. Inherited from the ensemble parent if |
...$InitLon |
initial longitude. Inherited from the ensemble parent if |
...$EnsMemNum |
the ensemble member number. A vector if |
...$Ntimesteps |
number of timesteps. Inherited from the ensemble parent if |
...$FirstYear |
Year of the first data point in |
...$FirstDayOfYear |
DayOfYear of the first data point in |
...$FirstLat |
latitude of the first data point in |
...$FirstLon |
lonitude of the first data point in |
...$LastYear |
Year of the last data point in |
...$LastDayOfYear |
DayOfYear of the last data point in |
...$LastLat |
latitude of the last data point in |
...$LastLon |
longitude of the last data point in |
...$DaysForecastLength |
the time difference between the last and initial time of the forecast in days. |
...$data |
a data frame holding the actual trajectory data with one point in each row and the following columns: |
...$MergedInitLat |
a vector, provided only if |
...$MergedInitLon |
a vector, provided only if |
index |
the index data frame corresponding to the data read. |
Helge Goessling
sidfex.download.fcst
, sidfex.write.fcst
, sidfex.checkfileformat
# Load the forecast data index
index = sidfex.load.index()
# Show the first rows of the index to see which variables can be used to subselect the index
head(index)
# Make an index subset for one specific forecast ensemble
subind = sidfex.fcst.search.extractFromTable(gid = "awi001" , tid = "300234063991680", iy = 2018, idoy = 30, return.dataframe = TRUE)
# Read the forecasts
fcst = sidfex.read.fcst(files=subind, ens.merge=FALSE)
# Now plot latitude against forecast lead time for the whole ensemble
plot(fcst$res.list[[1]]$data$DaysLeadTime,fcst$res.list[[1]]$data$Lat,type="l",ylim=c(74,80),xlim=c(0,600))
for (i in 2:length(fcst$res.list)) {lines(fcst$res.list[[i]]$data$DaysLeadTime,fcst$res.list[[i]]$data$Lat)}
# If you are surprised that the ensemble members have different length, that's because the climatological method applied to generate these forecasts discards trajectories when the sea-ice concentration in the corresponding years dropped below some threshold.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.