harp includes a number of built in parameters, but you may wish to read other parameters. To do this you need to create a harp parameter.
Usage
as_harp_parameter(
fullname,
basename,
level = 0,
level_type = c("unknown", "height", "msl", "surf", "pressure", "model"),
accum = 0,
accum_unit = NULL
)
Arguments
- fullname
The full name of the parameter
- basename
The basename of the parameter. This is typically the fullname excluding accumulation time and vertical level infotmation from the parameter name and forms the basis of the parameter name that is searched for in files. For example, for reading parameters from grib files the basename should be exactly the same as the grib shortName.
- level
The vertical level of the parameter. For grib files, this is ignored if the basename begins with a number, or mx or mn followed by a number.
- level_type
The type of vertical level. Can be one of "unknown", "height", "msl", "surf", "pressure", or "model".
- accum
The accumulation time in seconds
- accum_unit
The unit of accumulation to be used when searching files.
Examples
# maximum 2m temperature in last 6 hours
as_harp_parameter("mx2t6")
#> $fullname
#> [1] "mx2t6"
#>
#> $basename
#> [1] "mx2t6"
#>
#> $level
#> [1] 0
#>
#> $level_type
#> [1] "unknown"
#>
#> $accum
#> [1] 0
#>
#> $acc_unit
#> NULL
#>
#> attr(,"class")
#> [1] "harp_parameter"
# potential vorticity at 500 hPa
as_harp_parameter("pv500", "pv", level = 500, level_type = "pressure")
#> $fullname
#> [1] "pv500"
#>
#> $basename
#> [1] "pv"
#>
#> $level
#> [1] 500
#>
#> $level_type
#> [1] "pressure"
#>
#> $accum
#> [1] 0
#>
#> $acc_unit
#> NULL
#>
#> attr(,"class")
#> [1] "harp_parameter"