metaclipR.Aggregation: Directed metadata graph construction for Transformations of...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Build a directed metadata graph describing a Transformation on a climate4R grid that is a subset of Dataset.

Usage

1
2
metaclipR.Aggregation(package = "transformeR", version = "1.3.2", graph,
  fun = "aggregateGrid", arg.list = NULL)

Arguments

package

package

version

version

graph

A previous metaclipR data structure from which the current step follows

fun

function name. Unused (set to "aggregateGrid")

arg.list

Argument list. See details

Details

This function takes as reference the semantics defined in the Data Source and Transformation ontology defined in the Metaclip Framework (http://metaclip.predictia.es/).

Argument list

The following list of arguments is required to define an aggregation:

The different arguments are explained in the the help page of aggregateGrid

Value

A named list with the updated graph in element "graph" and the parent node name ("parentnodename"), needed for linking subsequent operations.

Author(s)

D. San Martín, J. Bedia

References

Climate4R page at University of Cantabria

See Also

Other transformation: metaclip.graph.Command, metaclipR.AnomalyCalculation, metaclipR.Climatology, metaclipR.Dataset, metaclipR.Ensemble, metaclipR.Regridding, metaclipR.etccdi

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
## Not run: 
require(transformeR)
require(igraph)
pkg <- "transformeR"
v <- "1.1.1"
# Assume a given hindcast DatasetSubset (we first simplify a)
data("CFS_Iberia_hus850")
DS <- subsetGrid(CFS_Iberia_hus850, members = 1:3, years = 1989:1991)
graph <- metaclipR.DatasetSubset(package = pkg,
                                 version = v,
                                 arg.list = list(members = 1:3,
                                                 years = 1989:1991),
                                 fun = "subsetGrid",
                                 output = "DS")
# An aggregation is performed on the example data. In this case, 
# The forecast is aggregated by members (ensemble mean), and in space
# (along longitude and latitude) to obtain a spatial mean. Original data is daily,
# and an annual aggregation is performed, considering the monthly means and the
# annual maxima:
fun <- "aggregateGrid"
arg.list <- list("aggr.mem" = list(FUN = "mean", na.rm = TRUE),
                 "aggr.d" = list(FUN = NULL),
                 "aggr.m" = list(FUN = "mean", na.rm = TRUE),
                 "aggr.y" = list(FUN = "max", na.rm = TRUE),
                 "aggr.lat" = list(FUN = "mean", na.rm = TRUE),
                 "aggr.lon" = list(FUN = "mean", na.rm = TRUE),
                 "weight.by.lat" = TRUE)
# The aggregation is undertaken with transformeR::subsetGrid:
arg.list[["grid"]] <- DS
out <- do.call(fun, arg.list)
# This is how metadata is encoded:
# 1.) We identify the origin node from which the first transformation hangs:
graph$parentnodename
# 2.) metaclipR.Aggregation is called:
graph <- metaclipR.Aggregation(package = pkg,
                               version = v,
                               graph = graph,
                               fun = fun,
                               arg.list = arg.list)
# And this is the metadata description stored in the igraph-class object:
plot(graph$graph)

## End(Not run)

Predictia/metaclipR documentation built on May 14, 2019, 6:07 a.m.