Skip to content

Commit

Permalink
Some configuration files for new case studies
Browse files Browse the repository at this point in the history
A specific cofig_atos.R for Austria_2022 to correct for units mismatches when doing the interpolations.
  • Loading branch information
Samuel Viana-Jimenez committed Jun 2, 2023
1 parent 15d4bd2 commit dabf911
Show file tree
Hide file tree
Showing 40 changed files with 415 additions and 1,654 deletions.
Empty file modified R/point_pre_processing/interpol2sql.R
100644 → 100755
Empty file.
Empty file modified R/point_pre_processing/vfld2sql.R
100644 → 100755
Empty file.
Empty file modified R/point_pre_processing/vobs2sql.R
100644 → 100755
Empty file.
Empty file modified R/point_verif/create_scorecards.R
100644 → 100755
Empty file.
Empty file modified R/point_verif/fn_scorecard.R
100644 → 100755
Empty file.
Empty file modified R/point_verif/point_verif.R
100644 → 100755
Empty file.
Empty file modified R/point_verif/point_verif_local.R
100644 → 100755
Empty file.
Empty file modified R/visualization/fn_plot_aux_scores.R
100644 → 100755
Empty file.
Empty file modified R/visualization/fn_plot_helpers.R
100644 → 100755
Empty file.
Empty file modified R/visualization/fn_plot_point_verif.R
100644 → 100755
Empty file.
Empty file modified R/visualization/plot_from_rds.R
100644 → 100755
Empty file.
Empty file modified R/visualization/shiny_launch_dynamic.R
100644 → 100755
Empty file.
Empty file modified R/visualization/shiny_launch_static.R
100644 → 100755
Empty file.
8 changes: 4 additions & 4 deletions R/visualization/update_shinyappsio.R
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ library(here)
library(rsconnect)

#deployApp(appDir='/perm/sp3c/deode_verif/plot_point_verif_local1/', appName="plot_point_verif_local1",appTitle="DE_330 point verification static 1")
#deployApp(appDir='/perm/sp3c/deode_verif/plot_point_verif/', appName="plot_point_verif",appTitle="DE_330 point verification dynamic")
#deployApp(appDir='/perm/sp3c/deode_verif/plot_point_verif_local3/', appName="plot_point_verif_local3",appTitle="DE_330 point verification static 3")
deployApp(appDir='/perm/sp3c/deode_verif/plot_point_verif_local2/', appName="plot_point_verif_local2",appTitle="DE_330 point verification static 2")
deployApp(appDir='/perm/sp3c/deode_verif/plot_point_verif_local4/', appName="plot_point_verif_local4",appTitle="DE_330 point verification static 4")
deployApp(appDir='/perm/sp3c/deode_verif/plot_point_verif/', appName="plot_point_verif",appTitle="DE_330 point verification dynamic")
deployApp(appDir='/perm/sp3c/deode_verif/plot_point_verif_local3/', appName="plot_point_verif_local3",appTitle="DE_330 point verification static 3")
#deployApp(appDir='/perm/sp3c/deode_verif/plot_point_verif_local2/', appName="plot_point_verif_local2",appTitle="DE_330 point verification static 2")
#deployApp(appDir='/perm/sp3c/deode_verif/plot_point_verif_local4/', appName="plot_point_verif_local4",appTitle="DE_330 point verification static 4")



Expand Down
124 changes: 124 additions & 0 deletions config/config_atos.R_austria_2022
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# Setting up the parameters and their scaling and thresholds here
# Adding this part not so easy using the yml file
# It is possible to create several nested sections like
# variable:
# - name
# - threshold
# etc
# but this make look a bit confusing. Hardcoding this part here


# List of parameters
# Add more parameters below using the same format. For upper air parameters,
# don't forget the vc = "pressure"

library(yaml)

conf_get_config <- function(){
CONFIG <- yaml.load_file(Sys.getenv('CONFIG_YAML') )
CONFIG$params_details = conf_get_params_details()
CONFIG
}


conf_get_params_details <- function(){
T2m_thr <- c(-20, -10, seq(-5, 30, 5))
Tmax_thr <- c(seq(0, 40, 5))
Tmin_thr <- c(seq(-15, 25, 5))
S10m_thr <- c(seq(0, 25, 5))
RH2m_thr <- c(seq(0, 100, 20))
Cbase_thr <- c(seq(0, 2000, 200))
Pcp_thr <- c(0,1,5,10,15,20,30,40,60,80, seq(100, 100, 500))
vis_thr <- c(seq(0, 2000, 200))
Pmsl_thr <- c(seq(920, 1040, 20))
Q_thr <- c(seq(0, 0.15, 0.015))
SD_thr <- c(0,1,3,6,10, seq(20, 80, 20))
params <- list(
T2m = list(
thresholds = T2m_thr,
scale_fcst = list(scale_factor = -273.15, new_units = "degC"),
scale_obs = list(scale_factor = -273.15, new_units = "degC")
),
Td2m = list(
thresholds = T2m_thr,
scale_fcst = list(scale_factor = 0, new_units = "degC"),
scale_obs = list(scale_factor = -273.15, new_units = "degC")
),
Tmax = list(
thresholds = Tmax_thr,
scale_fcst = list(scale_factor = 0, new_units = "degC"),
scale_obs = list(scale_factor = -273.15, new_units = "degC")
),
Tmin = list(
thresholds = Tmin_thr,
scale_fcst = list(scale_factor = 0, new_units = "degC"),
scale_obs = list(scale_factor = -273.15, new_units = "degC")
),
S10m = list(
thresholds = S10m_thr
),
Gmax = list(
thresholds = S10m_thr
),
RH2m = list (
scale_fcst = list(scale_factor = 100, new_units = "percent"),
thresholds = RH2m_thr
),
Q2m = list (
scale_fcst = list(scale_factor = 0, new_units = "kg/kg"),
thresholds = Q_thr
),
CClow = list (
scale_fcst = list(scale_factor = 8, new_units = "oktas"),
thresholds = RH2m_thr
),
CCtot = list (
scale_fcst = list(scale_factor = 8, new_units = "oktas"),
thresholds = RH2m_thr
),
Cbase = list (
scale_fcst = list(scale_factor = 8, new_units = "oktas"),
thresholds = Cbase_thr
),
Ps = list (
thresholds = Pmsl_thr
),
Pmsl = list (
thresholds = Pmsl_thr
),
vis = list (
thresholds = vis_thr
),
DSN = list (
thresholds = SD_thr
),
T = list(
scale_fcst = list(scale_factor = -273.15, new_units = "degC"),
scale_obs = list(scale_factor = -273.15, new_units = "degC"),
vc = "pressure"
),
Pcp = list (
thresholds = Pcp_thr
),
AccPcp1h = list (
thresholds = Pcp_thr
),
AccPcp3h = list (
thresholds = Pcp_thr
),
AccPcp6h = list (
thresholds = Pcp_thr
),
AccPcp12h = list (
thresholds = Pcp_thr
),
AccPcp24h = list (
thresholds = Pcp_thr
)
)

params

}


16 changes: 0 additions & 16 deletions config/config_atos.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#/bin/bash


## load modules
module load R/4.0.4

Expand All @@ -9,16 +8,6 @@ CONFIG_INITIAL=config_atos
#R Env
USING_RENV=${USING_RENV-no}


# What to run
RUN_POINT_VERF=${RUN_VERF-yes}
RUN_POINT_VERF_LOCAL=${RUN_POINT_VERF_LOCAL-yes}

SCORECARDS=${SCORECARDS-yes}
RUN_VOBS2SQL=${RUN_VOBS2SQL-yes}
RUN_VFLD2SQL=${RUN_VFLD2SQL-yes}


## DNOT for USER
MAIN_DIR=$(pwd)
CONFIG_DIR=$MAIN_DIR/config
Expand All @@ -27,11 +16,6 @@ CONFIG_YAML=$CONFIG_DIR/$CONFIG_INITIAL.yml_${CASE_STUDY}
CONFIG_R=$CONFIG_DIR/$CONFIG_INITIAL.R

##
#export INI_DATE END_DATE
export MAIN_DIR CONFIG_INITIAL
export USING_RENV
export RUN_POINT_VERF RUN_VOBS2SQL RUN_VFLD2SQL
export SCORECARDS


export CONFIG_DIR RS_DIR CONFIG_YAML CONFIG_R
92 changes: 92 additions & 0 deletions config/config_atos.yml_Aude_2018
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#Section to define paths for the pre-processing
# This section will be used by the scripts under pre_processing
shared:
start_date: 2018101400
end_date: 2018101500

pre:
fclen: 24
vfld_path: "/ec/res4/scratch/sp3c/deode_verif/cases/Aude_2018/vflds/"
vobs_path: "/ec/res4/scratch/sp3c/deode_verif/cases/Aude_2018/vobs/"
by_vobs_step: "1h"
vfld_template: #include one for each model if they are different.
- "vfld"
do_all: TRUE # if true, it will ignore list of parameters and do all that is available in the vfld files
model_output_path: "/ec/res4/scratch/sp3c/deode_verif/grbs/Aude_2018/"
fcst_templates: # Write template names of grib/fa files if forecast data needs to be interpolated to stations
- "{fcst_model}/{YYYY}/{MM}/{DD}/{HH}/historic.arome.aude_500-500m000+0{LDT3}_00.grib"
# clim_file: "/ec/res4/scratch/sp3c/deode_verif/grbs/austria_2022/ref_cy43/ICMSHAROM+0000"
# clim_param: "SPECSURFGEOPOTEN"
interp_method: "nearest"
params:
- Pcp
- AccPcp1h
- AccPcp3h
- AccPcp6h
- AccPcp12h
- AccPcp24h
- S10m
- T2m
- RH2m
- Pmsl
- T
- Cbase
- CChigh
- CClow
- CCmed
- CCtot
- D10m
- G10m
- Gmax
- Ps
- Smax
- Td2m
- Tmax
- Tmin
- vis
- DSN
- SD
- Q2m

#Section to define paths for the verification
# This section will be used by the scripts under verification
verif:
by_step: "6h"
fcst_model:
- ref500m
lead_time: seq(0,4,1)
fcst_type: "det" #det or eps
grps: "leadtime"
fcst_path: "/perm/sp3c/deode_verif/cases/Aude_2018/FCTABLE"
obs_path: "/perm/sp3c/deode_verif/cases/Aude_2018/OBSTABLE"
verif_path: "/perm/sp3c/deode_verif/cases/Aude_2018/output/verif_results"
#Section to define the paths for the output
# This section will be used by the plotting scripts
post:
plot_output: "/perm/sp3c/deode_verif/cases/Aude_2018/output"
rds_path: "/perm/sp3c/deode_verif/cases/Aude_2018/verif_rds"
#This section if only for the scorecards
scorecards:
ref_model: ref500m
fcst_model: ref500m
params:
- T2m
- S10m
- RH2m
- Pmsl
- AccPcp12h
- AccPcp6h
- AccPcp3h
- AccPcp1h
- Pcp
- Cbase
- CClow
- CCtot
- D10m
- Gmax
- AccPcp1h
- Ps
- Td2m
- Tmax
- Tmin
- vis
88 changes: 88 additions & 0 deletions config/config_atos.yml_CY46_tests_winter
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#Section to define paths for the pre-processing
# This section will be used by the scripts under pre_processing
shared:
start_date: 2022011500
end_date: 2022012500

pre:
fclen: 24
vfld_path: "/ec/res4/scratch/sp3c/deode_verif/cases/CY46_tests/vfld/"
vobs_path: "/ec/res4/scratch/sp3c/deode_verif/cases/CY46_tests/vobs/"
by_vobs_step: "1h"
vfld_template: #include one for each model if they are different.
- "vfld"
do_all: TRUE # if true, it will ignore list of parameters and do all that is available in the vfld files
params:
- Pcp
- AccPcp1h
- AccPcp3h
- AccPcp6h
- AccPcp12h
- AccPcp24h
- S10m
- T2m
- RH2m
- Pmsl
- T
- Cbase
- CChigh
- CClow
- CCmed
- CCtot
- D10m
- G10m
- Gmax
- Ps
- Smax
- Td2m
- Tmax
- Tmin
- vis
- DSN
- SD
- Q2m
#Section to define paths for the verification
# This section will be used by the scripts under verification
verif:
by_step: "6h"
fcst_model:
- cy46h1_AIB_os
- cy46h1_AIB_ns
- cy46h_AEMETmbr000
- cy46h_AEMETmbr002
lead_time: seq(0, 24, 1)
fcst_type: "det" #det or eps
grps: "leadtime"
fcst_path: "/perm/sp3c/deode_verif/cases/CY46_tests/FCTABLE"
obs_path: "/perm/sp3c/deode_verif/cases/CY46_tests/OBSTABLE"
verif_path: "/perm/sp3c/deode_verif/cases/CY46_tests//output/verif_results"
#Section to define the paths for the output
# This section will be used by the plotting scripts
post:
plot_output: "/perm/sp3c/deode_verif/cases/CY46_tests/output"
rds_path: "/perm/sp3c/deode_verif/cases/CY46_tests/verif_rds"
#This section if only for the scorecards
scorecards:
ref_model: cy46h1_AIB_os
fcst_model: cy46h_AIB_ns
params:
- T2m
- S10m
- RH2m
- Pmsl
- AccPcp12h
- AccPcp6h
- AccPcp3h
- AccPcp1h
- Pcp
- Cbase
- CClow
- CCtot
- D10m
- Gmax
- AccPcp1h
- Ps
- Td2m
- Tmax
- Tmin
- vis
Loading

0 comments on commit dabf911

Please sign in to comment.