Merge "VLab Issue #15553 - DR18623 nwpsTrkngCG0.py clean-up; fixes #15553 Remove references to 'local' and test comments in banner messages." into field_16.2.1

Former-commit-id: 59264a7f296e0d4c207003abc2bc0669ea6052ba
This commit is contained in:
Ana Rivera 2016-02-12 12:32:45 +00:00 committed by Gerrit Code Review
commit 039658f5e7

View file

@ -1,9 +1,9 @@
from Init import *
import os
class nwpsTrkngCG0localForecaster(Forecaster):
class nwpsTrkngCG0Forecaster(Forecaster):
def __init__(self):
Forecaster.__init__(self, "nwpsTrkngCG0local", "nwpsTrkngCG0local")
Forecaster.__init__(self, "nwpsTrkngCG0", "nwpsTrkngCG0")
def _calcPeriodN(self, swper):
return swper
@ -56,21 +56,21 @@ class nwpsTrkngCG0localForecaster(Forecaster):
return self._calcWaveN(swell_OSEQD10, swdir_OSEQD10)
def main():
nwpsTrkngCG0localForecaster().run()
chkfile = "/tmp/nwpslocal/CGTrack"
chkfiledir = "/tmp/nwpslocal"
nwpsTrkngCG0Forecaster().run()
chkfile = "/tmp/nwps/CGTrack"
chkfiledir = "/tmp/nwps"
try:
os.makedirs(chkfiledir)
except OSError:
pass
if not os.path.isfile(chkfile):
open(chkfile, 'a').close()
os.system('/awips2/GFESuite/bin/sendGfeMessage -s -m "BOOO TRACKING WAVE GRIDS ARE NOW IN GFE"')
os.system('/awips2/GFESuite/bin/sendGfeMessage -s -m "TRACKING WAVE GRIDS ARE NOW IN GFE"')
filemodtime = os.stat(chkfile).st_mtime
twominutesago = time.time() - 120
if (twominutesago - filemodtime) > 0:
os.utime(chkfile, None)
os.system('/awips2/GFESuite/bin/sendGfeMessage -s -m "STOP TRACKING ME! TRACKING WAVE GRIDS ARE NOW IN GFE"')
os.system('/awips2/GFESuite/bin/sendGfeMessage -s -m "TRACKING WAVE GRIDS ARE NOW IN GFE"')
if __name__ == "__main__":
main()