pro sofie_read_l1_netcdf,file,idump,$ dp_version,nevent,miss,orbit,event,mode,date,time_start,time_end,lat,lon,time,$ z,sig_v,sig_dv,sig_v_raw,sig_dv_raw,sig_drift, tran,trand, $ refr_ang,z_merg,p_merg,t_merg,sldc,sldc_angle,t_det,bal_atten,t_midopt,sig_exo ;----------------------------------------------------------------------------------- ; ; Routine reads a SOFIE level1 NetCDF file and returns named variables. ; ; Input: ; ; file.......path + name of the SOFIE L1 netcdf file ; ; Output: ; ; Scalar header info: ; ; dp_version...SOFIE data product version, string, scalar ; nevent.......number of events in this file, scalar ; nz...........number of altitude points in profiles, scalar ; miss.........number that represents missing data (-1e24) ; ; Vectors with 1 value per event: ; ; orbit........AIM orbit number ; event........SOFIE event number ; mode.........occultation mode, 0 = sunrise, 1 = sunset ; date.........date as yyyyddd ; time_start...event start time (seconds since Unix epoch) ; time_end.....event end time (seconds since Unix epoch) ; bal_atten....balance attenuator setting for each of 16 bands, range from 0-1, fltarr(16, nevent) ; ; Height / time dependent data: ; ; z............altitude grid for many of the profile parameters (km) ; ; view_ang.....viewing angle to tan_z (radians), arr(event,time) ; time.........time relative to start of event (?), arr(event,time) ; ; sig_v........radiometer signals (counts), arr(event,detector,time) ; sig_dv.......difference signals (), arr(event,detector,time) ; sig_exo......exoatmospheric signals (counts), arr(event,detector) ; sldc.........solar limb darkening curve (relative, 0-1), arr(event,detector,angle) ; sldc_angle...angle axis for sldc (radians), arr(event,angle) ; ; refract_ang..701 nm wavelength refraction angle (radians), arr(event,time) ; refract_z....altitude grid for refraction retrieval (km), arr(event,z) ; refract_p....pressure from refraction retrieval (hPa), arr(event,z) ; refract_t....temperature from refraction retrieval (K), arr(event,z) ; ; merg_z.......altitude for merged NCEP & MSIS profiles (km) ; merg_p.......pressure " ; merg_t.......temperature " ; ; el_lo........position of solar bottom edge (radians, on z_grd) ; el_hi........position of solar top edge (") ; az_lo........position of solar right edge (") ; az_hi........position of solar left edge (") ; sol_ext......solar extent in elevation, or xhi-xlo (") ; ; t_det........detector temperature for each of 16 bands (C, on z_grd) ; t_midopt.....mid optics bracket temperature (C) ; ; Source: Mark Hervig, GATS Inc. ; ;----------------------------------------------------------------------------------- miss = -1d24 ; missing data value ;- Open the file id = ncdf_open(file,/nowrite) ;- File contents if (idump eq 1) then ncdf_cat,file glob = ncdf_inquire(id) varname = strarr(glob.nvars) ; this will contain the variable names for i = 0,glob.nvars-1 do begin info = ncdf_varinq(id, i) varname(i) = info.name if (idump eq 1) then print,info.name endfor ;- Global attributes ncdf_attget,id,/global,'Title',out & title = string(out) ncdf_attget,id,/global,'DP_Type',out & dp_type = string(out) ncdf_attget,id,/global,'Source',out & source = string(out) ncdf_attget,id,/global,'Mission',out & mission = string(out) ncdf_attget,id,/global,'DP_Version',out & dp_version = string(out) ncdf_attget,id,/global,'PF_Version',out & pf_version = string(out) ncdf_attget,id,/global,'SW_Version',out & sw_version = string(out) ncdf_attget,id,/global,'SW_Name',out & sw_name = string(out) ncdf_attget,id,/global,'Calib_Version',out & cal_version = string(out) ncdf_attget,id,/global,'Description',out & description = string(out) ncdf_attget,id,/global,'History',out & history = string(out) ncdf_attget,id,/global,'Gen_Date',out & gen_date = string(out) ;- Header data ncdf_varget,id,'event' , event ncdf_varget,id,'orbit_number' , orbit ncdf_varget,id,'Date' , date ; yyyyddd ncdf_varget,id,'time' , time ncdf_varget,id,'sunrise_sunset_flag', mode ncdf_varget,id,'event_start_time' , time_start ncdf_varget,id,'event_end_time' , time_end ncdf_varget,id,'Longitude_83km', lon ncdf_varget,id,'Latitude_83km' , lat nevent = n_elements(event) ;- Profile data ncdf_varget,id,'altitude' , z ; common altitude grid ncdf_varget,id,'Raw_Signal' , sig_v_raw ; arr(event,detector,time) ncdf_varget,id,'Diff_Signal_Raw' , sig_dv_raw ; arr(event,detector,time) ncdf_varget,id,'Signal' , sig_v ; arr(event,detector,time) ncdf_varget,id,'Diff_Signal' , sig_dv ; arr(event,detector,time) ncdf_varget,id,'Signal_Drift' , sig_drift ; arr(event,detector) ncdf_varget,id,'Gridded_Transmissions_Signal' , tran ; transmissions, V signals ncdf_varget,id,'Gridded_Transmissions_Diff_Signal' ,trand ; " dV signals ;ncdf_varget,id,'refraction_alt' , z_refr ;ncdf_varget,id,'Refraction_P' , p_refr ;ncdf_varget,id,'Refraction_T' , t_refr ncdf_varget,id,'merged_altitude' , z_merg ncdf_varget,id,'merged_Pressure' , p_merg ncdf_varget,id,'merged_Temperature', t_merg ;- Cal, Housekeeping, Other ncdf_varget,id,'Alt_Reg_Shift' , alt_reg_shift ; Altitude registration ncdf_varget,id,'Attenuation' , bal_atten ; balance attenuator setting for 16 bands ncdf_varget,id,'SLDC' , sldc ; Allen curves, arr(event,detector,angle) ncdf_varget,id,'scan_angle' , sldc_angle ; arr(event,angle) ncdf_varget,id,'DetectorTemp' , t_det ; detector temps t_midopt = 0 k = where(varname eq 'mid_optics_bracket_temperature' ,nk) if nk gt 0 then ncdf_varget,id,'mid_optics_bracket_temperature', t_midopt ; mid optics temps (C) sig_exo = 0 k = where(varname eq 'Signal_Offset' ,nk) if nk gt 0 then ncdf_varget,id,'Signal_Offset', sig_exo ; arr(event,detector) ;- Sun sensor data ncdf_varget,id,'Refraction_Angle', refr_ang ncdf_varget,id,'SolarExtent', sol_ext k = where(varname eq 'LowEl' ,nk) & if nk gt 0 then ncdf_varget,id,'LowEl' , el_lo k = where(varname eq 'HighEl',nk) & if nk gt 0 then ncdf_varget,id,'HighEl', el_hi k = where(varname eq 'LowAz' ,nk) & if nk gt 0 then ncdf_varget,id,'LowAz' , az_lo k = where(varname eq 'HighAz',nk) & if nk gt 0 then ncdf_varget,id,'HighAz', az_hi ;- close the file ncdf_close,id ;- done return end