;conobs - Conductance observations ;esobs - Electric field single observations ;evobs - Electric field vector observations ;magobs - Magnetometer observations ;satmagobs - Satellite magnetometer observations ;storm indices - returns AE, AL, AU, DST for every time ;ekvmdl - Mean electron energy (keV) ;efxmdl - Electron energy flux (mW/m^2) ;apedmdl - Auroral Pedersen conductance (mho) ;ahalmdl - Auroral Hall conductance (mho) ;pedrm - Pedersen modifier (ln(pedaur/pedmodaur)) ;halrm - Hall modifier (ln(halaur/halmodaur)) ;esvp - Conductance variability ;cvpot - Conductance auroral error (%) ;sigpa - Auroral Pedersen conductance (mho) ;sigp - Total Pedersen conductance (mho) ;sigha - Auroral Hall conductance (mho) ;sigh - Total Hall conductance (mho) ;wpm2 - Auroral electron energy flux (W/m^2) ;emkev - Auroral mean electron energy (keV) ;pkvmdl - ?Electrostatic potential (keV) ;eemdl - Model east electric field ;enmdl - Model north electric field ;emdl - Model resultant electric field ;evar - Electric field variability ;efer - Electric field error ;efpot - Electric potential (V) ;ee - East electric field (V/m) ;eeerr - Error of east electric field ;en - North electric field (V/m) ;enerr - Error of north electric field ;psi - Current function? ;vpot - Magnetic potential ;zarr - ?? ;cpot - Current potential ;sigps - Solar Pedersen conductance (mho) ;sighs - Solar Hall conductance (mho) ;sigper - Error of total Pedersen conductance (mho) ;sigher - Error of total Hall conductance (mho) ;sigr - Hall/Pedersen ratio of total fitted/calc conductance ;smqj - Simple joule heating ;erar - Percent error ;rvqj - =SIGP*EFER+SMQJ ;dee - =SIGP*EE+SIGH*EN ;den - =SIGP*EN-SIGH*EE ;deep - =SIGP*EE ;denp - =SIGP*EN ;deeh - =SIGH*EN ;denh - =SIGH*(-1)*EE ;dfac - Divergence of ionospheric currents (+ downward) (A/m^2) ;psip - Similar to DFAC, except uses DEEP and DENP instead of DEN and DEE ;psih - Similar to DFAC, except uses DEEH and DENH instead of DEN and DEE ;empr - Power input (=DFAC*EFPOT) function extract_amie_data, afile, tempspecies line = '' numvarsinfile = 47 startstr = '*ekvmdl efxmdl apedmdl ahalmdl pedrm halrm esvp cvpot sigpa sigp sigha sigh wpm2 emkev pkvmdl eesmdl ensmdl emdl evar efer efpot ee eeerr en enerr psi vpot zarr cpot sigps sighs sigper sigher sigr smqj erar rvqj dee den deep denp deeh denh dfac psip psih empr*' timestr = '*ntime iyear imo ida ihr imin nconobs nesobs nevobs nmgsta nsaobs*' magstr = '*name alat mlt alon dec xm,m,f wtxm,er ym,m,f wtym,er zm,m,f wtzm,er*' esobstr = '*name ibas alat mlt alon ang esobs esmdl esfit eperp wtes ersiges*' evobstr = '*name ibav alat mlt alon ang en ee enmdl eemdl encomp eecomp wtn wte ersigen ersigee*' conobstr = '*name ipc alat mlt alon ang ped hal H/P ekev eflx wtcon wtk wtx*' conobstr2 = '*pedmdl halmdl ekevmdl eflxmdl pedfit halfit ekevfit eflxfit ersigln(ped,hal,kev,flx*' satmagobstr = '*name ipsm alat mlt alon ang dalat dalon dby dbz dbymdl dbzmdl dbycomp dbzcomp wty wtz ersigdby ersigdbz*' ;;note: older runs may have vsw and vsd, so need to check for both!, ;;and only if magobs are used aeaualstr = '*AE(rd,calc) AU AL Dst(rd*' do_conobs = 0 do_esobs = 0 do_evobs = 0 do_magobs = 0 do_satmagobs = 0 do_storm_indices = 0 do_any = 0 if n_elements(tempspecies) gt 0 then begin if value_in_array('conobs', strlowcase(tempspecies)) then $ do_conobs = 1 if value_in_array('esobs', strlowcase(tempspecies)) then $ do_esobs = 1 if value_in_array('evobs', strlowcase(tempspecies)) then $ do_evobs = 1 if value_in_array('magobs', strlowcase(tempspecies)) then $ do_magobs = 1 if value_in_array('satmagobs', strlowcase(tempspecies)) then $ do_satmagobs = 1 if value_in_array('ae', strlowcase(tempspecies)) OR value_in_array('au', strlowcase(tempspecies)) OR $ value_in_array('al', strlowcase(tempspecies)) OR value_in_array('storm_indices', strlowcase(tempspecies)) then $ do_storm_indices = 1 do_any = (do_conobs + do_esobs + do_evobs + do_magobs + do_satmagobs) gt 0 valid = where(strlowcase(tempspecies) ne 'unk' and tempspecies ne '', count) if count gt 0 then $ species = tempspecies[valid] endif numvars = n_elements(species) - do_conobs - do_esobs - do_evobs - do_magobs - do_satmagobs - do_storm_indices openr, lun, afile, /get_lun readf, lun, line numtimesteps = long(strmid(line, 28, 3)) if do_any then begin if do_conobs then $ numconobs = lonarr(numtimesteps) if do_esobs then $ numesobs = lonarr(numtimesteps) if do_evobs then $ numevobs = lonarr(numtimesteps) if do_magobs then $ nummagobs = lonarr(numtimesteps) if do_satmagobs then $ numsatmagobs = lonarr(numtimesteps) while ~strmatch(line, startstr) do begin readf, lun, line endwhile numtime = 0 while ~eof(lun) do begin readf, lun, line if strmatch(line, timestr) then begin numtime = numtime + 1L ;;I4,I5,4I3,5I4, ntime iyear imo ida ihr imin nconobs nesobs nevobs nmgsta nsaobs if do_conobs then $ numconobs[numtime-1] = strmid(line, 21, 4) if do_esobs then $ numesobs[numtime-1] = strmid(line, 25, 4) if do_evobs then $ numevobs[numtime-1] = strmid(line, 29, 4) if do_magobs then $ nummagobs[numtime-1] = strmid(line, 33, 4) if do_satmagobs then $ numsatmagobs[numtime-1] = strmid(line, 37, 4) endif endwhile endif free_lun, lun if do_magobs && max(nummagobs) gt 0 then begin ;;magobs ;;name alat mlt alon dec xm,m,f wtxm,er ym,m,f wtym,er zm,m,f wtzm,er temparr = fltarr(numtimesteps, max(nummagobs))*!values.f_nan magdata = {name: strarr(numtimesteps, max(nummagobs)), $ alat: temparr, $ mlt: temparr, $ alon: temparr, $ dec: temparr, $ xm: temparr, $ x_m: temparr, $ x_f: temparr, $ wtxm: temparr, $ x_er: temparr, $ ym: temparr, $ y_m: temparr, $ y_f: temparr, $ wtym: temparr, $ y_er: temparr, $ zm: temparr, $ z_m: temparr, $ z_f: temparr, $ wtzm: temparr, $ z_er: temparr $ } undefine, temparr endif if do_evobs && max(numevobs) gt 0 then begin ;;evobs ;;name ibav alat mlt alon ang en ee enmdl eemdl encomp eecomp wtn wte ersigen ersigee -1 hemi temparr = fltarr(numtimesteps, max(numevobs))*!values.f_nan evobdata = {name: strarr(numtimesteps, max(numevobs)), $ ibav: temparr, $ alat: temparr, $ mlt: temparr, $ alon: temparr, $ ang: temparr, $ en: temparr, $ ee: temparr, $ enmdl: temparr, $ eemdl: temparr, $ encomp: temparr, $ eecomp: temparr, $ wtn: temparr, $ wte: temparr, $ ersigen: temparr, $ ersigee: temparr, $ hemi: temparr $ } undefine, temparr endif if do_esobs && max(numesobs) gt 0 then begin ;;esobs ;;name ibas alat mlt alon ang esobs esmdl esfit eperp wtes ersiges -1 hemi temparr = fltarr(numtimesteps, max(numesobs))*!values.f_nan esobdata = {name: strarr(numtimesteps, max(numesobs)), $ ibas: temparr, $ alat: temparr, $ mlt: temparr, $ alon: temparr, $ ang: temparr, $ esobs: temparr, $ esmdl: temparr, $ esfit: temparr, $ eperp: temparr, $ wtes: temparr, $ ersiges: temparr, $ hemi: temparr $ } undefine, temparr endif if do_conobs && max(numconobs) gt 0 then begin ;;conobs ;;(covers 2 lines in file) ;;name ipc alat mlt alon ang ped hal H/P ekev eflx wtcon wtk wtx ;;pedmdl halmdl ekevmdl eflxmdl pedfit halfit ekevfit eflxfit ersigln(ped,hal,kev,flx) temparr = fltarr(numtimesteps, max(numconobs))*!values.f_nan conobdata = {name:strarr(numtimesteps, max(numconobs)), $ ipc: temparr, $ alat: temparr, $ mlt: temparr, $ alon: temparr, $ ang: temparr, $ ped: temparr, $ hal: temparr, $ H_P: temparr, $ ekev: temparr, $ eflx: temparr, $ wtcon: temparr, $ wtk: temparr, $ wtx: temparr, $ pedmdl: temparr, $ halmdl: temparr, $ ekevmdl: temparr, $ eflxmdl: temparr, $ pedfit: temparr, $ halfit: temparr, $ ekevfit: temparr, $ eflxfit: temparr, $ ersigln_ped: temparr, $ ersigln_hal: temparr, $ ersigln_kev: temparr, $ ersigln_flx: temparr $ } undefine, temparr endif if do_satmagobs && max(numsatmagobs) gt 0 then begin ;;satmagObs ;;name ipsm alat mlt alon ang dalat dalon dby dbz dbymdl dbzmdl dbycomp dbzcomp wty wtz ersigdby ersigdbz temparr = fltarr(numtimesteps, max(numsatmagobs))*!values.f_nan satmagdata = {name: strarr(numtimesteps, max(numsatmagobs)), $ ipsm: temparr, $ alat: temparr, $ mlt: temparr, $ alon: temparr, $ ang: temparr, $ dalat: temparr, $ dalon: temparr, $ dby: temparr, $ dbz: temparr, $ dbymdl: temparr, $ dbzmdl: temparr, $ dbycomp: temparr, $ dbzcomp: temparr, $ wty: temparr, $ wtz: temparr, $ ersigdby: temparr, $ ersigdbz: temparr $ } undefine, temparr endif ;;no sense in loading it if magobs eq 0 (its computed from mag data) if do_storm_indices then begin temparr = fltarr(numtimesteps)*!values.f_nan storm_indices = {aeRead: temparr, $ aeCalc: temparr, $ au: temparr, $ al: temparr, $ dstRead: temparr, $ dstCalc: temparr} undefine, temparr endif linect = 0 openr, lun, afile, /get_lun ;; extracting the flags readf, lun, line str = strsplit(line,/extract) flags = str[0:15] flagnames = str[17:32] ;; extracting the colats for i=0,5 do begin readf, lun, line str = strsplit(line,/extract) if n_elements(colats) eq 0 then $ colats = float(str[where(~strmatch(str,'*clat*'))]) else $ colats = [temporary(colats), float(str[where(~strmatch(str,'*clat*'))])] endfor numlats = n_elements(colats) ;; extracting the mlts for i=0,3 do begin readf, lun, line str = strsplit(line,/extract) if n_elements(mlts) eq 0 then $ mlts = float(str[where(~strmatch(str,'*mlt*'))]) else $ mlts = [temporary(mlts), float(str[where(~strmatch(str,'*mlt*'))])] endfor nummlts = n_elements(mlts) jultime = dblarr(numtimesteps)*!values.d_nan linect = 11 if numvars gt 0 then begin amiedata = fltarr(numtimesteps, numlats, nummlts, numvars)*!values.f_nan amiedatanames = strarr(numvars) endif maxlatidx = 0 while ~strmatch(line, startstr) do begin readf, lun, line linect = linect + 1L endwhile while ~eof(lun) do begin readf, lun, line linect = linect +1L ;;we know this is out of header if strmatch(line, timestr) then begin if n_elements(strsplit(line,/extract)) gt 15 then begin ;;I4,I5,4I3,5I4, ntime iyear imo ida ihr imin nconobs nesobs nevobs nmgsta nsaobs timestpct = strmid(line, 0, 4)+0. timeidx = timestpct-1. year = strmid(line, 4, 5)+0 month = strmid(line, 9, 3)+0 day = strmid(line, 12, 3)+0 hour = strmid(line, 15, 3)+0 min = strmid(line, 18, 3)+0 jultime[timeidx] = julday(temporary(month), $ temporary(day), temporary(year), $ temporary(hour), temporary(min), 0) ;;index for array location, so we can save each observation nmagob = 0 nevob = 0 nesob = 0 nconob = 0 nsatmagob = 0 endif endif if do_storm_indices && strmatch(line, aeaualstr) then begin if n_elements(strsplit(line, /EXTRACT)) eq 22 then begin ;;solar wind density in the file(this was added for the ;;new weimer, so older runs won't have it) ;;2F6.0,3F6.1,6F7.1,I3, Vsw Bx By Bz AE(rd,calc) AU AL Dst(rd,calc) nDst storm_indices.aeRead[timeidx] = strmid(line, 30, 7)+0. storm_indices.aeCalc[timeidx] = strmid(line, 37, 7)+0. storm_indices.au[timeidx] = strmid(line, 44,7)+0. storm_indices.al[timeidx] = strmid(line, 51, 7)+0. storm_indices.dstRead[timeidx] = strmid(line, 58,7)+0. storm_indices.dstCalc[timeidx] = strmid(line, 65,7)+0. endif else if n_elements(strsplit(line, /EXTRACT)) eq 20 then begin ;;no solar wind density in the file(this was added for the ;;new weimer, so older runs won't have it) storm_indices.aeRead[timeidx] = strmid(line, 24, 7)+0. storm_indices.aeCalc[timeidx] = strmid(line, 31, 7)+0. storm_indices.au[timeidx] = strmid(line, 38,7)+0. storm_indices.al[timeidx] = strmid(line, 45, 7)+0. storm_indices.dstRead[timeidx] = strmid(line, 52,7)+0. storm_indices.dstCalc[timeidx] = strmid(line, 59,7)+0. endif endif if do_any then begin ;;magobs if do_magobs && strmatch(line, magstr) then begin magdata.name[timeidx, nmagob] = strmid(line, 0, 8) magdata.alat[timeidx, nmagob] = strmid(line, 8, 7) +0. magdata.mlt[timeidx, nmagob] = strmid(line, 15, 7) +0. magdata.alon[timeidx, nmagob] = strmid(line, 22, 7) +0. magdata.dec[timeidx, nmagob] = strmid(line, 29, 7) +0. magdata.xm[timeidx, nmagob] = strmid(line, 36, 7) +0. magdata.x_m[timeidx, nmagob] = strmid(line, 43, 7) +0. magdata.x_f[timeidx, nmagob] = strmid(line, 50, 7) +0. magdata.wtxm[timeidx, nmagob] = strmid(line, 57, 12) +0. magdata.x_er[timeidx, nmagob] = strmid(line, 69, 12) +0. magdata.ym[timeidx, nmagob] = strmid(line, 81, 7) +0. magdata.y_m[timeidx, nmagob] = strmid(line, 88, 7) +0. magdata.y_f[timeidx, nmagob] = strmid(line, 95, 7) +0. magdata.wtym[timeidx, nmagob] = strmid(line, 102, 12) +0. magdata.y_er[timeidx, nmagob] = strmid(line, 114, 12) +0. magdata.zm[timeidx, nmagob] = strmid(line, 126, 7) +0. magdata.z_m[timeidx, nmagob] = strmid(line, 133, 7) +0. magdata.z_f[timeidx, nmagob] = strmid(line, 140, 7) +0. magdata.wtzm[timeidx, nmagob] = strmid(line, 147, 12) +0. magdata.z_er[timeidx, nmagob] = strmid(line, 159, 12) +0. nmagob = nmagob + 1L endif ;;esobs if do_esobs && strmatch(line, esobstr) then begin esobdata.name[timeidx,nesob] = strmid(line, 0, 8) esobdata.ibas[timeidx,nesob] = strmid(line, 8, 10)+0. esobdata.alat[timeidx,nesob] = strmid(line, 18, 7)+0. esobdata.mlt[timeidx,nesob] = strmid(line, 26, 7)+0. esobdata.alon[timeidx,nesob] = strmid(line, 32, 7)+0. esobdata.ang[timeidx,nesob] = strmid(line, 39, 7)+0. esobdata.esobs[timeidx,nesob] = strmid(line, 46, 7)+0. esobdata.esmdl[timeidx,nesob] = strmid(line, 53, 7)+0. esobdata.esfit[timeidx,nesob] = strmid(line, 60, 7)+0. esobdata.eperp[timeidx,nesob] = strmid(line, 67, 7)+0. esobdata.wtes[timeidx,nesob] = strmid(line, 74, 12)+0. esobdata.ersiges[timeidx,nesob] = strmid(line, 86, 12)+0. esobdata.hemi[timeidx,nesob] = strmid(line, 164, 2)+0. nesob = nesob + 1L endif ;;evobs if do_evobs && strmatch(line, evobstr) then begin evobdata.name[timeidx,nevob] = strmid(line, 0, 8) evobdata.ibav[timeidx,nevob] = strmid(line, 8, 10)+0. evobdata.alat[timeidx,nevob] = strmid(line, 18, 7)+0. evobdata.mlt[timeidx,nevob] = strmid(line, 26, 7)+0. evobdata.alon[timeidx,nevob] = strmid(line, 32, 7)+0. evobdata.ang[timeidx,nevob] = strmid(line, 39, 7)+0. evobdata.en[timeidx,nevob] = strmid(line, 46, 7)+0. evobdata.ee[timeidx,nevob] = strmid(line, 53, 7)+0. evobdata.enmdl[timeidx,nevob] = strmid(line, 60, 7)+0. evobdata.eemdl[timeidx,nevob] = strmid(line, 67, 7)+0. evobdata.encomp[timeidx,nevob] = strmid(line, 74, 7)+0. evobdata.eecomp[timeidx,nevob] = strmid(line, 81, 7)+0. evobdata.wtn[timeidx,nevob] = strmid(line, 88, 12)+0. evobdata.wte[timeidx,nevob] = strmid(line, 100, 12)+0. evobdata.ersigen[timeidx,nevob] = strmid(line, 112, 12)+0. evobdata.ersigee[timeidx,nevob] = strmid(line, 124, 12)+0. evobdata.hemi[timeidx,nevob] = strmid(line, 221, 2)+0. nevob = nevob + 1L endif ;;conobs if do_conobs && strmatch(line, conobstr) then begin conobdata.name[timeidx, nconob] = strmid(line, 0, 8) conobdata.ipc[timeidx, nconob] = strmid(line, 8, 10)+0. conobdata.alat[timeidx, nconob] = strmid(line, 18, 7)+0. conobdata.mlt[timeidx, nconob] = strmid(line, 25, 7)+0. conobdata.alon[timeidx, nconob] = strmid(line, 32, 7)+0. conobdata.ang[timeidx, nconob] = strmid(line, 39, 7)+0. conobdata.ped[timeidx, nconob] = strmid(line, 46, 7)+0. conobdata.hal[timeidx, nconob] = strmid(line, 53, 7)+0. conobdata.H_P[timeidx, nconob] = strmid(line, 60, 7)+0. conobdata.ekev[timeidx, nconob] = strmid(line, 67, 7)+0. conobdata.eflx[timeidx, nconob] = strmid(line, 74, 8)+0. conobdata.wtcon[timeidx, nconob] = strmid(line, 82, 12)+0. conobdata.wtk[timeidx, nconob] = strmid(line, 94, 12)+0. conobdata.wtx[timeidx, nconob] = strmid(line, 106, 12)+0. readf, lun, line linect = linect + 1L if ~strmatch(line, conobstr2) then message,'conobstr2 does not follow conobstr!' conobdata.pedmdl[timeidx, nconob] = strmid(line, 9, 7) conobdata.halmdl[timeidx, nconob] = strmid(line, 15, 7)+0. conobdata.ekevmdl[timeidx, nconob] = strmid(line, 22, 7)+0. conobdata.eflxmdl[timeidx, nconob] = strmid(line, 29, 8)+0. conobdata.pedfit[timeidx, nconob] = strmid(line, 37, 7)+0. conobdata.halfit[timeidx, nconob] = strmid(line, 44, 7)+0. conobdata.ekevfit[timeidx, nconob] = strmid(line, 51, 7)+0. conobdata.eflxfit[timeidx, nconob] = strmid(line, 58, 8)+0. conobdata.ersigln_ped[timeidx, nconob] = strmid(line, 66, 12)+0. conobdata.ersigln_hal[timeidx, nconob] = strmid(line, 78, 12)+0. conobdata.ersigln_kev[timeidx, nconob] = strmid(line, 90, 12)+0. conobdata.ersigln_flx[timeidx, nconob] = strmid(line, 102, 12)+0. nconob = nconob + 1L endif ;;satMagObs if do_satmagobs && strmatch(line, satmagobstr) then begin satmagdata.name[timeidx, nsatmagob] = strmid(line, 0, 8) satmagdata.ipsm[timeidx, nsatmagob] = strmid(line, 8, 10)+0. satmagdata.alat[timeidx, nsatmagob] = strmid(line, 18, 7)+0. satmagdata.mlt[timeidx, nsatmagob] = strmid(line, 25, 7)+0. satmagdata.alon[timeidx, nsatmagob] = strmid(line, 32, 7)+0. satmagdata.ang[timeidx, nsatmagob] = strmid(line, 39, 7)+0. satmagdata.dalat[timeidx, nsatmagob] = strmid(line, 46, 9)+0. satmagdata.dalon[timeidx, nsatmagob] = strmid(line, 55, 9)+0. satmagdata.dby[timeidx, nsatmagob] = strmid(line, 64, 9)+0. satmagdata.dbz[timeidx, nsatmagob] = strmid(line, 73, 9)+0. satmagdata.dbymdl[timeidx, nsatmagob] = strmid(line, 82, 9)+0. satmagdata.dbzmdl[timeidx, nsatmagob] = strmid(line, 91, 9)+0. satmagdata.dbycomp[timeidx, nsatmagob] = strmid(line, 100, 9)+0. satmagdata.dbzcomp[timeidx, nsatmagob] = strmid(line, 109, 9)+0. satmagdata.wty[timeidx, nsatmagob] = strmid(line, 118, 12)+0. satmagdata.wtz[timeidx, nsatmagob] = strmid(line, 130, 12)+0. satmagdata.ersigdby[timeidx, nsatmagob] = strmid(line, 142, 12)+0. satmagdata.ersigdbz[timeidx, nsatmagob] = strmid(line, 154, 12)+0. nsatmagob = nsatmagob + 1L endif endif if strmatch(line, '*ith clatd*') then begin latidx = long((strsplit(line,/extract))[0]) maxlatidx = maxlatidx > latidx if numvars gt 0 then begin varidx = 0 datalinect = 0 ;;reading each data point...I know there are four lines per ;;data type, listed 10mlts, 10mlts, 10mlts, 7 mlts for j =0, (numvarsinfile*4.)-1 do begin readf, lun, line linect = linect + 1L if datalinect eq 0 then begin thisname = strcompress(strmid(line, 120, 10), /remove_all) if ~value_in_array(thisname, species) then begin skip_lun, lun, 3, /lines linect = linect + 3L j = j+3 continue endif amieDataNames[varidx] = thisname mltidx = 0 endif if datalinect lt 3 then $ endidx = 9 else $ endidx = 6 amiedata[timeidx, latidx, mltidx:(mltidx+endidx), varidx] = float((strsplit(line,/extract))[0:endidx]) mltidx = mltidx + endidx + 1 if datalinect eq 3 then begin varidx = varidx + 1L datalinect = 0 endif else $ datalinect = datalinect + 1 endfor ;; amie datalines endif ;; numvars > 0 endif ;; we are on an ith clatd line endwhile ;; lun ;;freeing the file lun and closing amiefile free_lun, lun if maxlatidx gt 0 then $ colats = colats[0:maxlatidx] mlat = 90-colats if flags[1] lt 1 then $ mlat = mlat * (-1) temparr = sort(mlat) amie_data = {mlat: mlat[temparr], $ mlts: mlts, $ juls: jultime, $ source: afile} if numvars gt 0 then begin amiedata = (temporary(amiedata))[*,0:maxlatidx,*,*] amiedata = (temporary(amiedata))[*,temparr,*,*] amie_data = create_struct(temporary(amie_data), 'amiedata', temporary(amiedata), 'amiedatanames', amiedatanames) endif if do_conobs && max(numconobs) gt 0 then $ amie_data = create_struct(temporary(amie_data), 'conobdata', temporary(conobdata)) if do_esobs && max(numesobs) gt 0 then $ amie_data = create_struct(temporary(amie_data), 'esobdata', temporary(esobdata)) if do_evobs && max(numevobs) gt 0 then $ amie_data = create_struct(temporary(amie_data), 'evobdata', temporary(evobdata)) if do_magobs && max(nummagobs) gt 0 then $ amie_data = create_struct(temporary(amie_data), 'magdata', temporary(magdata)) if do_satmagobs && max(numsatmagobs) gt 0 then $ amie_data = create_struct(temporary(amie_data), 'satmagdata', temporary(satmagdata)) if do_storm_indices gt 0 then $ amie_data = create_struct(temporary(amie_data), 'storm_indices', temporary(storm_indices)) return, amie_data end