Reformatting NWS text products
Here we attempt to improve the formatting of the text coming out of the Area Discussion cgi scripts found at Oklahoma Weather Roundup.
Download pydis8.tar. Read the Readme.
In pydis8.tar you will find a directory pydis8. I suggest you put pydis8.tar in your public_html directory and do a:
tar xvf pydis8.tar
In pydis8 , you will find two python scripts. These scripts (and the venerable scripts at the Oklahoma Weather Roundup) call the program weather, which is available on Gentry. weather grabs text from standard NWS files. The essential command is:
/usr/local/bin/weather -c foredis stid l
where stid is either oun, ama, fwd, etc.. The above command also works from the Gentry command line. The l stands for lastest, and the weather program on Gentry
is basically grabbing the latest text for stid from the files in /data/weather/FOREDISS.
For development purposes, the scripts can skip the system call to weather and use the data in the bundled directory demo_data. Thus you can experiment with the scripts even if you are not using Gentry. In fact, even if you are using the scripts on Gentry, you are asked to initially use the demo data for the completion of the task. If you want to do all the development on your local Linux PC, rather than Gentry, you may need this dictionary: american-english.
This will be helpful: abbreviations and acronyms.
The simple script pydis.cgi, which simply passed on the text output from weather:
pydis.cgi?ounX Norman demo data
pydis.cgi?amaX Amarillo demo data
pydis.cgi?fwdX Fort Worth demo data
pydis.cgi?oun Norman current data
pydis.cgi?ama Amarillo current data
pydis.cgi?fwd Fort Worth current data
The unfinished pydis8.cgi, as you receive it in pydis8.tar. Check out the cool "mouse over" on the underlined abbreviations:
pydis8.cgi?ounX Norman demo data
pydis8.cgi?amaX Amarillo demo data
pydis8.cgi?fwdX Fort Worth demo data
pydis8.cgi?oun Norman current data
pydis8.cgi?ama Amarillo current data
pydis8.cgi?fwd Fort Worth current data
My completed pydis8.cgi (which your completed script should emulate):
pydis8Z.cgi?ounX Norman demo data
pydis8Z.cgi?amaX Amarillo demo data
pydis8Z.cgi?fwdX Fort Worth demo data
pydis8Z.cgi?oun Norman current data
pydis8Z.cgi?ama Amarillo current data
pydis8Z.cgi?fwd Fort Worth current data