;8 PRO plot_spectra, tt0_, struc_, time=a_t, levels=ll, edits=ee, color=col, _EXTRA=eee @~vgr/idl/common.types ; ; ; NAME: ; plot_spectra ; ; PURPOSE: ; plots and/or prints plots spectra ; ; ; CATEGORY: ; ; CALLING SEQUENCE: ; plot_spectra ,[ tt0,] struc, time=a_t, levels=ll, edits=ee , color=col _EXTRA=eee ; ; INPUTS: ; spectra can either be voy_*, or jdata ; time can either be the limets of time, or a do type range ; levels is an array giving the energy levels to be plotted ; ; ; ; OUTPUTS: ; ; COMMON plt_common ; ; SIDE EFFECTS ; None. ; ; PROCEDURE: ; ; ;- ; plot_spectra ,[ tt0,] struc, time=a_t, levels=ll, edits=ee , color=col _EXTRA=eee n_p = n_params() if ( n_p eq 1 ) then begin struc = tt0_ endif else if ( n_p eq 2 ) then begin tt0 = tt0_ struc = struc_ endif else begin print ,"wrong number of arguments to plot_spectra ", n_p return endelse i = tag_to_index( struc, 'day') if ( i ge 0 ) then jdata = struc.jdata else jdata = struc nnn = size( jdata) n_ran = 1 if ( n_elements( ll) gt 0 ) then begin ; jdata = jdata( ll(0):ll(1),* ) n = nnn( 1) if ( n gt 16 ) then n_cups = 4 else n_cup = 1 ndat = nnn( 1)/4 if ( n_cups eq 1 or ll(1) gt ndat ) then begin jdata = jdata( ll(0):ll(1), *) endif else begin j1 = jdata( ll(0):ll(1), *) j2 = jdata( ll(0)+ndat:ll(1)+ndat, *) j3 = jdata( ll(0)+2*ndat:ll(1)+2*ndat, *) j4 = jdata( ll(0)+3*ndat:ll(1)+3*ndat, *) jdata = [ j1, j2, j3, j4] n_ran = 4 endelse nnn = size( jdata) endif nn = n_elements( a_t) if ( n_elements( a_t) lt 1 ) then tt1 = 0 else tt1 = a_t( 0) if ( n_elements( a_t) lt 2 ) then tt2 = 0 else tt2 = a_t( 1) if ( n_elements( a_t) lt 3 ) then ttd = 1 else ttd = a_t( 2) if ( n_elements( a_t) lt 4 ) then ttr = 9 else ttr = a_t( 3) jj = replicate( jdata(0,0), nnn( 1), ttr) t_l = findgen( nnn(1)) ttn = tt1 while ( ttn ne -1 )do begin for i=0, ttr-1 do begin jj( *, i) = jdata( *, ttn) ttn = ttn + ttd endfor if ( n_p eq 2 ) then begin day_to_time,tt0(ttn-1), yr, day, hr,min,sec label = string( yr, day, hr, min, sec) !p.title = label endif else begin !p.title = '' endelse print_plot, t_l, jj, x_altaxis=4,/y_order, _EXTRA=eee !p.title = '' tt1 = tt1 + ttd*ttr a = get_kbrd(1) if ( a eq 'q' ) then ttn = -1 endwhile end ; plot_spectra