pro selhist,cube,nom,whichplot ;------------------------------------------ ; 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 ; BOXP - A two element vector: [resolution_size,pixel_size] ; WHICHPLOT - A vector containing the indexes of the plots ; to be plotted ;------------------------------------------ set_plot,'ps',/copy device,file=nom,/inches,xoffset=0.5,yoffset=0.5,ysize=10,xsize=7.5,/color,$ bits=8,/portrait erase a=replicate(255,256)-findgen(256) b=findgen(256) sz=size(whichplot) numberplot=sz(1) 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) 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=histogram(dit,min=mini,max=maxi,binsize=bins) norm=float(max(H)) nuval=float(H)/norm H=nuval mom=moment(dit) X=findgen(100)*bins+mini ttlecat=string(ttles(q)," !8!NDistibution") plot,x,H,psym=10,title=ttlecat,position=pos0,/noerase,$ ytitle='Normalized Distribution',$ xtitle='Value',charsize=3,ycharsize=.6,xcharsize=0.6 ;mn=string(format='("Mean= ",(F))',mom(0)) ;mn=strcompress(mn) ;devi=string(format='("Dispersion= ",(F))',sqrt(mom(1))) ;devi=strcompress(devi) ;xyouts,posbar(0),posbar(1),mn,/normal,charsize=0.9 ;xyouts,posbar(2),posbar(3),devi,/normal,charsize=0.9 print,mom ed: erase endfor device,/close set_plot,'x' end