; pro getbrass,uarsday,datstruct,datfile=datfile,ps=ps,log10=log ; ; Get Uars Solstice fluxes in Guy Brasseur's bins: ; Used Mgii.pro to determine uars solar min day is 1357, and ; uars solar max day is 144, however flux is not available ; for day 1357, so used Mgii.pro to determine 6 min days, ; and flux is available for the 6th min, which was on day 1417, so: ; smin = day 1417 ; smax = day 144 ; if n_elements(uarsday) eq 0 then begin print,'Usage: getbrass,uarsday,[datfile],ps=ps' return endif date = udate_to_vms(uarsday) print,'uarsday=',uarsday,' date=',date(0) if keyword_set(datfile) gt 0 then print,'datfile=',datfile if keyword_set(ps) then print,'Will make ps file' format="(i5,2f12.2,f9.2,e15.4)" title = 'UARS DAY ' + string(uarsday,format="(i5)") + ' (' + date(0) + ')' ; ; Get Solstice fluxes: ; print,'calling get_brasseur_bins...' get_brasseur_bins,uarsday,bins datstruct = bins nbins = n_elements(bins.flux) print,'nbins=',nbins ; ; Write to ascii file: ; if keyword_set(datfile) gt 0 then begin openw,luwr,datfile,/get_lun printf,luwr,title printf,luwr,format="(' bin wv_low wv_high wv_del flux')" for i=0,nbins-1 do begin printf,luwr,i+1,bins.wv_low(i),bins.wv_high(i),$ bins.wv_high(i)-bins.wv_low(i),bins.flux(i),format=format endfor close,luwr print,'Wrote file ',datfile free_lun,luwr endif ; ; Plot fluxes (uars fluxes are non-zero) ; plot: if (keyword_set(ps)) then begin set_plot,'PS' psfile = 'day'+strcompress(string(uarsday),/remove_all)+'.ps' device,filename=psfile endif else set_plot,'X' iflux = where(bins.flux ne 0.) flux = bins.flux(iflux) ibins = indgen(nbins) ibins = ibins(iflux)+1 ;print,'ibins=' & print,ibins ;print,'flux=' & print,flux if keyword_set(log) then $ plot_io,ibins,flux,title=title,xtitle='BRASSEUR BIN INDEX',$ ytitle='SOLSTICE FLUX (photons/s/cm^2)',xmargin=[13,5] $ else $ plot,ibins,flux,title=title,xtitle='BRASSEUR BIN INDEX',$ ytitle='SOLSTICE FLUX (photons/s/cm^2)',xmargin=[13,5] ; if (keyword_set(ps)) then begin device,/close_file print,'Wrote plot to file ',psfile endif return end ; ;ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc ; pro getsminmax,sminday,smaxday,datfile ; ; Call getbrass (above) for solar min and solar max, and make ; data file suitable for import to glbmeans: ; getbrass,sminday,sminstruct getbrass,smaxday,smaxstruct ; openw,luwr,datfile,/get_lun nbins = n_elements(sminstruct.flux) ;printf,luwr,format="(' bin wv_low wv_high smin smax nbins=',i4)",nbins printf,luwr,format="(2x,'bin',6x,'wv_low',6x,'wv_high',4x,'day',i4,'(smin)',2x,'day',i4,'(smax)',3x,'nbins=',i4,5x)",sminday,smaxday,nbins format="(i5,2f12.2,2e15.4)" for i=0,nbins-1 do begin printf,luwr,i+1,sminstruct.wv_low(i),sminstruct.wv_high(i),$ sminstruct.flux(i),smaxstruct.flux(i),format=format endfor close,luwr print,'Wrote file ',datfile free_lun,luwr return end