pro selhist,cube,nom,whichplot,screen ;------------------------------------------ ; Plots histograms of a data cube. ; The inputs to the routine include: ; CUBE - the data cube to be analyzed ; NOM - The name of the output postscript file ; WHICHPLOT - A vector containing the indexes of the plots ; to be plotted ; SCREEN - A flag which is equals 1 then will produce a ps file ;------------------------------------------ if screen eq 1 then begin set_plot,'ps',/copy device,file=nom,/inches,xoffset=0.5,yoffset=0.5,ysize=7.5,xsize=7.5,/color,$ bits=8,/portrait erase endif else set_plot,'x' whichplot=[whichplot] a=replicate(255,256)-findgen(256) b=findgen(256) numberplot=n_elements(whichplot) sz=size(cube) sx=float(sz(1)) sy=float(sz(2)) spam=float(sz(3)) fillfac=0.8 pos=float([0,0,1,1]) pos0=fillfac*pos+replicate((1-fillfac)/2,4) ttles=strarr(16) ttles=['!8S!Iij!3','!8l!8!Iij!3','!8s!Iij!3','!8S!Iij!El!3',$ '!8l!8!Iij!El!3','!8S!Iij!Es!N!3','!8s!Iij!Es!N!3','!8S!Iij!E0!N!3',$ '!8T!IA!E*!N!3','!4D!8v!3','!8v!ILSR!3','!8T!Iint!3','!4r!8!Irms!3',$ '!8T!E*!IA!N/!4r!8!Irms!3','!10"!8l!8!Iij!N!10"!3',$ '!10"!8l!8!El!Iij!N!10"!3','!10"!8l!8!Iij!N!10"!3',$ '!10"!8l!8!El!Iij!N!10"!3'] tlesup='Distribution' for i=0,numberplot-1 do begin q=whichplot(i) newpage: ;ylen=py1-py0-2*dply0 ;pos=[px0+dplx0,py0+dply0+offy,px1-dplx0,py1-dply0+offy] ;posbar=pos-[0.,(dply0+offy)*0.7,0.,(dply0+offy)*0.5+ylen] ;print,pos cub=cube(*,*,q) pointer=where(cub ne 99999.0) if pointer(0) eq -1 then begin xyouts,pos0(0),pos0(1),'No Valid Data',charsize=2 goto,ed endif dit=cub(pointer) ;mini=min(dit) ;maxi=max(dit) ;print,q,mini,maxi if q eq 0 or q eq 3 or q eq 5 or q eq 7 then begin mini=0. maxi=1. endif ;bins=(maxi-mini)/100 H=histarray(dit,pmin=mini,pmax=maxi,x=x1) norm=float(max(H)) nuval=float(H)/norm H=nuval mom=moment(dit) ttlecat=string(ttles(q)," !8!NDistibution") nbins=n_elements(x1) xtitles=[sigfig(x1(0),3),sigfig(x1(nbins/5.),3),sigfig(x1(2*nbins/5.),3),$ sigfig(x1(3*nbins/5.),3),sigfig(x1(4*nbins/5.),3),sigfig(x1(nbins-1),3)] minval=x1(0) maxval=x1(sz-1) if q eq 0 or q eq 3 or q eq 5 or q eq 7 then begin xtitles= ['0.0','0.2','0.4','0.6','0.8','1.0'] minval=0. maxval=1. endif H=float(H)/total(H) plot,x1,H,psym=10,title=ttlecat,position=pos0,/noerase,$ ytitle='Population Fraction',$ xtitle=ttles(q)+'!N Value '+units(q),xrange=[minval,maxval],xstyle=1 ;,xtickname=xtitles,xticks=5 ed: erase endfor device,/close set_plot,'x' end