;+ pro read_vec, file = file ; ; Purpose: The purpose of this program is to read in a vector file ; and output the variables as a common block. ; COMMON VECDATA, time,ms_time,ut_date,ut_time,lat,lon,alt_retrieved,ref_alt,sza,lst,lza,ilat,mlon,track,table_id,measure_track,flight_dir,ascending,in_saa,u,var_u,v,var_v,ver2,var_ver2,back2,var_back2,chi_square,p_status,data_ok ; ; Author: Marie Cooper ; Created: November 10, 2005 ;- if ( NOT KEYWORD_SET( file ) ) then begin ;; Bring up a dialog box to find file to read filter = '*VEC*' vecfile = '' vecfile = dialog_pickfile( /must_exist, /read, $ path = '/data/tidi/vector/', $ filter = filter, $ title = 'Select a Vector File' ) if vecfile eq '' then begin print, 'vec_summary-I-no file selected' return endif endif else begin vecfile = strtrim(file, 2) endelse ;; Open the vector file and read in all the variables print, 'Reading in variables...' ncidl = NCDF_OPEN( vecfile, /nowrite ) ncdf_varget, ncidl, 'time', time ncdf_varget, ncidl, 'ms_time', ms_time ncdf_varget, ncidl, 'ut_date', ut_date ncdf_varget, ncidl, 'ut_time', ut_time ncdf_varget, ncidl, 'lat', lat ncdf_varget, ncidl, 'lon', lon ncdf_varget, ncidl, 'alt_retrieved', alt_retrieved ncdf_varget, ncidl, 'ref_alt', ref_alt ncdf_varget, ncidl, 'sza', sza ncdf_varget, ncidl, 'lst', lst ncdf_varget, ncidl, 'lza', lza ncdf_varget, ncidl, 'ilat', ilat ncdf_varget, ncidl, 'mlon', mlon ncdf_varget, ncidl, 'track', track ncdf_varget, ncidl, 'table_id', table_id ncdf_varget, ncidl, 'measure_track', measure_track ;;Warm or Cold Side ncdf_varget, ncidl, 'flight_dir', flight_dir ncdf_varget, ncidl, 'ascending', ascending ncdf_varget, ncidl, 'in_saa', in_saa ncdf_varget, ncidl, 'u', u ; Zonal Wind ncdf_varget, ncidl, 'var_u', var_u ncdf_varget, ncidl, 'v', v ; Meridional Wind ncdf_varget, ncidl, 'var_v', var_v ncdf_varget, ncidl, 'ver2', ver2 ; O2 Emission Rate ncdf_varget, ncidl, 'var_ver2', var_ver2 ncdf_varget, ncidl, 'back2', back2 ; LOS bckgrnd at 762 nm ncdf_varget, ncidl, 'var_back2', var_back2 ncdf_varget, ncidl, 'chi_square', chi_square ; chi^2 for the fit ncdf_varget, ncidl, 'p_status', p_status ncdf_varget, ncidl, 'data_ok', data_ok ;; Some variables must be changed from BYTES to STRINGS measure_track = STRING(measure_track) flight_dir = STRING(flight_dir) ascending = STRING(ascending) ut_date = STRING(ut_date) data_ok = STRING(data_ok) in_saa = STRING(in_saa) NCDF_CONTROL, ncidl, /noverbose if ( NCDF_VARID( ncidl, 't_doppler' ) ne -1 ) then begin ncdf_varget, ncidl, 't_doppler', d_temp endif else if ( KEYWORD_SET( dop_t ) ) then begin print, 'There is no Doppler Temperature in vector file' endif if ( NCDF_VARID( ncidl, 't_rot' ) ne -1 ) then begin ncdf_varget, ncidl, 't_rot', r_temp endif else if ( KEYWORD_SET( rot_t ) ) then begin print, 'There is no Rotational Temperature in vector file' endif NCDF_CONTROL, ncidl, /verbose ;; Close the vector file NCDF_CLOSE, ncidl END ;:;