419 | | = loadData = |
420 | | |
421 | | Once the NcML dataset is created and we get an idea of the nature of the variables stored, the `loadData` function is used to retrieve the variables desired at selected dimensional slices. In this particular example, we will load the temperature data from the NCEP reanalysis in the Iberian Peninsula. |
| 412 | = loadGCM |
| 413 | |
| 414 | Once the NcML dataset is created and we get an idea of the nature of the variables stored, the `loadGCM` function is used to retrieve the variables desired at selected dimensional slices. Although the name of the function may result somewhat misleading, the function is intended for loading many kinds of gridded datasets, and not only GCM data, including reanalysis, RCM data and observational gridded datasets, for instance. In this particular example, we will load the temperature data from the NCEP reanalysis in the Iberian Peninsula, provided in the example datasets of the meteoR package. |
454 | | As we can see, the variable T has vertical levels. In this case, the only level available is at 850 mb. The variable is daily, as we can see in the `TimeStep` element of the list, and the original units are Kelvin. |
455 | | |
456 | | There are several options for spatial selection using the `loadData` function. For instance, if we want the whole domain of the dataset, there is no need for specifying the `lonLim` and `latLim` arguments. In the next example, we will load T850 for the whole Iberian Peninsula for the period 1990-1999. |
457 | | |
458 | | {{{ |
459 | | > t850 <- loadData(dataset="Iberia_NCEP_dataset.ncml", var="T", level=850, startDate = "1990-01-01", endDate = "1999-12-31") |
460 | | > str(t850) |
| 447 | As we can see, the variable T has vertical levels. In this case, the only level available is at 850 mb. The variable is daily, as we can see in the `TimeStep` element of the list, and the original units are Kelvin. |
| 448 | |
| 449 | There are several options for spatial selection using the `loadGCM` function, as in the case of `loadSeasonalForecast`. For instance, if we want the whole domain of the dataset, there is no need for specifying the `lonLim` and `latLim` arguments. Alternatively, it is possible to select smaller rectangular domains or single points. In the next example, we will load T850 for January in a similar domain than previously with the SYstem4 dataset, centered on the Iberian Peninsula, encompassing the period 1990-1999. |
| 450 | |
| 451 | |
| 452 | {{{ |
| 453 | > t850.ncep.iberia <- loadGCM(dataset = "./datasets/reanalysis/Iberia_NCEP/Iberia_NCEP.ncml", standard.vars=TRUE, |
| 454 | + var="ta", lonLim = c(-10,5), latLim = c(35,45), level=850, season=1, years=1990:1999) |
| 455 | > str(t850.ncep.iberia) |
469 | | $ Data : num [1:3652, 1:54] 278 276 276 278 279 ... |
470 | | |
471 | | }}} |
472 | | |
473 | | |
474 | | The matrix in the `Data` element of the returned list contains a matrix with 54 columns, one for each grid point of the dataset, and 3652 rows, corresponding to the daily time series. |
475 | | |
476 | | = Using standard variables via vocabulary and dictionary = |
477 | | |
478 | | |
479 | | |
| 466 | $ Data : num [1:310, 1:35] 5.95 5.55 0.35 2.05 5.35 ... |
| 467 | |
| 468 | }}} |
| 469 | |
| 470 | Note that in this particular case, we are loading standard variables, as defined in the vocabulary (by setting the argument `standard.vars = TRUE`), but we did not specify a path to the dictionary (default to `NULL`). By default, the function searches the dictionary in the same directory where the ''ncml'' file has been created, assuming that this is a file with extension ''.dic'' and the same name as the ''ncml''. |