;Write new MWR files from Brad's reprocessing. ; this script is specific to the NSA dataset but can be used as a model for other datasets. ; must restore, 'brads_newshebamwr.dat' base_date=julday(1,1,1970,0,0,0) base=jul_to_dt(base_date) !dt_base=base file=findfile('*losorrC1.b1.2000*.cdf',count=numf) done=0 for i=0,numf-1 do begin fid=ncdf_open(file[i],/write) ncdf_varget,fid,ncdf_varid(fid,'base_time'),bt ncdf_varget,fid,ncdf_varid(fid,'time_offset'),to ncdf_varget,fid,ncdf_varid(fid,'liq'),lq starttime=sec_to_dt(bt) jd=float(floor(starttime.julian-julday(1,1,starttime.year,0,0,0)+1)) jt=jd+(starttime.hour+starttime.minute/60.+(starttime.second+float(to))/3600.)/24. ; if jd lt 280 then jd=jd+365 iwh=where(jtime ge jt[0] and jtime le jt[n_elements(jt)-1],num) ; if jd eq 305 then begin ;Specific to the SHEBA data set ; if done eq 0 then begin ; iwh=iwh[0:178] ; num=179 ; done=1 ; endif else begin ; iwh=iwh[179:*] ; num=n_elements(iwh) ; endelse ; endif if num ne n_elements(lq) then print,'Wrong # of elements for ',jd lid=ncdf_varid(fid,'liq') vid=ncdf_varid(fid,'vap') ncdf_varput,fid,vid,newvap[iwh] ncdf_varput,fid,lid,newliq[iwh] ncdf_control,fid,/redef mi=month[iwh[0]]-1 ncdf_attput,fid,/global,'vapor_retrieval_coefficient_0',strtrim(coefs[mi,0],2) ncdf_attput,fid,/global,'vapor_retrieval_coefficient_1',strtrim(coefs[mi,1],2) ncdf_attput,fid,/global,'vapor_retrieval_coefficient_2',strtrim(coefs[mi,2],2) ncdf_attput,fid,/global,'liquid_retrieval_coefficient_0',strtrim(coefs[mi,3],2) ncdf_attput,fid,/global,'liquid_retrieval_coefficient_1',strtrim(coefs[mi,4],2) ncdf_attput,fid,/global,'liquid_retrieval_coefficient_2',strtrim(coefs[mi,5],2) ncdf_attput,fid,/global,'mean_atmos_radiating_temp_23',strtrim(tmr23[mi],2) ncdf_attput,fid,/global,'mean_atmos_radiating_temp_31',strtrim(tmr31[mi],2) ncdf_attput,fid,/global,'NOAA_reprocessing','Liq and vap data were reprocessed by Brad Orr at NOAA/ETL' ncdf_attput,fid,/global,'NOAA_reprocessing_technique','Statistical technique based on climatological Barrow soundings, the cloud liquid dielectric model of Liebe91, and the clear-air absorption model of Rosenkranz98' ncdf_attput,fid,/global,'NOAA_reprocessing_coefficents','Coefficients outlined in the global variables are the ones used during the NOAA reprocessing' ncdf_attput,fid,/global,'NOAA_reprocessing_time','The reprocessing at NOAA occured on February 28, 2001.' ncdf_close,fid endfor end