;getdata_wc reads data for Willow Creek. ;Use is as follows: ; getdata_wc,file,comp,u,v,w,t,cv,qv,tl,pl ;Where ;input | file = character string containing the filename to be read ; (ie yydddhhmm) ; comp = a flag denoting if input data is compressed or not ; ; | u, v, w 1-D arrays of wind (m/s) ; | t sonic virtual temperature (ATI - top) (degrees C) ; | cv licor co2 signal (mvolts) ;output| qv licor h2o signal (mvolts) ; | tl licor sample air-flow temperature (degrees C) ; | (tl is used for voltage to ppm conversion) ; | pl licor sample air-flow pressure (kPa) ; ;Written by DCarrington 1999 ;Modified by BWBerger 11/12/99 to make loading occur faster. ;Modified by BWBerger 1/28/00 to allow code to read compressed data ;files (new capability for idl 5.3). This is done with the comp variable. ;Modified by BWBerger 2/14/00 to fix data format change on 991311900 ; Modified by W wang for Lost Creek, Sep 20 2000 pro getdata_lc,file,comp,u,v,w,t,cv,qv,tl,pl badval=-999. filename = '' file = strtrim((file),2) yyddd = strtrim(strmid(file,0,5),2) yyyy = strtrim(strmid(file,0,2),2) ddd = strtrim(strmid(file,2,3),2) hhmm = strtrim(strmid(file,5,4),2) if (yyyy gt 95) then yyyy = '19' + yyyy if (yyyy le 95) then yyyy = '20' + yyyy ;get some float values of year,jday,hhmm for checking (thus ck) format later ckyear=float(yyyy) ckjday=float(ddd) ckhhmm=float(hhmm) filename = !DATA + yyddd + '/' filename = filename + file ;***************************************** ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ;Code used to have just the line below ;loadwcreek,filename,sarray ; ;Now code uses new loading routine that should load data quicker. ;The loadwcreek2 assumes data files are 14 columns and returns arrays ;with 18000 rows. If a data file is short, the remaining rows are ;-999. If the the data file is less than 18600 rows, the file is ;truncated. If the data file has more than 18600 rows, the data is tossed. ;print,comp loadwcreek2,yyyy,filename,comp,sarray,err ;***************************************** ; the temperature values (tl) are changed from celcius to kelvin ; No -999. markers should be in the data at this point (-99999 and ; -6999 are used in the tower data acquisition system, not badval = -999.). id = sarray(0,*) year = sarray(1,*) jday = sarray(2,*) hhmm = sarray(3,*) sec = sarray(4,*) u = sarray(5,*) v = sarray(6,*) w = sarray(7,*) t = sarray(8,*) diag = sarray(9,*) g = where((diag eq -99999.) or (diag ge 4096.), n) if (n gt 0) then begin u(g) = badval v(g) = badval w(g) = badval t(g) = badval endif cv = sarray(10,*) qv = sarray(11,*) tl = sarray(12,*) pl = sarray(13,*) ; convert pressure to mb h = where (pl ne badval, n) if (n gt 0) then pl(h) = pl(h) * 10 ; convert temperature to Kelvin h = where (tl ne badval, n) if (n gt 0) then tl(h) = tl(h) + 273.15 return end