;*********************************************************** ; IDL program get_nscat_orbit_v02 ;********************************************************** ; ; This IDL code requires the data file name as input ; Level 2B data for the entire orbit are returned ; The returned data are: ; ; atime: a 21 character string same as in the L25 JPL HDF files ; ; lat: geodetic latitude ; lon: east longitude (0-360) ; ; iclass: indicator of expected quality of the vector retrieval ; iclass =0 denotes no retrieval was done (either no observations or only one flavor of observation) ; iclass =1 denotes 2 flavors of observations in wind vector cell ; iclass =2 denotes 3 flavors of observations in wind vector cell ; iclass =3 denotes 4 flavors of observations in wind vector cell ; We suggest using just cases for which (iclass ge 2) ; ; numamb: the number of ambiguites (0 to 4) ; selamb: the selected ambiguity (0 to 4) ; rflag_scat: the rain flag derived from the scatterometer measurements ; rflag_scat=1 indicates rain ; ; wind_all: wind speed for the various ambiguities ; dir_all: wind direction for the various ambiguties (oceanographic convention) ; sos_all: the normalized rms after-the-fit residual of the observation minus model sigma-nought ; Large SOSAL values indicate the observations did not fit the geophysical model function. ; We suggest discarding observations for which sos_all of the selected ambiguity is GT 1.9. ; ; wind_smooth: the smoothed version of the selected wind ambiguity ; dir_smooth: the smoothed version of the selected direction ambiguity ; ; wind_gcm: general circulation model wind speed used for nudging (either NCEP or ECMWF) ; dir_gcm: general circulation model wind direction used for nudging (either NCEP or ECMWF) ; ; All wind speeds have 0.01 m/s resolution and a range of [0 - 70.00] m/s ; All wind directions have 1.5 degree resolution ; ; rad_rain: TMI or SSMI columar rain rate (rain rate times rain column height, km mm/hour) ; rad_rain =-999 no TMI or SSMI rain avaliable ; rad_rain = 0 no rain ; rad_rain = 0.1 possible rain ; rad_rain = 0.2 through 25.4 definite rain and the give value is the columnar rain rate ; ; "no rain" means no rain was detected within +- 50 km and MIN_DIFF. ; "possible rain" means some rain was detected within +- 50 km and MIN_DIFF. ; "definite rain" means rain was detected within +- 25 km and MIN_DIFF. ; We suggest discarding observations for which rad_rain is greater than 0.15 ; ; min_diff: time in minutes between the scatterometer and the collocated radiometer ; RSS, June 12, 2000: reads RSS bmap winvec L25 NSCAT files v01 D.Smith ; change history: ; August 9, 2000: Added BUF11 to read the collocation time with radiometer observations ; Adjusted all wind speed variables to use two bytes of data. ; July 30, 2004: Changed name of routine to make uniform with other scat software D. Smith pro get_nscat_orbit_data,fname,$ atime,$ phi_track,$ lat,$ lon,$ iclass,$ numamb,$ selamb,$ rflag_scat,$ wind_all,$ dir_all,$ sos_all,$ wind,$ dir,$ wind_smooth,$ dir_smooth,$ wind_gcm,$ dir_gcm,$ rad_rain,$ min_diff ; binary variables BUF00 = bytarr(21,1624) BUF0 = bytarr(1624) BUF1 = bytarr(2,48,1624) BUF2 = bytarr(2,48,1624) BUF3 = bytarr(48,1624) BUF4 = bytarr(48,1624) BUF5 = bytarr(2,4,48,1624) BUF6 = bytarr(4,48,1624) BUF5S = bytarr(2,48,1624) BUF6S = bytarr(48,1624) BUF7 = bytarr(4,48,1624) BUF8 = bytarr(2,48,1624) BUF9 = bytarr(48,1624) BUF10 = bytarr(48,1624) BUF11 = bytarr(48,1624) ; returned data atime = strarr(1624) phi_track = fltarr(1624) lat = fltarr(48,1624) lon = fltarr(48,1624) iclass = intarr(48,1624) numamb = intarr(48,1624) selamb = intarr(48,1624) rflag_scat = intarr(48,1624) wind_all = fltarr(4,48,1624) dir_all = fltarr(4,48,1624) sos_all = fltarr(4,48,1624) wind = fltarr(48,1624) dir = fltarr(48,1624) wind_smooth = fltarr(48,1624) dir_smooth = fltarr(48,1624) wind_gcm = fltarr(48,1624) dir_gcm = fltarr(48,1624) rad_rain = fltarr(48,1624) min_diff = intarr(48,1624) ambexists =intarr(4,48,1624) ; open file requested and read binary data openr,2,fname,/binary readu,2,BUF00,BUF0,BUF1,BUF2,BUF3,BUF4,BUF5s,BUF6s,BUF5,BUF6,BUF7,BUF8,BUF9,BUF10,BUF11 close,2 atime=string(BUF00[0:20,*]) ; lat = reform(.01*((BUF1(0,*,*)*256 + BUF1(1,*,*))-9000)) lon = reform(.01* (long(BUF2(0,*,*))*256 + long(BUF2(1,*,*)))) phi_track = float(BUF0)+180.5 bad=where((BUF0 eq 255B),ct) if(ct gt 0) then phi_track[bad]=-999.0 iclass = fix(BUF3)/64 selamb = (fix(BUF3)-64*iclass)/8 numamb = (fix(BUF3)-64*iclass)-8*selamb rflag_scat = fix(BUF4)/64 wind_all = reform(.01* (long(BUF5(0,*,*,*))*256 + long(BUF5(1,*,*,*)))) dir_all = float(BUF6)*1.5 sos_all = float(BUF7)*0.02 wind_smooth = reform(.01* (long(BUF5s(0,*,*))*256 + long(BUF5s(1,*,*)))) dir_smooth = float(BUF6S)*1.5 wind_gcm = reform(.01* (long(BUF8(0,*,*))*256 + long(BUF8(1,*,*)))) dir_gcm = float(BUF9)*1.5 rad_rain = float(BUF10)*0.1 bad = where ((BUF10 eq 255B),ct) if(ct gt 0) then rad_rain[bad]= -999.0 min_diff = fix(BUF11) exists=where((numamb gt 0) and (iclass ne 0),ct) if(ct gt 0) then begin temp=reform(ambexists[0,*,*]) temp[exists]=1 ambexists[0,*,*]=temp endif exists=where((numamb gt 1) and (iclass ne 0),ct) if(ct gt 0) then begin temp=reform(ambexists[1,*,*]) temp[exists]=1 ambexists[1,*,*]=temp endif exists=where((numamb gt 2) and (iclass ne 0),ct) if(ct gt 0) then begin temp=reform(ambexists[2,*,*]) temp[exists]=1 ambexists[2,*,*]=temp endif exists=where((numamb gt 3) and (iclass ne 0),ct) if(ct gt 0) then begin temp=reform(ambexists[3,*,*]) temp[exists]=1 ambexists[3,*,*]=temp endif bad=where(ambexists eq 0,ct) if(ct gt 0) then begin wind_all[bad] = !values.f_nan dir_all [bad] = !values.f_nan sos_all [bad] = !values.f_nan endif ok=where(selamb eq 1,ct) if(ct gt 0) then begin wind[ok]= (wind_all[0,*,*])[ok] dir [ok]= (dir_all [0,*,*])[ok] endif ok=where(selamb eq 2,ct) if(ct gt 0) then begin wind[ok]= (wind_all[1,*,*])[ok] dir [ok]= (dir_all [1,*,*])[ok] endif ok=where(selamb eq 3,ct) if(ct gt 0) then begin wind[ok]= (wind_all[2,*,*])[ok] dir [ok]= (dir_all [2,*,*])[ok] endif ok=where(selamb eq 4,ct) if(ct gt 0) then begin wind[ok]= (wind_all[3,*,*])[ok] dir [ok]= (dir_all [3,*,*])[ok] endif bad = where((iclass eq 0) or (numamb eq 0),ct) if ct gt 0 then begin lat[bad] = !values.f_nan lon[bad] = !values.f_nan wind_smooth[bad] = !values.f_nan dir_smooth [bad] = !values.f_nan wind_gcm[bad] = !values.f_nan dir_gcm[bad] = !values.f_nan wind[bad] = !values.f_nan dir[bad] = !values.f_nan endif return end