#! /usr/opt/bin/python ########################################################################### # run_rt_updates.py rt_www_rev='2.01' # May, 1998 # by Dave Briar and Daryll Pope ########################################################################### # # -- This script executes scripts to prepare data and build a cache # of the most current values and then generate hydrographs # ########################################################################### # ------------------------------------------------------------------------- # -- Assign RT_HOME and do system stuff # ------------------------------------------------------------------------- RT_HOME="/mt/www/rt" QUEUEDIR="/var/ftp/incoming/rt_www" import posix, sys, time posix.umask(002) posix.chdir(RT_HOME) # ------------------------------------------------------------------------- # -- Run /RT_HOME/rt_prepare_data.py # -- # -- Reads file containing unit-values ftp'd from NWIS, purges bad data, # -- creates RT_HOME/data/.dat files, and builds ./pub/rt_cache # -- NOTE: -- Trailing "-L" argument causes creation of log file # -- # -- If arg is supplied: # -- If arg == "uv_file.list", use it to identify which stations # -- to process. # -- Else; assume arg is path of unit-value file transferred from NWIS # -- Else; No arg == do all stations # ------------------------------------------------------------------------- log_flag = ' -L' force_flag = '' input_file_path = '' if len(sys.argv) > 1: if sys.argv[1] == "uv_file.list": input_file_path = RT_HOME+'/uv_file.list' log_flag = '' force_flag = ' -F' else: input_file_path = QUEUEDIR+'/'+sys.argv[1] posix.system(RT_HOME+'/bin/rt_prepare_data.py '+input_file_path+log_flag) # ------------------------------------------------------------------------- # -- Run /RT_HOME/cgi-bin/rt_graph_update.py # -- NOTE: trailing "-L" argument causes creation of log file # ------------------------------------------------------------------------- posix.system(RT_HOME+'/bin/rt_graph_update.py '+log_flag+force_flag) # -- eof