;*********************************************************** ; IDL program get_scat_orbit_v04 ;********************************************************** ; ; This IDL code requires the data file name as input ; ; RSS Level 2B data for the entire orbit are returned ; The returned data are: ; ; atime: a 21 character string, format= YYYY-DDDTHH:MM:SS.sss, same as in the JPL HDF files ; ; phi_track the direction of the subtrack velocity vector relative to north ; 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). However, this will omit all out swath data ; ; numamb: the number of ambiguites (0 to 4) ; selamb: the selected ambiguity (0 to 4) ; ; irain_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 SOSAL.GT.1.9. ; ; wind_smooth: the smoothed version of the selected wind ambiguity, wind_all(selamb) ; dir_smooth: the smoothed version of the selected direction ambiguity, dir_all(selamb) ; ; 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 a range of [0 - 70.0] m/s and a 0.01 m/s resolution ; 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 given value is the columnar rain rate (km*mm/hr) ; ; "no rain" means no rain was detected within +/- 50 km and +/- time given in min_diff. ; "possible rain" means some rain was detected within +/- 50 km and +/- time given in min_diff. ; "definite rain" means rain was detected within +/- 25 km and +/- time given in min_diff. ; We suggest discarding observations for which RAD_RAIN.GT.0.15. ; ; min_diff time difference in minutes between the scatterometer and the radiometer. A value of 255 ; means no collocation was found. ; ; nudge_ncep NCEP data field is used(0)/not used(1) in nudging scat data in near real-time mode. ; nudge_ecmwf ECMWF data field is used(0)/not used(1) in nudging scat data only during reprocessing as ; it is not timely enough (3-4 day delay) for real time processing. ; ; ; RSS, July 23, 2004: reads RSS SeaWinds v03 and QuikSCAT v03a files D.Smith ; RSS, Jan 1, 2007: added comments D.Smith ; RSS, May 2, 2011: changed to V04, made small change to file D.Smith ; RSS, Feb 14, 2014: fixed error that had no consequence on data output D.Smith pro get_scat_orbit_v04,fname,$ atime,$ phi_track,$ lat,$ lon,$ iclass,$ numamb,$ selamb,$ irain_scat,$ wind_all,$ dir_all,$ sos_all,$ wind,$ dir,$ wind_smooth,$ dir_smooth,$ wind_gcm,$ dir_gcm,$ rad_rain,$ min_diff,$ nudge_ncep,$ nudge_ecmwf ; binary variables BUF00 = bytarr(21,1624) BUF0 = bytarr(1624) BUF1 = bytarr(2,76,1624) BUF2 = bytarr(2,76,1624) BUF3 = bytarr(76,1624) BUF4 = bytarr(76,1624) BUF5 = bytarr(2,4,76,1624) BUF6 = bytarr(4,76,1624) BUF5S = bytarr(2,76,1624) BUF6S = bytarr(76,1624) BUF7 = bytarr(4,76,1624) BUF8 = bytarr(2,76,1624) BUF9 = bytarr(76,1624) BUF10 = bytarr(76,1624) BUF11 = bytarr(76,1624) ; returned data atime = strarr(1624) phi_track = fltarr(1624) lat = fltarr(76,1624) lon = fltarr(76,1624) iclass = intarr(76,1624) numamb = intarr(76,1624) selamb = intarr(76,1624) irain_scat = intarr(76,1624) wind_all = fltarr(4,76,1624) dir_all = fltarr(4,76,1624) sos_all = fltarr(4,76,1624) wind = fltarr(76,1624) dir = fltarr(76,1624) wind_smooth = fltarr(76,1624) dir_smooth = fltarr(76,1624) wind_gcm = fltarr(76,1624) dir_gcm = fltarr(76,1624) rad_rain = fltarr(76,1624) min_diff = intarr(76,1624) nudge_ncep = 99B nudge_ecmwf = 99B ambexists =intarr(4,76,1624) ; open file requested and read binary data openr,2,fname,/binary,/compress readu,2,BUF00,BUF0,BUF1,BUF2,BUF3,BUF4,BUF5s,BUF6s,BUF5,BUF6,BUF7,BUF8,BUF9,BUF10,BUF11,nudge_ncep,nudge_ecmwf 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 irain_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