verify_spatial: Run spatial verification on a (for now) deterministic...

View source: R/verify_spatial.R

verify_spatialR Documentation

Run spatial verification on a (for now) deterministic forecast

Description

Run spatial verification on a (for now) deterministic forecast

Usage

verify_spatial(start_date, end_date, det_model, parameter,
  lead_time = seq(0, 36, 3), lt_unit = "h", by = "6h",
  fc_file_path = "", fc_file_template = "", fc_file_format = "fatar",
  fc_options = list(), fc_interp_method = "closest",
  fc_accumulation = NULL, ob_file_path = "", ob_file_template = "",
  ob_file_format = "hdf5", ob_options = list(),
  ob_interp_method = "closest", ob_accumulation = "15m",
  verif_domain = NULL, use_mask = FALSE, box_sizes = c(1, 3, 5, 11,
  21), thresholds = c(0.1, 1, 5, 10), sqlite_path = NULL,
  sqlite_file = "harp_spatial_scores.sqlite", return_data = TRUE, ...)

Arguments

start_date

Date of the first forecast to read.

end_date

Date of the last forecast to read.

det_model

The name of the deterministic model. Maybe expressed as a vector if more than one model is wanted.

parameter

The parameters to read as a character vector.

lead_time

The lead times to read as a numeric vector.

by

The time between forecasts. Should be a string of a number followed by a letter, where the letter gives the units - may be d for days, h for hours or m for minutes.

fc_file_path

The top level path for the forecast files to read.

fc_file_template

The file type to generate the template for. Can be "harmoneps_grib", "harmeoneps_grib_fp", "harmoneps_grib_sfx", "meps_met", "harmonie_grib", "harmonie_grib_fp", "harmone_grib_sfx", "vfld", "vobs", or "fctable". If anything else is passed, it is returned unmodified. In this case substitutions can be used. Available substitutions are YYYY for year, {MM} for 2 digit month with leading zero, {M} for month with no leading zero, and similarly {DD} or {D} for day, {HH} or {H} for hour, {mm} or {m} for minute. Also {LDTx} for lead time and {MBRx} for ensemble member where x is the length of the string including leading zeros - can be omitted or 2, 3 or 4. Note that the full path to the file will always be file_path/template.

fc_file_format

The format of the files to read. Can be e.g. "fa" or "grib".

fc_options

A list with format-specific options for the reader function.

fc_interp_method

Interpolation method to be used when transforming a forecast field to the verification grid.

fc_accumulation

The accumulation type of the forecast. This is only used for accumulated parameters (e.g. precipitation). NULL signifies that the field is accumulated from the start of the model run. Otherwise this should be a string containing a numerical value and a time unit, e.g. "15m" or "1h".

ob_file_path

The top level path for the forecast files to read.

ob_file_template

The file type to generate the template for. Can be "harmoneps_grib", "harmeoneps_grib_fp", "harmoneps_grib_sfx", "meps_met", "harmonie_grib", "harmonie_grib_fp", "harmone_grib_sfx", "vfld", "vobs", or "fctable". If anything else is passed, it is returned unmodified. In this case substitutions can be used. Available substitutions are YYYY for year, {MM} for 2 digit month with leading zero, {M} for month with no leading zero, and similarly {DD} or {D} for day, {HH} or {H} for hour, {mm} or {m} for minute. Also {LDTx} for lead time and {MBRx} for ensemble member where x is the length of the string including leading zeros - can be omitted or 2, 3 or 4. Note that the full path to the file will always be file_path/template.

ob_file_format

The format of the files to read. Can be e.g. "hdf5" or "grib".

ob_options

A list with format-specific options for the reader function.

ob_interp_method

Interpolation method to be used when transforming a forecast field to the verification grid.

ob_accumulation

The accumulation type of the observation (or reference). This is only used for accumulated parameters (e.g. precipitation). NULL signifies that the field is accumulated from the start of the model run. That is probably rare for observations. Otherwise this should be a string containing a numerical value and a time unit, e.g. "15m" or "1h".

verif_domain

A geodomain that defines the common verification grid.

box_sizes

Scales used for fuzzy methods like FSS. A vector of box sizes. All values must be odd integers (so the central point is really in the center of a box).

thresholds

Thresholds used for FSS, ...

sqlite_path

If specified, SQLite files are generated and written to this directory.

sqlite_file

Name of SQLite file.

return_data

= TRUE,

...

Arguments dependent on file_format, passed to to read_grid_interpolate. (More info to be added).

Value

A list containting two data frames: spatial_scores and spatial_threshold_scores.


adeckmyn/harpSpatial documentation built on June 30, 2023, 5:23 a.m.