Parse the parameter name and decide on level, accumulation...
Source:R/parse_harp_parameter.R
parse_harp_parameter.Rd
Parses a harp-style parameter name and returns accumulation time, level (if any) and the base name of the parameter
Usage
parse_harp_parameter(
param,
vertical_coordinate = c(NA_character_, "pressure", "model", "height", "isotherm",
"unknown")
)
Arguments
- param
Parameter name - available names can be found from show_param_defs.
- vertical_coordinate
If the parameter is for the upper air, the vertical coordinate system must be given. Can be "pressure" for pressure levels, "model" for model levels or "height" for altitude levels.
Examples
parse_harp_parameter("AccPcp1h")
#> $fullname
#> [1] "AccPcp1h"
#>
#> $basename
#> [1] "Pcp"
#>
#> $level
#> [1] -999
#>
#> $level_type
#> [1] "unknown"
#>
#> $accum
#> [1] 3600
#>
#> $acc_unit
#> [1] "h"
#>
#> attr(,"class")
#> [1] "harp_parameter"
parse_harp_parameter("z500")
#> $fullname
#> [1] "z500"
#>
#> $basename
#> [1] "z"
#>
#> $level
#> [1] 500
#>
#> $level_type
#> [1] "pressure"
#>
#> $accum
#> [1] 0
#>
#> $acc_unit
#> NULL
#>
#> attr(,"class")
#> [1] "harp_parameter"
parse_harp_parameter("s100m")
#> $fullname
#> [1] "s100m"
#>
#> $basename
#> [1] "s"
#>
#> $level
#> [1] 100
#>
#> $level_type
#> [1] "height"
#>
#> $accum
#> [1] 0
#>
#> $acc_unit
#> NULL
#>
#> attr(,"class")
#> [1] "harp_parameter"
parse_harp_parameter("T", vertical_coordinate = "pressure")
#> $fullname
#> [1] "T"
#>
#> $basename
#> [1] "T"
#>
#> $level
#> [1] -999
#>
#> $level_type
#> [1] "pressure"
#>
#> $accum
#> [1] 0
#>
#> $acc_unit
#> NULL
#>
#> attr(,"class")
#> [1] "harp_parameter"
parse_harp_parameter("S", vertical_coordinate = "model")
#> $fullname
#> [1] "S"
#>
#> $basename
#> [1] "S"
#>
#> $level
#> [1] -999
#>
#> $level_type
#> [1] "model"
#>
#> $accum
#> [1] 0
#>
#> $acc_unit
#> NULL
#>
#> attr(,"class")
#> [1] "harp_parameter"
parse_harp_parameter("RH", vertical_coordinate = "height")
#> $fullname
#> [1] "RH"
#>
#> $basename
#> [1] "RH"
#>
#> $level
#> [1] -999
#>
#> $level_type
#> [1] "height"
#>
#> $accum
#> [1] 0
#>
#> $acc_unit
#> NULL
#>
#> attr(,"class")
#> [1] "harp_parameter"