From 80de8be1b925933a92ed1e1edec7ed60c1b00435 Mon Sep 17 00:00:00 2001 From: Jake Smith <jws52@cam.ac.uk> Date: Mon, 17 May 2021 17:10:47 +0100 Subject: [PATCH] feat: Generate template advisories The newly imported AdvisoryBuilder can be run separately, see that project for more details. Updated conda environment accordingly. --- Processor.py | 3 +- ProcessorComponents.py | 48 ++++++++++++++++++++---- configs/config_Ethiopia_an_ewsdev.json | 2 +- configs/config_Ethiopia_an_live.json | 2 +- configs/config_Ethiopia_fc_ewsdev.json | 36 +++++++++++++++++- configs/config_Ethiopia_fc_live.json | 36 +++++++++++++++++- configs/config_SouthAsia_an_ewsdev.json | 2 +- configs/config_SouthAsia_an_live.json | 2 +- configs/config_SouthAsia_big_ewsdev.json | 40 +++++++++++++++++++- configs/config_SouthAsia_big_live.json | 40 +++++++++++++++++++- configs/config_SouthAsia_fc_ewsdev.json | 40 +++++++++++++++++++- configs/config_SouthAsia_fc_live.json | 40 +++++++++++++++++++- run_Processor.sh | 3 +- 13 files changed, 274 insertions(+), 20 deletions(-) diff --git a/Processor.py b/Processor.py index a8d5d22..af2cacd 100755 --- a/Processor.py +++ b/Processor.py @@ -199,6 +199,7 @@ def move_default_logfile_handler(dstPathName,srcPathName=log_path_default,FileHa return def parse_and_check_args(todayString): + # define the command line arguments my_parser = argparse.ArgumentParser(description='Command-line arguments for coordinator script of env suitability model') @@ -209,7 +210,7 @@ def parse_and_check_args(todayString): my_parser.add_argument( '-p', '--component', type = str, - choices = ['Environment','Deposition','Epidemiology','Survey'], + choices = list(ProcessorComponents.short_name.keys()), required = True, dest = 'component', help = '''Name of EWS component to process, which must be present diff --git a/ProcessorComponents.py b/ProcessorComponents.py index 4984223..180854c 100644 --- a/ProcessorComponents.py +++ b/ProcessorComponents.py @@ -25,6 +25,7 @@ from rasterio import open as rio_open # gitlab projects # TODO: Package these projects so they are robust for importing +from AdvisoryBuilder import DataGatherer # created by jws52 from EpiModel import EpiModel, EpiPrep, EpiAnalysis, plotRaster # created by rs481 # submodules of this project @@ -41,10 +42,12 @@ script_path = os.path.dirname(__file__)+'/' coordinator_path = script_path short_name = { - 'Environment' : 'ENVIRONMENT_2.0', + 'Advisory' : 'SUMMARY', 'Deposition' : 'DEPOSITION', + 'Environment' : 'ENVIRONMENT_2.0', 'Epidemiology' : 'EPI', - 'Survey' : 'SURVEYDATA'} + 'Survey' : 'SURVEYDATA', + } def process_pre_job_survey(input_args): '''Returns a boolean as to whether the job is ready for full processing.''' @@ -218,6 +221,31 @@ def process_pre_job_epi(input_args): return True +def process_in_job_advisory(jobPath,status,config,component): + '''Generates a word processor file containing some basic survey statistics + and output figures from deposition, environmental suitability, and + eventually also the epi model. This template advisory is intended to speed + up the process of writing advisories. The intended user is a local expert + who edits the content of the document. + Uses the gitlab project EWS-advisory-builder.''' + + config_advisory = config[component].copy() + + # provide top-level arguments to advisory config + for k,v in config.items(): + if k not in short_name.keys(): + config_advisory[k]=v + + dateString = config['StartString'] + + layout = 'tight' + + report_names = DataGatherer.run_each_subregion(config_advisory, dateString, layout) + + # pass the report filenames to upload to the remote server + + return report_names + def get_ODK_form_as_csv(form_credentials: dict, jobPath: str, config: dict, status): '''Given a dict with a single ODK form to download from an ODK Aggregate server, obtains it and converts to csv.''' @@ -1293,7 +1321,7 @@ def process_in_job_epi(jobPath,status,config,component): # provide fundamental config elements to config_epi for k,v in config.items(): - if k not in ['Survey','Environment','Deposition','Epidemiology']: + if k not in short_name.keys(): config_epi[k]=v logger.info('Incremental configuration looks like:') @@ -1376,7 +1404,7 @@ def process_in_job_epi(jobPath,status,config,component): return -def do_nothing(**kwargs): +def do_nothing(*args, **kwargs): '''Dummy function''' logger.info('Called do_nothing(). Nothing to do here') @@ -1652,12 +1680,16 @@ def process_EWS_plotting_epi(jobPath,config): def upload(config,FilesToSend,component): # TODO: replace subprocess ssh and scp commands with python-based paramiko + + usual_path = f"{config['StartString']}_0000/" component_path = { - 'Environment':f"{config['StartString']}_0000/", - 'Deposition':f"{config['StartString']}_0000/", - 'Epidemiology':f"EPI_{config['StartString']}_0000/", - 'Survey':f"SURVEYDATA_{config['StartString']}_0000/" } + 'Environment' : usual_path, + 'Deposition' : usual_path, + 'Epidemiology' : f"EPI_{config['StartString']}_0000/", + 'Survey' : f"SURVEYDATA_{config['StartString']}_0000/", + 'Advisory' : usual_path } + # TODO: make path discern Daily or Weekly sub-directory diff --git a/configs/config_Ethiopia_an_ewsdev.json b/configs/config_Ethiopia_an_ewsdev.json index 632d4ae..ac50e18 100644 --- a/configs/config_Ethiopia_an_ewsdev.json +++ b/configs/config_Ethiopia_an_ewsdev.json @@ -112,7 +112,7 @@ }, "Environment" : { "PathTemplate" : "${WorkspacePathout}ENVIRONMENT_2.0_${StartString}/processed/${SubRegionName}/${DiseaseName}/", - "SuccessFileTemplate" : "${WorkspacePathout}ENVIRONMENT_${StartString}/STATUS_SUCCESS", + "SuccessFileTemplate" : "${WorkspacePathout}ENVIRONMENT_2.0_${StartString}/STATUS_SUCCESS", "FileNameTemplate" : "RIE_value.csv", "FileListerFunction" : "list_env_suit_files_operational", "FileNamePrepared" : "?" diff --git a/configs/config_Ethiopia_an_live.json b/configs/config_Ethiopia_an_live.json index c325056..74109c5 100644 --- a/configs/config_Ethiopia_an_live.json +++ b/configs/config_Ethiopia_an_live.json @@ -112,7 +112,7 @@ }, "Environment" : { "PathTemplate" : "${WorkspacePathout}ENVIRONMENT_2.0_${StartString}/processed/${SubRegionName}/${DiseaseName}/", - "SuccessFileTemplate" : "${WorkspacePathout}ENVIRONMENT_${StartString}/STATUS_SUCCESS", + "SuccessFileTemplate" : "${WorkspacePathout}ENVIRONMENT_2.0_${StartString}/STATUS_SUCCESS", "FileNameTemplate" : "RIE_value.csv", "FileListerFunction" : "list_env_suit_files_operational", "FileNamePrepared" : "?" diff --git a/configs/config_Ethiopia_fc_ewsdev.json b/configs/config_Ethiopia_fc_ewsdev.json index 121087a..58b5ab0 100644 --- a/configs/config_Ethiopia_fc_ewsdev.json +++ b/configs/config_Ethiopia_fc_ewsdev.json @@ -112,7 +112,7 @@ }, "Environment" : { "PathTemplate" : "${WorkspacePath}ENVIRONMENT_2.0_${StartString}/processed/${SubRegionName}/${DiseaseName}/", - "SuccessFileTemplate" : "${WorkspacePath}ENVIRONMENT_${StartString}/STATUS_SUCCESS", + "SuccessFileTemplate" : "${WorkspacePath}ENVIRONMENT_2.0_${StartString}/STATUS_SUCCESS", "FileNameTemplate" : "RIE_value.csv", "FileListerFunction" : "list_env_suit_files_operational", "FileNamePrepared" : "?" @@ -169,5 +169,39 @@ "PythonScript" : "/storage/app/EWS/General/EWS-Plotting/python/ethiopia/ews_plotting_epi_ethiopia_main.py", "EpiCase" : "log10DepEnv" } + }, + "Advisory" : + { + "ProcessPreJob" : "query_past_successes", + "ProcessInJob" : "process_in_job_advisory", + "ProcessEWSPlotting" : "do_nothing", + "SubRegionNames" : ["Ethiopia"], + "seasonStartString" : "20200601", + "Environment" : { + "SuccessFileTemplate" : "${WorkspacePath}ENVIRONMENT_2.0_${StartString}/STATUS_SUCCESS", + "PlotPathTemplate" : "${WorkspacePath}/ENVIRONMENT_2.0_${dateString}/plotting/${SubRegionNameLower}/images/Weekly/", + "PlotFilenameTemplates" : { + "stripe" : "${envPlotPath}/suitability_${SubRegionNameLower}_stripe_rust_total_${dateString}0000_${EnvEndString}0000_map.png", + "stem" : "${envPlotPath}/suitability_${SubRegionNameLower}_stem_rust_total_${dateString}0000_${EnvEndString}0000_map.png", + "leaf" : "${envPlotPath}/suitability_${SubRegionNameLower}_leaf_rust_total_${dateString}0000_${EnvEndString}0000_map.png" + } + }, + "Deposition" : { + "SuccessFileTemplate" : "${WorkspacePath}DEPOSITION_${StartString}/STATUS_SUCCESS", + "PlotPathTemplate" : "${WorkspacePath}/DEPOSITION_${dateString}/plotting/${SubRegionNameLower}/images/Weekly/", + "PlotFilenameTemplates" : { + "stripe": "${depPlotPath}/deposition_${SubRegionNameLower}_stripe_total_${dateString}0000_${weekAheadString}0000_map.png", + "stem": "${depPlotPath}/deposition_${SubRegionNameLower}_stem_total_${dateString}0000_${weekAheadString}0000_map.png", + "leaf": "${depPlotPath}/deposition_${SubRegionNameLower}_leaf_total_${dateString}0000_${weekAheadString}0000_map.png" + } + }, + "Surveys" : { + "Ethiopia" : { + "ShapeFilenameAdmin0" : "/storage/app/EWS/Ethiopia/Documents/shapefiles/admin-boundaries/Ethiopia_All/Eth_Region_2013.shp", + "ShapeFilenameAdmin1" : "/storage/app/EWS/Ethiopia/Documents/shapefiles/admin-boundaries/Ethiopia_All/Eth_Zone_2013.shp", + "ShapeFilenameAdmin2" : "/storage/app/EWS/Ethiopia/Documents/shapefiles/admin-boundaries/Ethiopia_All/Eth_Woreda_2013.shp" + } + }, + "logos" : "/storage/app/EWS/Ethiopia/Documents/logos_Ethiopia_plotting.png" } } \ No newline at end of file diff --git a/configs/config_Ethiopia_fc_live.json b/configs/config_Ethiopia_fc_live.json index e728fee..5369921 100644 --- a/configs/config_Ethiopia_fc_live.json +++ b/configs/config_Ethiopia_fc_live.json @@ -112,7 +112,7 @@ }, "Environment" : { "PathTemplate" : "${WorkspacePath}ENVIRONMENT_2.0_${StartString}/processed/${SubRegionName}/${DiseaseName}/", - "SuccessFileTemplate" : "${WorkspacePath}ENVIRONMENT_${StartString}/STATUS_SUCCESS", + "SuccessFileTemplate" : "${WorkspacePath}ENVIRONMENT_2.0_${StartString}/STATUS_SUCCESS", "FileNameTemplate" : "RIE_value.csv", "FileListerFunction" : "list_env_suit_files_operational", "FileNamePrepared" : "?" @@ -169,5 +169,39 @@ "PythonScript" : "/storage/app/EWS/General/EWS-Plotting/python/ethiopia/ews_plotting_epi_ethiopia_main.py", "EpiCase" : "log10DepEnv" } + }, + "Advisory" : + { + "ProcessPreJob" : "query_past_successes", + "ProcessInJob" : "process_in_job_advisory", + "ProcessEWSPlotting" : "do_nothing", + "SubRegionNames" : ["Ethiopia"], + "seasonStartString" : "20200601", + "Environment" : { + "SuccessFileTemplate" : "${WorkspacePath}ENVIRONMENT_2.0_${StartString}/STATUS_SUCCESS", + "PlotPathTemplate" : "${WorkspacePath}/ENVIRONMENT_2.0_${dateString}/plotting/${SubRegionNameLower}/images/Weekly/", + "PlotFilenameTemplates" : { + "stripe" : "${envPlotPath}/suitability_${SubRegionNameLower}_stripe_rust_total_${dateString}0000_${EnvEndString}0000_map.png", + "stem" : "${envPlotPath}/suitability_${SubRegionNameLower}_stem_rust_total_${dateString}0000_${EnvEndString}0000_map.png", + "leaf" : "${envPlotPath}/suitability_${SubRegionNameLower}_leaf_rust_total_${dateString}0000_${EnvEndString}0000_map.png" + } + }, + "Deposition" : { + "SuccessFileTemplate" : "${WorkspacePath}DEPOSITION_${StartString}/STATUS_SUCCESS", + "PlotPathTemplate" : "${WorkspacePath}/DEPOSITION_${dateString}/plotting/${SubRegionNameLower}/images/Weekly/", + "PlotFilenameTemplates" : { + "stripe": "${depPlotPath}/deposition_${SubRegionNameLower}_stripe_total_${dateString}0000_${weekAheadString}0000_map.png", + "stem": "${depPlotPath}/deposition_${SubRegionNameLower}_stem_total_${dateString}0000_${weekAheadString}0000_map.png", + "leaf": "${depPlotPath}/deposition_${SubRegionNameLower}_leaf_total_${dateString}0000_${weekAheadString}0000_map.png" + } + }, + "Surveys" : { + "Ethiopia" : { + "ShapeFilenameAdmin0" : "/storage/app/EWS/Ethiopia/Documents/shapefiles/admin-boundaries/Ethiopia_All/Eth_Region_2013.shp", + "ShapeFilenameAdmin1" : "/storage/app/EWS/Ethiopia/Documents/shapefiles/admin-boundaries/Ethiopia_All/Eth_Zone_2013.shp", + "ShapeFilenameAdmin2" : "/storage/app/EWS/Ethiopia/Documents/shapefiles/admin-boundaries/Ethiopia_All/Eth_Woreda_2013.shp" + } + }, + "logos" : "/storage/app/EWS/Ethiopia/Documents/logos_Ethiopia_plotting.png" } } \ No newline at end of file diff --git a/configs/config_SouthAsia_an_ewsdev.json b/configs/config_SouthAsia_an_ewsdev.json index b821d86..7d754c5 100644 --- a/configs/config_SouthAsia_an_ewsdev.json +++ b/configs/config_SouthAsia_an_ewsdev.json @@ -121,7 +121,7 @@ }, "Environment" : { "PathTemplate" : "${WorkspacePathout}ENVIRONMENT_2.0_${StartString}/processed/${SubRegionName}/${DiseaseName}/", - "SuccessFileTemplate" : "${WorkspacePathout}ENVIRONMENT_${StartString}/STATUS_SUCCESS", + "SuccessFileTemplate" : "${WorkspacePathout}ENVIRONMENT_2.0_${StartString}/STATUS_SUCCESS", "FileNameTemplate" : "RIE_value.csv", "FileListerFunction" : "list_env_suit_files_operational", "FileNamePrepared" : "?" diff --git a/configs/config_SouthAsia_an_live.json b/configs/config_SouthAsia_an_live.json index d570960..e4a9a19 100644 --- a/configs/config_SouthAsia_an_live.json +++ b/configs/config_SouthAsia_an_live.json @@ -121,7 +121,7 @@ }, "Environment" : { "PathTemplate" : "${WorkspacePathout}ENVIRONMENT_2.0_${StartString}/processed/${SubRegionName}/${DiseaseName}/", - "SuccessFileTemplate" : "${WorkspacePathout}ENVIRONMENT_${StartString}/STATUS_SUCCESS", + "SuccessFileTemplate" : "${WorkspacePathout}ENVIRONMENT_2.0_${StartString}/STATUS_SUCCESS", "FileNameTemplate" : "RIE_value.csv", "FileListerFunction" : "list_env_suit_files_operational", "FileNamePrepared" : "?" diff --git a/configs/config_SouthAsia_big_ewsdev.json b/configs/config_SouthAsia_big_ewsdev.json index 147839b..b379bc0 100644 --- a/configs/config_SouthAsia_big_ewsdev.json +++ b/configs/config_SouthAsia_big_ewsdev.json @@ -111,7 +111,7 @@ }, "Environment" : { "PathTemplate" : "${WorkspacePath}ENVIRONMENT_2.0_${StartString}/processed/${SubRegionName}/${DiseaseName}/", - "SuccessFileTemplate" : "${WorkspacePath}ENVIRONMENT_${StartString}/STATUS_SUCCESS", + "SuccessFileTemplate" : "${WorkspacePath}ENVIRONMENT_2.0_${StartString}/STATUS_SUCCESS", "FileNameTemplate" : "RIE_value.csv", "FileListerFunction" : "list_env_suit_files_operational", "FileNamePrepared" : "?" @@ -168,5 +168,43 @@ "PythonScript" : "/storage/app/EWS/General/EWS-Plotting/python/south_asia/ews_plotting_epi_asia_main.py", "EpiCase" : "log10DepEnv" } + }, + "Advisory" : { + "ProcessPreJob" : "query_past_successes", + "ProcessInJob" : "process_in_job_advisory", + "ProcessEWSPlotting" : "do_nothing", + "SubRegionNames" : ["Nepal","Bangladesh"], + "seasonStartString" : "20201201", + "Environment" : { + "SuccessFileTemplate" : "${WorkspacePath}ENVIRONMENT_2.0_${StartString}/STATUS_SUCCESS", + "PlotPathTemplate" : "${WorkspacePath}/ENVIRONMENT_2.0_${dateString}/plotting/${SubRegionNameLower}/images/Weekly/", + "PlotFilenameTemplates" : { + "stripe" : "${envPlotPath}/suitability_${SubRegionNameLower}_stripe_rust_total_${dateString}0000_${EnvEndString}0000_map.png", + "stem" : "${envPlotPath}/suitability_${SubRegionNameLower}_stem_rust_total_${dateString}0000_${EnvEndString}0000_map.png", + "leaf" : "${envPlotPath}/suitability_${SubRegionNameLower}_leaf_rust_total_${dateString}0000_${EnvEndString}0000_map.png" + } + }, + "Deposition" : { + "SuccessFileTemplate" : "${WorkspacePath}DEPOSITION_${StartString}/STATUS_SUCCESS", + "PlotPathTemplate" : "${WorkspacePath}/DEPOSITION_${dateString}/plotting/${SubRegionNameLower}/images/Weekly/", + "PlotFilenameTemplates" : { + "stripe": "${depPlotPath}/deposition_${SubRegionNameLower}_stripe_total_${dateString}0000_${weekAheadString}0000_map.png", + "stem": "${depPlotPath}/deposition_${SubRegionNameLower}_stem_total_${dateString}0000_${weekAheadString}0000_map.png", + "leaf": "${depPlotPath}/deposition_${SubRegionNameLower}_leaf_total_${dateString}0000_${weekAheadString}0000_map.png" + } + }, + "Surveys" : { + "Nepal" : { + "ShapeFilenameAdmin0" : "/storage/app/EWS/SouthAsia/Documents/shapefiles/Nepal_admin0.shp", + "ShapeFilenameAdmin1" : "/storage/app/EWS/SouthAsia/Documents/shapefiles/Nepal_admin1_withwheat_2017-19.shp", + "ShapeFilenameAdmin2" : "/storage/app/EWS/SouthAsia/Documents/shapefiles/Nepal_admin2.shp" + }, + "Bangladesh" : { + "ShapeFilenameAdmin0" : "/storage/app/EWS/SouthAsia/Documents/shapefiles/Bangladesh_admin0.shp", + "ShapeFilenameAdmin1" : "/storage/app/EWS/SouthAsia/Documents/shapefiles/Bangladesh_admin1.shp", + "ShapeFilenameAdmin2" : "/storage/app/EWS/SouthAsia/Documents/shapefiles/Bangladesh_admin2.shp" + } + }, + "logos" : "/storage/app/EWS/SouthAsia/Documents/logos_ARRCC.png" } } \ No newline at end of file diff --git a/configs/config_SouthAsia_big_live.json b/configs/config_SouthAsia_big_live.json index 3b42306..b39a580 100644 --- a/configs/config_SouthAsia_big_live.json +++ b/configs/config_SouthAsia_big_live.json @@ -131,7 +131,7 @@ }, "Environment" : { "PathTemplate" : "${WorkspacePath}ENVIRONMENT_2.0_${StartString}/processed/${SubRegionName}/${DiseaseName}/", - "SuccessFileTemplate" : "${WorkspacePath}ENVIRONMENT_${StartString}/STATUS_SUCCESS", + "SuccessFileTemplate" : "${WorkspacePath}ENVIRONMENT_2.0_${StartString}/STATUS_SUCCESS", "FileNameTemplate" : "RIE_value.csv", "FileListerFunction" : "list_env_suit_files_operational", "FileNamePrepared" : "?" @@ -188,5 +188,43 @@ "PythonScript" : "/storage/app/EWS/General/EWS-Plotting/python/south_asia/ews_plotting_epi_asia_main.py", "EpiCase" : "log10DepEnv" } + }, + "Advisory" : { + "ProcessPreJob" : "query_past_successes", + "ProcessInJob" : "process_in_job_advisory", + "ProcessEWSPlotting" : "do_nothing", + "SubRegionNames" : ["Nepal","Bangladesh"], + "seasonStartString" : "20201201", + "Environment" : { + "SuccessFileTemplate" : "${WorkspacePath}ENVIRONMENT_2.0_${StartString}/STATUS_SUCCESS", + "PlotPathTemplate" : "${WorkspacePath}/ENVIRONMENT_2.0_${dateString}/plotting/${SubRegionNameLower}/images/Weekly/", + "PlotFilenameTemplates" : { + "stripe" : "${envPlotPath}/suitability_${SubRegionNameLower}_stripe_rust_total_${dateString}0000_${EnvEndString}0000_map.png", + "stem" : "${envPlotPath}/suitability_${SubRegionNameLower}_stem_rust_total_${dateString}0000_${EnvEndString}0000_map.png", + "leaf" : "${envPlotPath}/suitability_${SubRegionNameLower}_leaf_rust_total_${dateString}0000_${EnvEndString}0000_map.png" + } + }, + "Deposition" : { + "SuccessFileTemplate" : "${WorkspacePath}DEPOSITION_${StartString}/STATUS_SUCCESS", + "PlotPathTemplate" : "${WorkspacePath}/DEPOSITION_${dateString}/plotting/${SubRegionNameLower}/images/Weekly/", + "PlotFilenameTemplates" : { + "stripe": "${depPlotPath}/deposition_${SubRegionNameLower}_stripe_total_${dateString}0000_${weekAheadString}0000_map.png", + "stem": "${depPlotPath}/deposition_${SubRegionNameLower}_stem_total_${dateString}0000_${weekAheadString}0000_map.png", + "leaf": "${depPlotPath}/deposition_${SubRegionNameLower}_leaf_total_${dateString}0000_${weekAheadString}0000_map.png" + } + }, + "Surveys" : { + "Nepal" : { + "ShapeFilenameAdmin0" : "/storage/app/EWS/SouthAsia/Documents/shapefiles/Nepal_admin0.shp", + "ShapeFilenameAdmin1" : "/storage/app/EWS/SouthAsia/Documents/shapefiles/Nepal_admin1_withwheat_2017-19.shp", + "ShapeFilenameAdmin2" : "/storage/app/EWS/SouthAsia/Documents/shapefiles/Nepal_admin2.shp" + }, + "Bangladesh" : { + "ShapeFilenameAdmin0" : "/storage/app/EWS/SouthAsia/Documents/shapefiles/Bangladesh_admin0.shp", + "ShapeFilenameAdmin1" : "/storage/app/EWS/SouthAsia/Documents/shapefiles/Bangladesh_admin1.shp", + "ShapeFilenameAdmin2" : "/storage/app/EWS/SouthAsia/Documents/shapefiles/Bangladesh_admin2.shp" + } + }, + "logos" : "/storage/app/EWS/SouthAsia/Documents/logos_ARRCC.png" } } \ No newline at end of file diff --git a/configs/config_SouthAsia_fc_ewsdev.json b/configs/config_SouthAsia_fc_ewsdev.json index 8c8347c..b52bbcf 100644 --- a/configs/config_SouthAsia_fc_ewsdev.json +++ b/configs/config_SouthAsia_fc_ewsdev.json @@ -120,7 +120,7 @@ }, "Environment" : { "PathTemplate" : "${WorkspacePath}ENVIRONMENT_2.0_${StartString}/processed/${SubRegionName}/${DiseaseName}/", - "SuccessFileTemplate" : "${WorkspacePath}ENVIRONMENT_${StartString}/STATUS_SUCCESS", + "SuccessFileTemplate" : "${WorkspacePath}ENVIRONMENT_2.0_${StartString}/STATUS_SUCCESS", "FileNameTemplate" : "RIE_value.csv", "FileListerFunction" : "list_env_suit_files_operational", "FileNamePrepared" : "?" @@ -177,5 +177,43 @@ "PythonScript" : "/storage/app/EWS/General/EWS-Plotting/python/south_asia/ews_plotting_epi_asia_main.py", "EpiCase" : "log10DepEnv" } + }, + "Advisory" : { + "ProcessPreJob" : "query_past_successes", + "ProcessInJob" : "process_in_job_advisory", + "ProcessEWSPlotting" : "do_nothing", + "SubRegionNames" : ["Nepal","Bangladesh"], + "seasonStartString" : "20201201", + "Environment" : { + "SuccessFileTemplate" : "${WorkspacePath}ENVIRONMENT_2.0_${StartString}/STATUS_SUCCESS", + "PlotPathTemplate" : "${WorkspacePath}/ENVIRONMENT_2.0_${dateString}/plotting/${SubRegionNameLower}/images/Weekly/", + "PlotFilenameTemplates" : { + "stripe" : "${envPlotPath}/suitability_${SubRegionNameLower}_stripe_rust_total_${dateString}0000_${EnvEndString}0000_map.png", + "stem" : "${envPlotPath}/suitability_${SubRegionNameLower}_stem_rust_total_${dateString}0000_${EnvEndString}0000_map.png", + "leaf" : "${envPlotPath}/suitability_${SubRegionNameLower}_leaf_rust_total_${dateString}0000_${EnvEndString}0000_map.png" + } + }, + "Deposition" : { + "SuccessFileTemplate" : "${WorkspacePath}DEPOSITION_${StartString}/STATUS_SUCCESS", + "PlotPathTemplate" : "${WorkspacePath}/DEPOSITION_${dateString}/plotting/${SubRegionNameLower}/images/Weekly/", + "PlotFilenameTemplates" : { + "stripe": "${depPlotPath}/deposition_${SubRegionNameLower}_stripe_total_${dateString}0000_${weekAheadString}0000_map.png", + "stem": "${depPlotPath}/deposition_${SubRegionNameLower}_stem_total_${dateString}0000_${weekAheadString}0000_map.png", + "leaf": "${depPlotPath}/deposition_${SubRegionNameLower}_leaf_total_${dateString}0000_${weekAheadString}0000_map.png" + } + }, + "Surveys" : { + "Nepal" : { + "ShapeFilenameAdmin0" : "/storage/app/EWS/SouthAsia/Documents/shapefiles/Nepal_admin0.shp", + "ShapeFilenameAdmin1" : "/storage/app/EWS/SouthAsia/Documents/shapefiles/Nepal_admin1_withwheat_2017-19.shp", + "ShapeFilenameAdmin2" : "/storage/app/EWS/SouthAsia/Documents/shapefiles/Nepal_admin2.shp" + }, + "Bangladesh" : { + "ShapeFilenameAdmin0" : "/storage/app/EWS/SouthAsia/Documents/shapefiles/Bangladesh_admin0.shp", + "ShapeFilenameAdmin1" : "/storage/app/EWS/SouthAsia/Documents/shapefiles/Bangladesh_admin1.shp", + "ShapeFilenameAdmin2" : "/storage/app/EWS/SouthAsia/Documents/shapefiles/Bangladesh_admin2.shp" + } + }, + "logos" : "/storage/app/EWS/SouthAsia/Documents/logos_ARRCC.png" } } \ No newline at end of file diff --git a/configs/config_SouthAsia_fc_live.json b/configs/config_SouthAsia_fc_live.json index 87288ad..0d3a226 100644 --- a/configs/config_SouthAsia_fc_live.json +++ b/configs/config_SouthAsia_fc_live.json @@ -121,7 +121,7 @@ }, "Environment" : { "PathTemplate" : "${WorkspacePath}ENVIRONMENT_2.0_${StartString}/processed/${SubRegionName}/${DiseaseName}/", - "SuccessFileTemplate" : "${WorkspacePath}ENVIRONMENT_${StartString}/STATUS_SUCCESS", + "SuccessFileTemplate" : "${WorkspacePath}ENVIRONMENT_2.0_${StartString}/STATUS_SUCCESS", "FileNameTemplate" : "RIE_value.csv", "FileListerFunction" : "list_env_suit_files_operational", "FileNamePrepared" : "?" @@ -178,5 +178,43 @@ "PythonScript" : "/storage/app/EWS/General/EWS-Plotting/python/south_asia/ews_plotting_epi_asia_main.py", "EpiCase" : "log10DepEnv" } + }, + "Advisory" : { + "ProcessPreJob" : "query_past_successes", + "ProcessInJob" : "process_in_job_advisory", + "ProcessEWSPlotting" : "do_nothing", + "SubRegionNames" : ["Nepal","Bangladesh"], + "seasonStartString" : "20201201", + "Environment" : { + "SuccessFileTemplate" : "${WorkspacePath}ENVIRONMENT_2.0_${StartString}/STATUS_SUCCESS", + "PlotPathTemplate" : "${WorkspacePath}/ENVIRONMENT_2.0_${dateString}/plotting/${SubRegionNameLower}/images/Weekly/", + "PlotFilenameTemplates" : { + "stripe" : "${envPlotPath}/suitability_${SubRegionNameLower}_stripe_rust_total_${dateString}0000_${EnvEndString}0000_map.png", + "stem" : "${envPlotPath}/suitability_${SubRegionNameLower}_stem_rust_total_${dateString}0000_${EnvEndString}0000_map.png", + "leaf" : "${envPlotPath}/suitability_${SubRegionNameLower}_leaf_rust_total_${dateString}0000_${EnvEndString}0000_map.png" + } + }, + "Deposition" : { + "SuccessFileTemplate" : "${WorkspacePath}DEPOSITION_${StartString}/STATUS_SUCCESS", + "PlotPathTemplate" : "${WorkspacePath}/DEPOSITION_${dateString}/plotting/${SubRegionNameLower}/images/Weekly/", + "PlotFilenameTemplates" : { + "stripe": "${depPlotPath}/deposition_${SubRegionNameLower}_stripe_total_${dateString}0000_${weekAheadString}0000_map.png", + "stem": "${depPlotPath}/deposition_${SubRegionNameLower}_stem_total_${dateString}0000_${weekAheadString}0000_map.png", + "leaf": "${depPlotPath}/deposition_${SubRegionNameLower}_leaf_total_${dateString}0000_${weekAheadString}0000_map.png" + } + }, + "Surveys" : { + "Nepal" : { + "ShapeFilenameAdmin0" : "/storage/app/EWS/SouthAsia/Documents/shapefiles/Nepal_admin0.shp", + "ShapeFilenameAdmin1" : "/storage/app/EWS/SouthAsia/Documents/shapefiles/Nepal_admin1_withwheat_2017-19.shp", + "ShapeFilenameAdmin2" : "/storage/app/EWS/SouthAsia/Documents/shapefiles/Nepal_admin2.shp" + }, + "Bangladesh" : { + "ShapeFilenameAdmin0" : "/storage/app/EWS/SouthAsia/Documents/shapefiles/Bangladesh_admin0.shp", + "ShapeFilenameAdmin1" : "/storage/app/EWS/SouthAsia/Documents/shapefiles/Bangladesh_admin1.shp", + "ShapeFilenameAdmin2" : "/storage/app/EWS/SouthAsia/Documents/shapefiles/Bangladesh_admin2.shp" + } + }, + "logos" : "/storage/app/EWS/SouthAsia/Documents/logos_ARRCC.png" } } \ No newline at end of file diff --git a/run_Processor.sh b/run_Processor.sh index 918dc11..cf86948 100755 --- a/run_Processor.sh +++ b/run_Processor.sh @@ -3,7 +3,8 @@ # provide custom python packages so they can be imported flagdir=/storage/app/EWS/General/EWS-python/custom_modules/flagdir/ epimodel=/storage/app/EWS/General/EWS-EpiModel/ -export PYTHONPATH=$PYTHONPATH:$flagdir:$epimodel +advisory=/storage/app/EWS/General/EWS-advisory-builder/ +export PYTHONPATH=$PYTHONPATH:$flagdir:$epimodel:$advisory # activate conda environment of python modules so they can be imported conda_env=/storage/app/EWS/General/EWS-python/py3EWSepi -- GitLab