|
Common Gateway InterfaceIntroductionThe Common Gateway Interface (CGI) is a standard protocol for interfacing external applications with Web servers. Regular HTML documents produce static pages. Static pages do not change unless the page designer alters the HTML source. A CGI program executes in real time, producing dynamic Web pages that change depending on server parameters or that produce output in response to requests from a Web browser. For a nice example, visit my NCEP Reanalysis Plotter, which takes information submitted by an individual's Web browser and plots a customized GrADS image from the reanalysis data available on Blizzard. Create a Dynamic Web Page
Post your finished HTML page on your password-protected Web site, along with the text of your Python CGI script. You can post the text by wrapping your Python code with HTML headers in an HTML file that looks like this:
<HTML> Coding TipsYou might find some useful information about the plotting utility within the documentation for matplotlib. You may notice that the Oklahoma Mesonet files do not contain dewpoint data. The files instead contain relative humidity (RELH) and air temperature (TAIR). Review the parameter description for the Mesonet data files. Use the following equations to calculate the dewpoint from the relative humidity within your code: ![]() Here, RH is the relative humidity (%), e is the vapor pressure (mb), es is the saturation vapor pressure (mb), T is the air temperature (°C), and Td is the dewpoint temperature (°C). |