;***getcalmat_wc.pro obtains the calibration vector for use in combineddayflux ;***Use is as follows: ;*** getcalmat_wc,yyyy,mo,dy,calmat ;Where ;***input yyyy - the year (4-digit integer) ;*** mo - the month ;*** dy - the day ;*** config - the configuration number ;*** ;***output calmat - calibration vector ; [mq,bq,mc,bc] ;*** if no value, use default value (which got in Aug 21) ; modified by weiguo wang 11/3/99 ; Modified by BWBerger 1/28/00 to use loadpdq.pro instead of load.pro ; Modified by BWB 2/23/00 to get tables from !AUXDATA_WC+'cal/tables/... ; (!AUXDATA_WC='/data/davis/cheas/wcreek/data/') ; instead of /data/davis2/wcreek/data/cal/tables/... ; changed for lcreek, changing the default value if all are -999 pro getcalmat_lc,yyyy,mo,dy,calmat ;Get strings and integers related to the year and mo chosen yrls=strtrim(string(yyyy),2) ;string version of the 4-digit year (long) yrss=strmid(yrls,2,2) ;string version of the 2-digit year (short) if mo lt 10 then begin ;mo is an integer mos='0'+strtrim(string(mo),2) ;mos is a string of the month endif else begin mos=strtrim(string(mo),2) endelse ;get the julian day julian,yyyy,mo,dy,jdate ;y2k ok ;***initialize calibration matrix calmat=fltarr(1,4)-999. ;Load the data and place it into calmat based on date cmd="loadpdq,'"+!AUXDATA_WC+"cal/tables/"+yrls+"/mandb"+yrls+"_q.dat',mandbq" r=execute(cmd) for i=0,row(mandbq)-1 do begin if mandbq(0,i) eq jdate then begin calmat(0,0)=mandbq(1,i) ;setting mq calmat(0,1)=mandbq(2,i) ;setting bq endif endfor cmd="loadpdq,'"+!AUXDATA_WC+"cal/tables/"+yrls+"/mandb"+yrls+"_c.dat',mandbc" r=execute(cmd) for i=0,row(mandbc)-1 do begin if mandbc(0,i) eq jdate then begin calmat(0,2)=mandbc(1,i) ;setting mc calmat(0,3)=mandbc(2,i) ;setting bc endif endfor ; set a default value of calmat ; calmat=[[.009986],$ ;mq ; [-0.23577],$ ;bq ; [.219386],$ ;mc ; [-100.18723]] ;bc if(calmat(0,0) eq -999.) then calmat(0,0)=.0072 if(calmat(0,1) eq -999.) then calmat(0,1)=-9.6 if(calmat(0,2) eq -999.) then calmat(0,2)=.22 if(calmat(0,3) eq -999.) then calmat(0,3)=-200 return end