Plan 9 from Bell Labs’s /usr/web/sources/contrib/quanstro/root/lib/radar/genlat

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc
# genlat > stationlat

fn lat {
	desc=`{hget http://radar.weather.gov/ridge/RadarImg/N0R/$1^_N0R_0.gfw|tr -d '
'}
#	xy=`{hget http://radar.weather.gov/ridge/RadarImg/N0R/$1^_N0R_0.gif|gif -9t|6.imgsize}
	xy=(600 550)

	pixsz = ($desc(1) $desc(4))
	origin = ($desc(5) $desc(6))

	echo -n $1^'	'
	{
		echo 'x=' $origin(1) + $pixsz(1) '*' $xy(1) / 2
		echo 'y=' $origin(2) + $pixsz(2) '*' $xy(2) / 2
		echo print y, x, "\n"
	} | hoc
}

if(! ~ $#* 0){
	for(i in *)
		lat $i
}
if not
	for(i in `{</lib/radar/stations awk '{print $1}'})
		lat $i

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].