WikiPrint - from Polar Technologies

makeNcmlDataset

Description

Generates a NcML file from a collection of netCDF files.

Usage

makeNcmlDataset(source.dir, ncml.file) 

Arguments

The output is a NcML file named as file.name which will be stored in the output.dir.

Details

Value

Creates a NcML file at the specified location

Notes

A NcML file is a ?XML representation of netCDF metadata. This is approximately the same information one gets when dumping the header of a netCDF file (e.g. by typing on the terminal the command ncdump -h). By means of NcML it is possible to create virtual datasets by modifying and aggregating other datasets, thus providing maximum flexibility and ease of access to data stored in collections of files containing data from different variables/time slices. The function makeNcmlDataset is intended to deal with reanalysis, forecasts and other climate data products, often consisting of collections of netCDF files corresponding to different variables and partitioned by years/decades or other time slices. It operates by applying to types of ?aggregation operations:

  1. Union: Performs the union of all the dimensions, attributes, and variables in multiple NetCDF files
  2. JoinExisting: Variables of the same name (in different files) are connected along their existing, outer dimension, called the aggregation dimension. In this case the aggregation dimension is time.

dataInventory

Description

Provides summary information about the main characteristics of a NcML dataset.

Usage

dataInventory(ncml.file)

Arguments

Value

The output of the function consists of a list of variable length, depending on the number of variables contained in the dataset, following this structure:

Details

A common need prior to data analysis is to get an overview of all data available and their structure (variables, dimensions, units, geographical extent, time span ...). Note that the function provides an overview of the raw data as they are stored in the original data files. The units may change after loading the function if conversions are applied via dictionary.

loadObservations

Description

Loads observational station data from standard station datasets stored in .csv files.

Usage

loadObservations(source.dir, var, standard.vars=TRUE, stationID, startDate=NULL, endDate=NULL, season=NULL)

Arguments

Details

This function works with standard .csv observational datasets. It allows loading data from one or several stations at a time. The dictionary is the table that translates the variable as stored in the dataset to the standard variables defined in the vocabulary. More details ?here

In the case of boreal winter selection (season=c(12,1,2)) the function will tie strictly to the time interval defined by the startDateand endDate arguments, and therefore will not retrieve data from the previous December, nor from the next January and February before/after the start/end years defined (this has a different behaviour than loadSystem4, which is more specifically oriented to seasonal forecast data.)

Value

A list with the containing the following elements:

loadData

Description

Loads selected dimensional slices of a NcML dataset. The function is intended to deal with gridded data (interpolated surfaces, reanalysis, RCMs/GCMs ...)

Usage

loadData(dataset, var, standard.vars=FALSE, lonLim=NULL, latLim=NULL, level=NULL, startDate=NULL, endDate=NULL, season=NULL)

Arguments

Details

The function can select the whole spatial domain covered by the dataset, spatial windows defined by the minimum and maximum corner coordinates, and single grid-cell values. In the last two cases, the function operates by finding the closest grid-points to the coordinates introduced.

For variables with different vertical levels, only defined level values will be allowed, otherwise getting an error. The function does not look for the closest level to the value introduced, in order to avoid confusions. The function dataInventory is useful for finding the valid level values defined for a particular variable.

In the case of time slice selection in sub-daily datasets, the function will retrieve all records belonging to the days indicated. For instance, if endDate=2000-12-31 and the dataset has a time resolution of 6h, the last date returned will be "2000-12-31 18:00:00".

In the case of boreal winter selection (season=c(12,1,2)) the function will tie strictly to the time interval defined by the startDateand endDate arguments, and therefore will not retrieve data from the previous December, nor from the next January and February before/after the start/end years defined (this has a different behaviour than loadSystem4, which is more specifically oriented to seasonal forecast data.)

Value

A list with the following components:

loadSystem4

Description

Loads hindcast/forecast data from ECMWF's System4 model by remotely accessing the SPECS-EUPORIAS THREDDS Data Server.

Usage

loadSystem4(dataset, var, members, lonLim, latLim, season, years, leadMonth)

Arguments

Details

Currently, accepted values for the argument var are tas, tasmin, tasmax, pr or mslp, as internally defined in the vocabulary of System4 following the nomenclature displayed in the table below. However, note that new variables and datasets will be progressively included. Further details regarding the nature and temporal aggregation of these variables can be obtained through the dataInventory function.

Short NameLong nameUnitsInstantaneous
tasmaxMaximum temperature at 2 metresdegCNo
tasminMinimum temperature at 2 metresdegCNo
tasMean temperature at 2 metresdegCYes
prTotal precipitation accumulatedmmNo
mslpMean sea level pressurePaYes

Value

The output returned by the function consists of a list with the following elements providing the necessary information for data representation and analysis:

Note

A worked example describing a multi-model selection of a dataset is presented in the tutorial, which can be downloaded ?here, or in the section Examples?.