function wsr88d_get_site_info, siteid ; Get site info. on_error, 2 ; on error, return to caller. ; If siteid is 4 characters long, it is assumed to be a valid siteid. ; If siteid is longer than 4 characters, assume it is a filename that contains ; the siteid embedded within its name. fromfilename = 0 if strlen(siteid) gt 4 then begin fromfilename = 1 uppercasename = strupcase(siteid) ; for matching later endif locations = wsr88d_locations() ; search for matching site id. sitenum = 0L site = '' city = '' state='' latd=0 & latm=0 & lats=0 & lond=0 & lonm=0 & lons=0 & height=0L found = 0 i = 0 while not found and i lt n_elements(locations) do begin location_rec = locations[i] reads, location_rec, sitenum, site, f='(i5,1x,a4)' found = site eq siteid if fromfilename then if strpos(uppercasename,site) gt -1 then found = 1 i = i + 1 endwhile if not found then message, 'Site id '+ siteid +' not found' reads, location_rec, city, f='(11x,a21)' city = strtrim(city) reads, location_rec, state, f='(32x,a2)' location_rec = strmid(location_rec, 34) reads, location_rec, latd, latm, lats, lond, lonm, lons, height siteinfo={sitenum:sitenum, siteid:site, city:city, state:state, latd:latd,$ latm:latm, lats:lats, lond:lond, lonm:lonm, lons:lons, height:height} return, siteinfo end