def make_other(generics, i): thisq = "q"+i # Search Results for each option, if it errors, big deal try: question = generics["question"] optiona = generics["optiona"] optionb = generics["optionb"] optionc = generics["optionc"] optiond = generics["optiond"] optione = generics["optione"] optionf = generics["optionf"] optiong = generics["optiong"] optionh = generics["optionh"] except: print # Send along info that we indead have a question... print '<input type="hidden" name="'+thisq+'" value="YES">' print """ <TABLE align="CENTER" bgcolor="#EEEEEE" cellpadding="3" cellspacing="0" border="0" width="100%"> <TR WIDTH="100%"><TD> <TABLE bgcolor="#EEEEEE" border="0" cellpadding="3" cellspacing="0" width="100%">""" print '<TR><TD><font color="blue" size="3" face="ARIAL"><B>Question:</B></font></TD></TR>' print '<TR><TD bgcolor="white" align="left">' try: print question make_option("A", optiona, thisq) make_option("B", optionb, thisq) make_option("C", optionc, thisq) make_option("D", optiond, thisq) make_option("E", optione, thisq) make_option("F", optionf, thisq) make_option("G", optiong, thisq) make_option("H", optionh, thisq) make_option("N", "No data available", thisq) #Give the option to pick no data except: print style.bot_box()
def mk_data(gmt_tuple, multipler): orig_secs = time.mktime(gmt_tuple) currentHour = gmt_tuple[3] data_format = time.strftime("%y%m%d%H", gmt_tuple) dir_format = time.strftime("/archivewx/data/%Y_%m_%d/", gmt_tuple) print '<font size="2" face="arial">' print '<BR>' print '<TABLE width="100%" border="1">' print '<TR><TH></TH><TH>Current:</TH><TH>- '+str(1*multipler)+' hr:</TH><TH>- '+str(2*multipler)+' hrs:</TH><TH>- '+str(3*multipler)+' hrs:</TH><TH>- '+str(4*multipler)+' hrs:</TH></TR>' print '<TR>' mk_row_data(orig_secs, "sfc", ".gif", "/icons/sfc_thumb.gif", "Surface Chart", multipler) print '</TR><TR>' mk_row_data(orig_secs, "temp", ".gif", "/icons/temp_thumb.gif", "Surface Temps Chart", multipler) print '</TR><TR>' mk_row_data(orig_secs, "dew", ".gif", "/icons/temp_thumb.gif", "Surface Dew Point Chart", multipler) print '</TR><TR>' mk_row_data(orig_secs, "moist", ".gif", "/icons/moist_thumb.gif", "Moisture Divergence", multipler) print '</TR><TR>' mk_row_data(orig_secs, "nowrad", ".gif", "/icons/NAT_thumb.gif", "National Radar Summary", multipler) print '</TR>' print '</TABLE>' print '<BR><b>Other data links:</b><BR>' print '<MULTICOL COLS="3">' # mk_data_link(dir_format+data_format+'.txt' , "/icons/NWS_thumb.gif" , "NWS Text Data") if currentHour == 12: mk_data_link(dir_format+'cape'+data_format+'.gif' , "/icons/cape_thumb.gif" , "ETA Forecasted CAPE") else: mk_data_link(dir_format+'cape'+data_format+'.gif' , "/icons/cape_thumb.gif" , "Satellite Derived CAPE") mk_data_link(dir_format+'tpw'+data_format+'.gif' , "/icons/tpw_thumb.gif" , "Precipitable Water") mk_data_link(dir_format+'li'+data_format+'.gif' , "/icons/li_thumb.gif" , "Lifted Index") mk_data_link(dir_format+'light'+data_format+'.gif' , "/icons/light_thumb.gif" , "Lightning Data") mk_data_link(dir_format+'MPX'+data_format+'.gif' , "/icons/light_thumb.gif" , "Minneapolis Radar Reflectivity") mk_data_link(dir_format+'MPXVEL'+data_format+'.gif' , "/icons/light_thumb.gif" , "Minneapolis Velocity") mk_data_link(dir_format+'DMX'+data_format+'.gif' , "/icons/light_thumb.gif" , "Des Moines Radar Reflectivity") mk_data_link(dir_format+'sat'+data_format+'.jpg' , "/icons/light_thumb.gif" , "Satellite Image") print '</MULTICOL>' if currentHour > 12: timeTag = "12 Z" data_format = time.strftime("%y%m%d12", gmt_tuple) elif currentHour < 12 and currentHour > 0: timeTag = "0 Z" data_format = time.strftime("%y%m%d00", gmt_tuple) elif currentHour == 0: timeTag = "0 Z" elif currentHour == 12: timeTag = "12 Z" print '<TABLE><TR><TD>' print '<TABLE align="CENTER" bgcolor="#EEEEEE" cellpadding="2" border="0">' print '<TR><TD>' print '<TABLE bgcolor="#EEEEEE" border="0" cellpadding="2">' print '<TR><TD><font color="black" size="4" face="ARIAL"><B>Upper Air Data valid @ '+timeTag+' </B></font></TD></TR>' print '<TR><TD bgcolor="white" align="center">' mk_data_link(dir_format+'850mb'+data_format+'.gif' , "/icons/temp_thumb.gif" , "850 MB") mk_data_link(dir_format+'700mb'+data_format+'.gif' , "/icons/temp_thumb.gif" , "700 MB") mk_data_link(dir_format+'500VORT'+data_format+'.gif' , "/icons/temp_thumb.gif" , "500 MB Vorticity") mk_data_link(dir_format+'500mb'+data_format+'.gif' , "/icons/temp_thumb.gif" , "500 MB") mk_data_link(dir_format+'300mb'+data_format+'.gif' , "/icons/light_thumb.gif" , "300 MB") mk_data_link(dir_format+'200mb'+data_format+'.gif' , "/icons/light_thumb.gif" , "200 MB") style.bot_box() print '</TD><TD>' print '<TABLE align="CENTER" bgcolor="#EEEEEE" cellpadding="2" border="0">' print '<TR><TD>' print '<TABLE bgcolor="#EEEEEE" border="0" cellpadding="2">' print '<TR><TD><font color="black" size="4" face="ARIAL"><B>Profiler Data valid @ '+timeTag+' </B></font></TD></TR>' print '<TR><TD bgcolor="white" align="center">' mk_data_link(dir_format+'1000m'+data_format+'.gif' , "/icons/light_thumb.gif" , "1000 m Profiler") mk_data_link(dir_format+'3000m'+data_format+'.gif' , "/icons/light_thumb.gif" , "3000 m Profiler") mk_data_link(dir_format+'5600m'+data_format+'.gif' , "/icons/light_thumb.gif" , "5600 m Profiler") mk_data_link(dir_format+'9000m'+data_format+'.gif' , "/icons/light_thumb.gif" , "9000 m Profiler") style.bot_box() print '</TD><TD>' print '<TABLE align="CENTER" bgcolor="#EEEEEE" cellpadding="2" border="0">' print '<TR><TD>' print '<TABLE bgcolor="#EEEEEE" border="0" cellpadding="2">' print '<TR><TD><font color="black" size="4" face="ARIAL"><B>ETA Model Data valid @ '+timeTag+' </B></font></TD></TR>' print '<TR><TD bgcolor="white" align="center">' mk_data_link(dir_format+'etaTHK'+data_format+'F00.gif' , "/icons/light_thumb.gif" , "ETA Thickness and Pressure") mk_data_link(dir_format+'etaVORT'+data_format+'F00.gif' , "/icons/light_thumb.gif" , "ETA Vorticity") mk_data_link(dir_format+'etaPREC'+data_format+'F00.gif' , "/icons/light_thumb.gif" , "ETA Precipation") mk_data_link(dir_format+'etaTEMP'+data_format+'F00.gif' , "/icons/light_thumb.gif" , "ETA Model Temperatures") mk_data_link(dir_format+'etaCAPE'+data_format+'F00.gif' , "/icons/light_thumb.gif" , "ETA CAPE") mk_data_link(dir_format+'etaTHK'+data_format+'F12.gif' , "/icons/light_thumb.gif" , "12 HR ETA Thickness and Pressure") mk_data_link(dir_format+'etaVORT'+data_format+'F12.gif' , "/icons/light_thumb.gif" , "12 HR ETA Vorticity") mk_data_link(dir_format+'etaPREC'+data_format+'F12.gif' , "/icons/light_thumb.gif" , "12 HR ETA Precipation") mk_data_link(dir_format+'etaTEMP'+data_format+'F12.gif' , "/icons/light_thumb.gif" , "12 HR ETA Model Temperatures") style.bot_box() print '</TD></TR></TABLE>'