function sofie_get_summary,pat,iver ;------------------------------------------------------------------------------------------------ ; Read, combine, & return SOFIE summary files (summary version "S3"), for many SOFIE PMC seasons ; File name example: sofie_summary_s3_V1.2_SH_2008-09.nc, sofie_summary_s3_V1.1_test_SH_2007-08.nc, ... ; ; This version returns a structure instead of the long list of variables. ; ; Input: ; pat........path for the directory where the files are, string, e.g., '/users/mhervig/sofie/data/summary/V1.2/' ; routine will get all the "iver" files in pat ; iver.......SOFIE data version, string, e.g., 'V1.2' ; ; Output (all in the structure known as "s"): ; ; Scalar header info: ; ; version.....SOFIE data product version, string ; hemisphere..hemisphere (NH = north, SH = south) ; season......e.g. 2007 or 2007-2008 ; nevent......number of events in this file ; nz..........number of altitude points in profiles ; missing.....missing data value ; remarks.....comments on lots of things, like noise values, assumed smoke composition.... ; "print,remarks" to check this out ; ; Houskeeping, arr(event): ; orbit.....AIM orbit number ; event.....SOFIE event number ; mode......occultation mode, 0 = sunrise, 1 = sunset ; date......date as yyyyddd ; time......time at 83 km tangent point, UT, hh.hh ; lat.......latitude (deg, -90 to 90), @ 83 km tangent point ; lon.......longitude (deg E, 0 to 360), @ 83 km tangent point ; lst.......local solar time (decimal hours) ; doy.......day of year (decimal day) ; dfs.......days from summer solstice (decimal day, e.g., -20.45) ; los_head..line-of-sight heading, 83 km tangent point to Sun (degrees) ; ; State variables: ; z.........altitude vector (km), common for all profiles, arr(nz) ; p.........pressure (hPa), arr(nz,nevent) ; t.........temperature (K), arr(nz,nevent) ; h2o.......water vapor mixing ratio (ppmv), arr(nz,nevent) ; o3........ozone mixing ratio (ppmv), arr(nz,nevent) ; ch4.......methane mixing ratio (ppmb), arr(nz,nevent) ; zmes......mesopause altitude (km), arr(event) ; pmes......mesopause pressure (mb), arr(event) ; tmes......mesopause temperature (K), arr(event) ; ; Ice layer info [e.g., Hervig et al., 2009]: ; ; ztop......ice layer top altitude (km), brightest layer, 0 if no ice present, arr(event) ; zmax......altitude of peak 3.064 micron ice extinction (km), brightest layer, 0 if no ice present, arr(event) ; zbot......ice layer bottom altitude (km), brightest layer, 0 if no ice present, arr(event) ; zbot2.....ice layer bottom altitude (km), brightest layer, defined where h2o_ice < 0.1 ppmv below Zmax, arr(event) ; ; ice_pres..1 = ice present somewhere in profile, 0 = no ice present, arr(event) ; nlay_al...total # of ice layers found, arr(event) ; ztop_al...ice layer top altitude (km), all layers, fltarr( max # layers, event) ; zmax_al...altitude of peak 3.064 micron ice extinction (km), all layers, fltarr( max # layers, event) ; zbot_al...ice layer bottom altitude (km), brightest layer, all layers, fltarr( max # layers, event) ; ; PMC properties: ; ; vice......ice volume density (um3/cm3), arr(z,event) [Hervig et al., 2009] ; mice......ice mass density (g/km3), arr(z,event) " ; h2oi......gas phase equivalent ice (ppmv), arr(z,event) " ; ; aro......axial ratio of oblate spheroid, arr(z,event) [Hervig et al., 2009] ; arp......axial ratio of prolate spheroid, arr(z,event) [Hervig et al., 2009] ; ; iceT......ice temperature (K), arr(z,event) [Hervig and Gordley, 2010] ; aroi......axial ratio of oblate spheroid, retrieved simultaneously w/ iceT, arr(z,event) ; ; Gaussian parameters & re from band9 & chan2, uses new chan2 formulation dV = B(0.867) - B(1.037), ; assumes AR=2, and dr = f(rm) (dr = ~0.4*rm for rm < ~40 nm, and dr = ~16 nm for rm > ~16 nm ; from Baumgarten et al, 2010, exact same function as used by CIPS): ; ; con......concentration (#/cm3), arr(z,event) ; rm.......median radius (nm), arr(z,event) ; dr.......width (nm), arr(z,event) ; re.......effective radius (nm), arr(z,event) ; ; Gaussian parameters & re from band2, band9, and chan2, for ice-smoke mixtures, only available ; after November 209 (see "remarks" for assumed smoke composition and AR, uses dr = f(rm) as above): ; ; vfs......volume fraction of smoke in ice, arr(z,event) ; con_s....concentration (#/cm3), arr(z,event) ; rm_s.....median radius (nm), arr(z,event) ; dr_s.....width (nm), arr(z,event) ; re_s.....effective radius (nm), arr(z,event) ; ; Vertical column variables, arr(event) except OD: ; ; iwc.........column ice abundance (g/km2) ; od..........PMC vertical optical depth (OD) from V extinctions (unitless), arr(event,wavelength) ; oddv........PMC vertical optical depth from ch. 2 dV extinctions (unitless) ; waves.......wavelengths for "od" (microns), arr(wavelength) ; ; Gaussian parameters & re from band9 & chan2 ODs (as described in lines 87-89): ; ; con_od......concentration from OD (#/cm2) ; rm_od.......median radius from OD (nm) ; dr_od.......width from OD (nm) ; re_od.......effective radius from OD (nm) ; ; Gaussian parameters & re from band2, band9, and chan2 ODs, for ice-smoke mixtures (as described in lines 96-97): ; ; vfs_od........volume fraction of smoke from OD ; con_s_od......concentration from OD (#/cm2), ice-smoke mixture ; rm_s_od.......median radius from OD (nm), ice-smoke mixture ; dr_s_od.......width from OD (nm), ice-smoke mixture ; re_s_od.......effective radius from OD (nm), ice-smoke mixture ; ; Extinction profiles, arr(z,event): ; ex_b2.....band 2 extinction, 0.330 microns wavelength (1/km) ; ex_b3.....band 3 extinction, 0.867 microns wavelength (1/km) ; ex_b4.....band 4 extinction, 1.037 microns wavelength (1/km) ; ex_b8.....band 8 extinction, 2.939 microns wavelength (1/km) ; ex_b9.....band 9 extinction, 3.064 microns wavelength (1/km) ; ex_b10....band 10 extinction, 3.186 microns wavelength (1/km) ; ex_c2.....channel 2 (dV) extinction, new formulation = B(0.867) - B(1.037) (1/km) ; ; Requires sofie_read_summary_s3.pro ; ; Source: Mark Hervig, GATS ;------------------------------------------------------------------------------------------------ ;- Get the file names in "pat" spawn, 'ls ' + pat + 'sofie_summary_s3_' + iver + '_*.nc', files nsea = n_elements(files) stitle = strarr(nsea) sea_num = intarr(nsea) print,'Getting ', nsea, ' seasons' print,' ' rmx = nsea * (140 * 15.) ; max # records = # seasons * max records per season (140 days, 15 events per day) nz = 401 mxnlay = 7 ;- sort files into time order psea = strarr(26) psea(0) = ['NH_2007'] psea(1) = ['SH_2007-08'] psea(2) = ['NH_2008'] psea(3) = ['SH_2008-09'] psea(4) = ['NH_2009'] psea(5) = ['SH_2009-10'] psea(6) = ['NH_2010'] psea(7) = ['SH_2010-11'] psea(8) = ['NH_2011'] psea(9) = ['SH_2011-12'] psea(10) = ['NH_2012'] psea(11) = ['SH_2012-13'] psea(12) = ['NH_2013'] psea(13) = ['SH_2013-14'] psea(14) = ['NH_2014'] psea(15) = ['SH_2014-15'] psea(16) = ['NH_2015'] psea(17) = ['SH_2015-16'] psea(18) = ['NH_2016'] psea(19) = ['NH_2019'] psea(20) = ['SH_2019-20'] psea(21) = ['NH_2020'] psea(22) = ['SH_2020-21'] psea(23) = ['NH_2021'] psea(24) = ['SH_2021-22'] psea(25) = ['NH_2022'] ;file name e.g., '/users/mhervig/sofie/data/summary/V1.2/sofie_summary_s3_V1.2_SH_2012-13.nc' ord = intarr(nsea) for i = 0,nsea-1 do begin f = file_basename(files(i)) l = strlen(iver) j = strpos(f,iver) h = strmid(f,j+l+1,2) if (h eq 'NH') then s = strmid(f,j+l+1,7) if (h eq 'SH') then s = strmid(f,j+l+1,10) k = where(psea eq s,n) ord(i) = k sea_num(i) = k+1 ; print,f,' ',h,' ',s,' ',k print,f,' ',sea_num(i) endfor s = sort(ord) files = files(s) ver = strarr(nsea) hem = strarr(nsea) season = strarr(nsea) nevent = intarr(nsea) orbit = lonarr(rmx) event = lonarr(rmx) mode = lonarr(rmx) sea_nums = intarr(rmx) date = lonarr(rmx) time = fltarr(rmx) lat = fltarr(rmx) lon = fltarr(rmx) lst = fltarr(rmx) doy = fltarr(rmx) dfs = fltarr(rmx) ice_pres = intarr(rmx) nlay = intarr(rmx) ztop = fltarr(rmx) zmax = fltarr(rmx) zbot = fltarr(rmx) zbot2 = fltarr(rmx) ztopa = fltarr(7,rmx) zmaxa = fltarr(7,rmx) zbota = fltarr(7,rmx) zmes = fltarr(rmx) pmes = fltarr(rmx) tmes = fltarr(rmx) p = fltarr(nz,rmx) t = fltarr(nz,rmx) h2o = fltarr(nz,rmx) o3 = fltarr(nz,rmx) ch4 = fltarr(nz,rmx) mice = fltarr(nz,rmx) vice = fltarr(nz,rmx) h2oi = fltarr(nz,rmx) aro = fltarr(nz,rmx) arp = fltarr(nz,rmx) icet = fltarr(nz,rmx) aroi = fltarr(nz,rmx) h2ot = fltarr(nz,rmx) re = fltarr(nz,rmx) con = fltarr(nz,rmx) rm = fltarr(nz,rmx) dr = fltarr(nz,rmx) vfs = fltarr(nz,rmx) con_s = fltarr(nz,rmx) rm_s = fltarr(nz,rmx) dr_s = fltarr(nz,rmx) re_s = fltarr(nz,rmx) iwc = fltarr(rmx) con_od = fltarr(rmx) rm_od = fltarr(rmx) dr_od = fltarr(rmx) re_od = fltarr(rmx) od = fltarr(8,rmx) oddv = fltarr(rmx) vfs_od = fltarr(rmx) con_s_od = fltarr(rmx) rm_s_od = fltarr(rmx) dr_s_od = fltarr(rmx) re_s_od = fltarr(rmx) b2 = fltarr(nz,rmx) b3 = fltarr(nz,rmx) b4 = fltarr(nz,rmx) b8 = fltarr(nz,rmx) b9 = fltarr(nz,rmx) b10 = fltarr(nz,rmx) c2 = fltarr(nz,rmx) ;- Loop over files (seasons) nr = 0 for i = 0,nsea-1 do begin ;sea_num(i) = i+1 file = files(i) print, file sofie_read_summary_s3,file,0,$ ver1,remarks,hem1,season1,nr1,nz,missing, $ orbit1,event1,mode1,date1,time1,lat1,lon1,lst1,doy1,dfs1,los_head1, $ z,p1,t1,h2o1,o31,ch41,zmes1,pmes1,tmes1, $ ztop1,zmax1,zbot1,zbot21,ice_pres1,nlay_al1,ztop_al1,zmax_al1,zbot_al1, $ vice1,mice1,h2oi1,aro1,arp1,aroi1,icet1,con1,rm1,dr1,re1,vfs1,con_s1,rm_s1,dr_s1,re_s1, $ iwc1,od1,waves,oddv1,con_od1,rm_od1,dr_od1,re_od1, vfs_od1,con_s_od1,rm_s_od1,dr_s_od1,re_s_od1,$ ex_b21,ex_b31,ex_b41,ex_b81,ex_b91,ex_b101,ex_c21 od1 = transpose(od1) h2ot1 = h2o1 + h2oi1 stitle(i) = hem1 + ' ' + strmid(season1,2,99) i1 = nr i2 = nr + nr1 - 1 nr = nr + nr1 ;- store the variables ver(i) = ver1 hem(i) = hem1 season(i) = season1 nevent(i) = nr1 orbit(i1:i2) = orbit1 event(i1:i2) = event1 mode(i1:i2) = mode1 sea_nums(i1:i2) = intarr(nr1) + sea_num(i) date(i1:i2) = date1 yrd = yyyydoy_2_decyr(date) time(i1:i2) = time1 lat(i1:i2) = lat1 lon(i1:i2) = lon1 lst(i1:i2) = lst1 doy(i1:i2) = doy1 dfs(i1:i2) = dfs1 ice_pres(i1:i2) = ice_pres1 nlay(i1:i2) = nlay_al1 ztop(i1:i2) = ztop1 zmax(i1:i2) = zmax1 zbot(i1:i2) = zbot1 zbot2(i1:i2) = zbot21 ztopa(*,i1:i2) = ztop_al1 zmaxa(*,i1:i2) = zmax_al1 zbota(*,i1:i2) = zbot_al1 zmes(i1:i2) = zmes1 pmes(i1:i2) = pmes1 tmes(i1:i2) = tmes1 p(*,i1:i2) = p1 t(*,i1:i2) = t1 h2o(*,i1:i2) = h2o1 o3(*,i1:i2) = o31 ch4(*,i1:i2) = ch41 mice(*,i1:i2) = mice1 vice(*,i1:i2) = vice1 h2oi(*,i1:i2) = h2oi1 aro(*,i1:i2) = aro1 arp(*,i1:i2) = arp1 icet(*,i1:i2) = icet1 aroi(*,i1:i2) = aroi1 h2ot(*,i1:i2) = h2ot1 con(*,i1:i2) = con1 rm(*,i1:i2) = rm1 dr(*,i1:i2) = dr1 re(*,i1:i2) = re1 vfs(*,i1:i2) = vfs1 con_s(*,i1:i2) = con_s1 rm_s(*,i1:i2) = rm_s1 dr_s(*,i1:i2) = dr_s1 re_s(*,i1:i2) = re_s1 iwc(i1:i2) = iwc1 con_od(i1:i2) = con_od1 rm_od(i1:i2) = rm_od1 dr_od(i1:i2) = dr_od1 re_od(i1:i2) = re_od1 od(*,i1:i2) = od1 oddv(i1:i2) = oddv1 vfs_od(i1:i2) = vfs_od1 con_s_od(i1:i2) = con_s_od1 rm_s_od(i1:i2) = rm_s_od1 dr_s_od(i1:i2) = dr_s_od1 re_s_od(i1:i2) = re_s_od1 b2(*,i1:i2) = ex_b21 b3(*,i1:i2) = ex_b31 b4(*,i1:i2) = ex_b41 b8(*,i1:i2) = ex_b81 b9(*,i1:i2) = ex_b91 b10(*,i1:i2) = ex_b101 c2(*,i1:i2) = ex_c21 endfor ; over files ;- Trim arrays k = where(date gt 0) orbit = orbit(k) event = event(k) mode = mode(k) sea_nums = sea_nums(k) date = date(k) yrd = yrd(k) time = time(k) lat = lat(k) lon = lon(k) lst = lst(k) doy = doy(k) dfs = dfs(k) ice_pres = ice_pres(k) nlay = nlay(k) ztop = ztop(k) zmax = zmax(k) zbot = zbot(k) zbot2 = zbot2(k) ztopa = ztopa(*,k) zmaxa = zmaxa(*,k) zbota = zbota(*,k) zmes = zmes(k) pmes = pmes(k) tmes = tmes(k) p = p(*,k) t = t(*,k) h2o = h2o(*,k) o3 = o3(*,k) ch4 = ch4(*,k) mice = mice(*,k) vice = vice(*,k) h2oi = h2oi(*,k) aro = aro(*,k) arp = arp(*,k) icet = icet(*,k) aroi = aroi(*,k) h2ot = h2ot(*,k) con = con(*,k) rm = rm(*,k) dr = dr(*,k) re = re(*,k) vfs = vfs(*,k) con_s = con_s(*,k) rm_s = rm_s(*,k) dr_s = dr_s(*,k) re_s = re_s(*,k) iwc = iwc(k) con_od = con_od(k) rm_od = rm_od(k) dr_od = dr_od(k) re_od = re_od(k) od = od(*,k) oddv = oddv(k) vfs_od = vfs_od(k) con_s_od = con_s_od(k) rm_s_od = rm_s_od(k) dr_s_od = dr_s_od(k) re_s_od = re_s_od(k) b2 = b2(*,k) b3 = b3(*,k) b4 = b4(*,k) b8 = b8(*,k) b9 = b9(*,k) b10 = b10(*,k) c2 = c2(*,k) nevent = nr print,rmx,' events allowed' print,nevent,' events obtained' ;- Create an IDL structure, trim in case there were bad points k = where(date gt 0) s = create_struct($ 'name', 'SOFIE summary files',$ 'nrec',nevent,$ 'nz',nz,$ 'remarks',remarks,$ 'nsea',nsea,$ 'hem',hem,$ 'season',season,$ 'stitle',stitle,$ 'sea_num',sea_num,$ 'sea_nums',sea_nums,$ 'orbit',orbit,$ 'event',event,$ 'mode', mode,$ 'date', date,$ 'time', time,$ 'lat', lat,$ 'lon', lon,$ 'lst', lst,$ 'dfs', dfs,$ 'doy', doy,$ 'yrd', yrd,$ 'zmes', zmes,$ 'pmes', pmes,$ 'tmes', tmes,$ 'ztop', ztop,$ 'zmax', zmax,$ 'zbot', zbot,$ 'zbot2', zbot2,$ 'ice_pres', ice_pres,$ 'iwc', iwc,$ 'con_od', con_od,$ 'rm_od', rm_od,$ 'dr_od', dr_od,$ 're_od', re_od,$ 'vfs_od', vfs_od,$ 'con_s_od', con_s_od,$ 'rm_s_od', rm_s_od,$ 'dr_s_od', dr_s_od,$ 're_s_od', re_s_od,$ 'z', z, $ 'p', p, $ 't', t, $ 'h2o', h2o, $ 'o3', o3, $ 'ch4', ch4, $ 'vice', vice, $ 'mice', mice, $ 'h2oi', h2oi, $ 'aroi', aroi, $ 'icet', icet, $ 'con', con, $ 'rm', rm, $ 'dr', dr, $ 're', re, $ 'vfs', vfs, $ 'con_s', con_s, $ 'rm_s', rm_s, $ 'dr_s', dr_s, $ 're_s', re_s, $ 'ex_b2', b2, $ ; extinction profiles "b2" = band 2, etc... 'ex_b3', b3, $ 'ex_b4', b4, $ 'ex_b8', b8, $ 'ex_b9', b9, $ 'ex_b10', b10, $ 'ex_c2', c2 ) ;- done return,s end