Skip to contents

functions to evaluate the spatial performance using satellite

Usage

sat(
  mo,
  ob,
  rname,
  table = NULL,
  n = 6,
  min = NA,
  max = NA,
  method = "bilinear",
  eval_function = stat,
  verbose = T,
  ...
)

Arguments

mo

SpatRaster or raster with model

ob

SpatRaster or raster with observations

rname

passed to stat

table

data.frame to append the results

n

number of points from the boundary removed, default is 5

min

minimum value cutoff

max

maximum value cutoff

method

passed to terra::resample

eval_function

evaluation function (default is stat)

verbose

set TRUE to display additional information

...

other arguments passed to stat

Value

a data.frame

Note

If a YOU DIED error message appears, means you are removing all the valid values using the arguments min or max.

If cate() is used for eval_function, the argument threshold must be included (see example).

Examples

model_o3 <- terra::rast(paste0(system.file("extdata",package="eva3dm"),
                              "/camx_no2.Rds"))
omi_o3   <- terra::rast(paste0(system.file("extdata",package="eva3dm"),
                              "/omi_no2.Rds"))

# generate the statistical indexes
sat(mo = model_o3,ob = omi_o3,rname = 'NO2_statistical')
#> removing 6 points for the model (y) boundaryes ...
#> interpolating obs. (x) to model grid (y)...
#>                     n      Obs      Sim         r       IOA       FA2    RMSE
#> NO2_statistical 11664 3.334283 4.267475 0.4689121 0.3358893 0.6685528 4.98183
#>                        MB       ME  NMB (%)  NME (%)
#> NO2_statistical 0.9331919 2.165081 27.98778 64.93393

# generate categorical evaluation using 3.0 as threshold
sat(mo = model_o3,ob = omi_o3,rname = 'NO2_categorical',
    eval_function = cate, threshold = 3.0)
#> removing 6 points for the model (y) boundaryes ...
#> interpolating obs. (x) to model grid (y)...
#>                     n      Obs      Sim thr        A      CSI      POD        B
#> NO2_categorical 11664 3.334283 4.267475   3 83.04184 69.81074 85.49533 107.9626
#>                      FAR      HSS      PSS
#> NO2_categorical 20.81025 66.05674 66.45827