JGCRI / rfasst

Estimation of a consistent range of adverse health and agricultural effects attributable to air pollution for a GCAM scenario
https://jgcri.github.io/rfasst/
BSD 2-Clause "Simplified" License
10 stars 5 forks source link

Name of the GCAM scenario #69

Closed nanhung closed 2 years ago

nanhung commented 2 years ago

The name of the GCAM scenario scen_name can not arbitrary define in m1_emissions_rescale() . Here is my code ,

data.wd <- system.file("extdata", package="rfasst")

db_path <- data.wd
query_path <- data.wd
db_name <- "database_basexdb_5p3_release"
prj_name <- "testJOSS.dat" 
#scen_name<-"Reference_gcam5p3_release" 
scen_name<-"Ref_gcam5p3_release"  # cannot use the arbitrary name? 
queries<-"queries_rfasst.xml" 

I got the error output as,

Screenshot from 2021-11-09 15-00-04

The error might come from rgcam package at this line

prj <- rgcam::addScenario(conn, prj_name, scen_name, paste0(query_path, "/", queries), clobber = F)
jonsampedro commented 2 years ago

@nanhung the scenario name cannot be arbitrary, it has to be one of the scenarios of the database you are connecting with. This is associated with the structure of the rgcam package, in which you create the connection with your scenario in two steps:

conn <- localDBConn('/path/to/dbs', 'my-gcamdb_basexdb') When you run this, the console reports the scenarios on the DB you are connecting with.

prj <- addScenario(conn, 'my-project-name.dat', 'my-scenario-name', 'my-batch-queries.xml') In this step, you add the scenario you want to the project.

I will clarfity this issue on the dicumentation vignettes.

nanhung commented 2 years ago

Thanks! It will be easy for the user if they do not need to assign the my-scenario-name since it has a certain naming rule to follow.

jonsampedro commented 2 years ago

Thanks @nanhung ! Just to clarify, each GCAM simulation has an associated name that will be user defined (no naming rule), so that's why rgcam is structured like that.