home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / sgi / 13667 < prev    next >
Encoding:
Internet Message Format  |  1992-09-15  |  5.9 KB

  1. Path: sparky!uunet!haven.umd.edu!mimsy!lhc!adm!news
  2. From: fred@poly2.nist.gov (Frederick R. Phelan Jr.)
  3. Newsgroups: comp.sys.sgi
  4. Subject: Re: Euroweather data
  5. Message-ID: <32586@adm.brl.mil>
  6. Date: 15 Sep 92 20:15:36 GMT
  7. Sender: news@adm.brl.mil
  8. Lines: 279
  9.  
  10.  
  11.  
  12. Patrick HURT <thsspxh@iitmax.iit.edu> writes:
  13. |
  14. |In article <1992Sep11.114718.26874@ringer.cs.utsa.edu> senseman@ricky.brainlab.utsa.edu (David M. Senseman) writes:
  15. |>In article <18n71qINNi9g@darkstar.UCSC.EDU> mmcohen@cats.ucsc.edu (Michael M Cohen) writes:
  16. |>>
  17. |>>Someone was asking about European weather maps
  18. |>>for bgpaste? ... Should work with a bit of editing
  19. |>>for the weather shell recently posted.
  20. |>>
  21. |>
  22. |>The original post in this thread (which I missed somehow) mentioned
  23. |>something about getting US weather maps but not European. Could someone
  24. |>E-Mail me the site for getting US Weather maps? Thanks.
  25. |>-- 
  26. |
  27. |Me too, please! Also, if anybody has a script getting the weather
  28. |by ftp, and popping it up on the screen, please mail it to me.
  29. |
  30.  
  31. Here's a revised version of the script I originally posted ...
  32. the usage is:
  33.  
  34.     weather [options]
  35.  
  36. where options are
  37.  
  38. -usa : Paints root window to current weather map of USA
  39.  
  40. -europe : Uses current map of europe 
  41.      [Note that this site queries for a password, just
  42.       hitting return should be ok]
  43.  
  44. -query : Does a dir on the current USA weather map file
  45.      [I put this in because sometimes it doesn't get updated  
  46.       until about noon and the night versions are too dark.]
  47.  
  48. -getUSA : Downloads and stores current USA map in /usr/tmp/UsaWeatherMapFile.GIF
  49.  
  50. -paintUSA : Pastes /usr/tmp/UsaWeatherMapFile.GIF to root window
  51.  
  52.  
  53. Thanks to mmcohen@cats.ucsc.edu for posting the European site for data.
  54.  
  55. Cheers,
  56. Fred Phelan
  57.  
  58. --- weather ----
  59. #!/bin/csh -f
  60. # weathermap
  61. # Sets the background to the latest weather map.
  62. #
  63. # Original:
  64. # Ron Boisvert, NIST, 25 Jun 92
  65. #
  66. # Modified for SGI:
  67. # F.R. Phelan Jr.
  68. # NIST Polymers Division
  69. # September 11, 1992
  70. #
  71.  
  72. #
  73. #Background info on weather map sites:
  74. #
  75. #nslookup vmd.cso.uiuc.edu
  76. #Non-authoritative answer:
  77. #Name:    VMD.CSO.UIUC.EDU
  78. #Addresses:  128.174.5.98, 192.17.13.1
  79. #
  80. #nslookup cumulus.met.ed.ac.uk
  81. #Non-authoritative answer:
  82. #Name:    cumulus.met.ed.ac.uk
  83. #Address:  129.215.168.19
  84. #
  85.  
  86. #
  87. #Default settings ...
  88. #
  89. set NameOfThisScript = weather
  90.  
  91. set infile = /usr/tmp/weather.$$.ftp
  92. set gif_file = /usr/tmp/weather.$$.GIF
  93. set rgb_file1 = /usr/tmp/weather.$$.rgb.1
  94. set rgb_file2 = /usr/tmp/weather.$$.rgb.2
  95. set USAWeatherFile = /usr/tmp/UsaWeatherMapFile.GIF
  96.  
  97. set USA_Address = '128.174.5.98'
  98. set EUR_Address = '129.215.168.19'
  99.  
  100. set ImageDir = wx
  101. set ImageFil = 'CVIS.GIF'
  102. set Xzoom = '1.06'
  103. set Yzoom = '1.7'
  104. set FTPAddress = $USA_Address
  105.  
  106. #
  107. # Usage.
  108. #
  109. if ($#argv == 0) then
  110.   echo 
  111.   echo $NameOfThisScript":"
  112.   echo "A script to paint the root background to the current weather map."
  113.   echo 
  114.   echo "Usage: $NameOfThisScript [options]"
  115.   echo
  116.   echo "-usa : Uses current map of USA"
  117.   echo
  118.   echo "-europe : Uses current map of europe "
  119.   echo
  120.   echo "-query : Does a dir on the current USA weather map file"
  121.   echo
  122.   echo "-getUSA : Downloads and stores current USA map in $USAWeatherFile"
  123.   echo
  124.   echo "-paintUSA : Pastes $USAWeatherFile to root window"
  125.   echo
  126.   echo "any other character : same as -usa option"
  127.   echo
  128.   exit 1
  129. endif
  130.  
  131. onintr cleanup
  132.  
  133. #
  134. # Extract parameters from command line
  135. #
  136. set I=1
  137. while ($I <=  $#argv)
  138.  
  139.    if ("$argv[$I]" == '-usa') then
  140.       goto USA_Label
  141.    else if ("$argv[$I]" == '-europe') then
  142.       set ImageDir = 'images/gifs'
  143.       set ImageFil = 'eur.vis.gif'
  144.       set Xzoom = '2.048'
  145.       set Yzoom = '3.271'
  146.       set FTPAddress = $EUR_Address
  147.       goto EUROPE_Label
  148.    else if ("$argv[$I]" == '-query') then
  149.       goto QUERY_USA_Label
  150.    else if ("$argv[$I]" == '-getUSA') then
  151.       goto GET_USA_Label
  152.    else if ("$argv[$I]" == '-paintUSA') then
  153.       goto PAINT_USA_Label
  154.    else
  155.       goto USA_Label
  156.    endif
  157.  
  158.  @ I = $I + 1
  159. end
  160.  
  161. #
  162. # USA
  163. #
  164. USA_Label:
  165. echo USA: 
  166. cat > $infile << END
  167. user anonymous
  168. cd $ImageDir
  169. binary
  170. get $ImageFil $gif_file
  171. bye
  172. END
  173. echo .......... Trying $FTPAddress for $ImageFil
  174. ftp -n $FTPAddress < $infile
  175. echo .......... Converting $ImageFil to rgb format
  176. fromgif $gif_file $rgb_file1
  177. echo .......... Zooming $rgb_file1 to $rgb_file2
  178. izoom $rgb_file1 $rgb_file2 $Xzoom $Yzoom
  179. echo .......... Painting Root Window
  180. bgpaste -t 0 0 0 $rgb_file2
  181. sleep 15
  182. goto cleanup
  183.  
  184.  
  185. #
  186. # Query USA map.
  187. #
  188. QUERY_USA_Label:
  189. echo QUERY_USA: 
  190. cat > $infile << END
  191. user anonymous
  192. cd $ImageDir
  193. dir $ImageFil
  194. bye
  195. END
  196. echo
  197. echo .......... Doing a dir on $ImageFil
  198. echo
  199. ftp -n $FTPAddress < $infile
  200. goto cleanup
  201.  
  202.  
  203. #
  204. # Get USA map.
  205. #
  206. GET_USA_Label:
  207. echo GET_USA: 
  208. cat > $infile << END
  209. user anonymous
  210. cd $ImageDir
  211. binary
  212. get $ImageFil $gif_file
  213. bye
  214. END
  215. ftp -n $FTPAddress < $infile
  216. cp $gif_file $USAWeatherFile
  217. echo
  218. echo .......... Downloaded $ImageFil as $USAWeatherFile
  219. echo
  220. goto cleanup
  221.  
  222.  
  223. #
  224. # Paste USA map.
  225. #
  226. PAINT_USA_Label:
  227. echo PAINT_USA: 
  228. if ( -f $USAWeatherFile ) then
  229.   fromgif $USAWeatherFile $rgb_file1
  230.   izoom $rgb_file1 $rgb_file2 $Xzoom $Yzoom
  231.   echo .......... Painting Root Window
  232.   bgpaste -t 0 0 0 $rgb_file2
  233.   sleep 15
  234.   goto cleanup
  235. else
  236.   echo
  237.   echo .......... $USAWeatherFile not found
  238.   echo
  239.   exit
  240. endif
  241.  
  242. #
  243. # EUROPE
  244. #
  245. echo EUROPE:
  246. EUROPE_Label:
  247. cat > $infile << END
  248. user anonymous
  249. login $USER@$HOST
  250. cd $ImageDir
  251. binary
  252. get $ImageFil $gif_file
  253. bye
  254. END
  255. echo .......... Trying $FTPAddress for $ImageFil
  256. ftp -n $FTPAddress < $infile
  257. echo .......... Converting $ImageFil to rgb format
  258. fromgif $gif_file $rgb_file1
  259. echo .......... Zooming $rgb_file1 to $rgb_file2
  260. izoom $rgb_file1 $rgb_file2 $Xzoom $Yzoom
  261. echo .......... Painting Root Window
  262. bgpaste -t 0 0 0 $rgb_file2
  263. sleep 15
  264. goto cleanup
  265.  
  266.  
  267. cleanup:
  268.  
  269.  
  270.     if ( -f $infile ) then
  271.         rm -f $infile
  272.     endif
  273.  
  274.     if ( -f $gif_file ) then
  275.         rm -f $gif_file
  276.         echo .......... Cleaning up
  277.     endif
  278.  
  279.     if ( -f $rgb_file1 ) then
  280.         rm -f $rgb_file1
  281.     endif
  282.  
  283.     if ( -f $rgb_file2 ) then
  284.         rm -f $rgb_file2
  285.         echo 
  286.         echo .......... So how is the weather'?'
  287.         echo 
  288.     endif
  289.