Skip to content
Snippets Groups Projects
Commit 55b8267b authored by Lene Wasskog's avatar Lene Wasskog
Browse files

feat: Copy query templates to output dir

parent 00f96e1b
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,7 @@ from jinja2 import Environment, FileSystemLoader
import logging
import pytz
import shutil
import configparser
import netCDF4 as nc
import numpy as np
......@@ -62,7 +63,7 @@ if datetime.now() <= model_start_date:
logging.error(f"Today is before the configured start date of {model_start_date}. Exiting.")
exit(0)
home_dir = os.getenv('HOME_DIR')
infile_path = f"{os.getenv('WEATHER_DATA_DIR')}{year}/"
outtmp_path = f"out/{year}/"
......@@ -252,8 +253,15 @@ def create_warning_status(start_date):
"language_codes": language_codes,
}
)
with open(f"{mapfile_outdir}/NAERSTADMO.map", "w") as f:
with open(f"{mapfile_outdir}NAERSTADMO.map", "w") as f:
f.write(output)
query_template = os.path.join(home_dir, "mapfile/query_template.xml")
query_template_IR = os.path.join(home_dir, "mapfile/query_template_IR.xml")
query_template_RISK = os.path.join(home_dir, "mapfile/query_template_RISK.xml")
shutil.copy(query_template, mapfile_outdir)
shutil.copy(query_template_IR, mapfile_outdir)
shutil.copy(query_template_RISK, mapfile_outdir)
subprocess.run(f"rm {tmpfile_path}*", shell=True)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment