diff --git a/PSILARTEMP.cfg b/PSILARTEMP.cfg index c5afb6afbadc22c2ac1aec7c7c5845715749ceed..03d55797138f3a7bb352858888440e2968c6547c 100644 --- a/PSILARTEMP.cfg +++ b/PSILARTEMP.cfg @@ -3,15 +3,17 @@ languages=en,nb [i18n.en] -no_forecast = Flight period ended +no_forecast = Forecast not started no_risk = Flight period not started possible_risk = Flight period starting high_risk = Peak flight activity +flight_ended = 1st generation flight period ended day_degrees = Day degrees [i18n.nb] -no_forecast = Sverming avsluttet +no_forecast = Varsel ikke startet no_risk = Sverming har ikke begynt possible_risk = Sverming i startfasen high_risk = Sverming på sitt mest aktive +flight_ended = Sverming av 1. generasjon avsluttet day_degrees = Døgngrader \ No newline at end of file diff --git a/PSILARTEMP.py b/PSILARTEMP.py index 2a32c55ce8e18fe94ad5a53f2bfd1d0653e0c512..57cbad1e1bf77d58f074e1dea5b8b98197f1935d 100755 --- a/PSILARTEMP.py +++ b/PSILARTEMP.py @@ -62,8 +62,13 @@ else: os.rename(f"{tmp_path}DD_unmasked.nc", f"{tmp_path}DD.nc") # Add the DD threshold classification => warning status -# (A>0)*(A<=260)*2 + (A>260)*(A<=360)*3 + (A>360)*(A<=560)*4 + (A>560)*0 -subprocess.run(f'cdo -aexpr,"WARNING_STATUS=(TM>0)*(TM<=260)*2 + (TM>260)*(TM<=360)*3 + (TM>360)*(TM<=560)*4 + (TM>560)*0" {tmp_path}DD.nc {tmp_path}result.nc', shell=True) +# 0: DD == 0 # Forecast not started +# 2: DD <= 260 # Flight period not started +# 3: 260 < DD <= 360 # Flight period starting +# 4: 360 < DD <= 560 # Peak flight period +# 5: 560 < DD # 1st generation flight period ended +# (A>0)*(A<=260)*2 + (A>260)*(A<=360)*3 + (A>360)*(A<=560)*4 + (A>560)*5 +subprocess.run(f'cdo -aexpr,"WARNING_STATUS=(TM>0)*(TM<=260)*2 + (TM>260)*(TM<=360)*3 + (TM>360)*(TM<=560)*4 + (TM>560)*5" {tmp_path}DD.nc {tmp_path}result.nc', shell=True) #""" diff --git a/mapfile/template.j2 b/mapfile/template.j2 index fa06c0af6f8e0956ad6eb095eaf95506c0a1e55b..050ad3d08bd6e07157e0a78ee5fed7f717400935 100644 --- a/mapfile/template.j2 +++ b/mapfile/template.j2 @@ -112,7 +112,7 @@ LAYER { \"classification\": 0, \"legendLabel\": \"{{ language.no_forecast }}\", - \"legendIconCSS\": \"width: 25px; background-color: #707070;\" + \"legendIconCSS\": \"width: 25px; background-color: #B0B0B0;\" }, { \"classification\": 2, @@ -128,6 +128,11 @@ LAYER \"classification\": 4, \"legendLabel\": \"{{ language.high_risk }}\", \"legendIconCSS\": \"width: 25px; background-color: #FF0000;\" + } , + { + \"classification\": 4, + \"legendLabel\": \"{{ language.flight_ended }}\", + \"legendIconCSS\": \"width: 25px; background-color: #707070\" } ] } @@ -139,33 +144,40 @@ LAYER # class using simple string comparison, equivalent to ([pixel] = 0) CLASS - NAME "Model not running" + NAME "Forecast not started" EXPRESSION ([pixel] >= 0 AND [pixel] < 2) STYLE - COLOR 112 112 112 + COLOR 176 176 176 END END CLASS - NAME "No infection risk" + NAME "Flight period not started" EXPRESSION ([pixel] >= 2 AND [pixel] < 3) STYLE COLOR 0 180 87 END END CLASS - NAME "Possible infection risk" + NAME "Flight period starting" EXPRESSION ([pixel] >= 3 AND [pixel] < 4) STYLE COLOR 255 204 0 END END CLASS - NAME "High infection risk" - EXPRESSION ([pixel] >= 4) + NAME "Peak flight periodk" + EXPRESSION ([pixel] >= 4 AND [pixel] < 5) STYLE COLOR 255 0 0 END END + CLASS + NAME "1st generation flight period ended" + EXPRESSION ([pixel] >= 5) + STYLE + COLOR 112 112 112 + END + END END # Layer LAYER