; ; Sample program to plot the DEUA ASCII files. ; ; Nomad Research, Inc. ; Project 98-2 ; Written by W. Dean Pesnell ; Started 03-MAR-1998 ; Modifications ; 24-APR-1999: WDP, added comments and checked plots ; ;+ ; NAME: deuaplot.pro ; ; PURPOSE: Read a single day of data from the DEUA ASCII data files and ; plot various quantities. ; ; ; ; CALLING SEQUENCE: Compile and run from prompt ; ; INPUTS: Must set the directory string in FILENAME to the setting for ; your machine. ; ; KEYWORD PARAMETERS: None ; ; OUTPUTS: Graphs ; ; EXAMPLE: ; ; COMMENTS: The routines START_PLOT.PRO and END_PLOT.PRO are service ; routines that can be removed from DEUAPLOT.PRO. ; ;- ; read, prompt='YYDDD? ', YYDDD ; ; Local value of directory is needed in FILENAME ; filename = 'DKA103:[PESNELL.DEASC]DE' + string( format='(i5.5)', yyddd) + '.asc' comp_file = findfile( filename, count=n_files) ; ; Illustration of how MAP was adapted from the Fortran code ; map = [-32, -33, -34, -37, 2, 6 ] if( n_files gt 0 ) then begin close, 1 openr, 1, comp_file(0) npts = 0 readf, 1, npts ; ; This structure stores the DE data in an ordered fashion. ; de_struc = { DE_2, UT_secs: 0L, orbit: 0L, altitude: 0.0, $ latitude: 0.0, longitude: 0.0, $ LST: 0.0, LMT: 0.0, Lshell: 0.0, lat_inv: 0.0, SZA: 0.0, $ NACS_N2: 0.0, NACS_O: 0.0, NACS_HE: 0.0, NACS_AR: 0.0, $ NACS_N: 0.0, $ WATS_TN: 0.0, WATS_NVE: 0.0, WATS_NVU: 0.0, $ LANG_NP: 0.0, LANG_TE: 0.0, $ FPI_FWAV: 0.0, FPI_FALT: 0.0, FPI_FVN: 0.0, FPI_FTEM: 0.0, $ FPI_RAY: 0.0, $ RPA_TI: 0.0, RPA_NI: 0.0, RPA_IVE: 0.0, RPA_IVN: 0.0, $ RPA_IVU: 0.0 } ; ; Get a single day's data and store in DE_data ; DE_data = replicate( {DE_2}, npts ) time = lonarr(npts) orbit = lonarr(npts) ind_data = 0 readf, 1, ind_data readf, 1, time DE_data(*).UT_secs = time readf, 1, ind_data readf, 1, orbit DE_data(*).orbit = orbit rdata = fltarr(npts) names = tag_names(DE_data) n_tags = n_elements(names) for imap=2, n_tags-1 do begin readf, 1, ind_data readf, 1, rdata print, imap, ind_data, ', ', names(imap), rdata(npts-1) DE_data(*).(imap) = rdata endfor close, 1 ; ; Work with the data requested by MAP. ; safe = where( DE_data(*).Lshell gt 0, n_safe ) !p.title = '!6DE-2 Data for ' + string(YYDDD, format='(i5.5)' ) !x.title = '!6' + names(7) !y.title = '!6' + names(8) plot, DE_data(safe).Lshell, DE_data(safe).lat_inv, $ yrange=[0.,90.], /ystyle, yticks=6, yminor=3 ; goto, skip_rest orbit_min = min(DE_data.orbit) orbit_max = max(DE_data.orbit) for orbit=orbit_min, orbit_max do begin this_orbit = where( DE_data(*).orbit eq orbit, n_orbs ) if( n_orbs gt 0 ) then begin n_map = n_elements( map ) !p.title = '!6DE-2 Data for ' + string(YYDDD, format='(i5.5)' ) $ + ', Orbit: ' + strtrim(string(orbit, format='(i6)' ),2) !x.title = '!6' + names(0) !y.title = '!6' + names(9+1) ; safe = where( DE_data(this_orbit).NACS_N2 gt 0., n_safe) ; if( n_safe gt 1 ) then begin ; start_plot, n_win, 'deua_1' ; plot_io, DE_data(this_orbit(safe)).UT_secs/3600., $ ; DE_data(this_orbit(safe)).NACS_N2, $ ; yrange=[1.e5,1.e10] ; end_plot ; safe = where( DE_data(this_orbit).NACS_O gt 0.) ; !y.title = '!6' + names(9+2) ; oplot, DE_data(this_orbit(safe)).UT_secs/3600., $ ; DE_data(this_orbit(safe)).NACS_O, line=2 ; endif ; safe = where( (DE_data(this_orbit).NACS_N2 gt 0.) and $ ; (DE_data(this_orbit).NACS_O gt 0.), n_safe ) ; !x.title = '!6' + names(9+2) ; !y.title = '!6' + names(9+1) ; if( n_safe gt 1 ) then begin ; start_plot, n_win, 'deua_1' ; plot_oo, DE_data(this_orbit(safe)).NACS_O, $ ; DE_data(this_orbit(safe)).NACS_N2, psym=2 ; end_plot ; endif safe = where( DE_data(this_orbit).WATS_TN gt 0., n_safe) if( n_safe gt 1 ) then begin ; !x.title = '!6' + names(0) !x.title = '!6' + names(3) !y.title = '!6' + names(9+6) start_plot, n_win, 'deua_1' ; plot, DE_data(this_orbit(safe)).UT_secs/3600., $ plot, DE_data(this_orbit(safe)).latitude, $ DE_data(this_orbit(safe)).WATS_TN, /ynozero, $ xrange=[-90.,90.], /xstyle, xticks=6, xminor=3 end_plot endif endif endfor endif skip_rest: end