pro FOND, tab, fon,sigma
if n_elements(tab) gt 1 then sigma=10.*stdev(tab,fon) else begin $
fon=tab(0) & sigma=0
endelse
encore:
test=where(abs(tab-fon) lt 2.5*sigma)
if n_elements(test) eq 1 then return
sigma=stdev(tab(test),moy)
if moy eq fon then return
fon=moy
goto,encore
end
pro FAIT_FOND, tab,fichier, f,s
nf=n_elements(tab(0,*))
f=fltarr(nf) & s=fltarr(nf)
mintab=min(tab)
for i=0,nf-1 do begin
test=where(tab(*,i) gt mintab)
if test(0) ne -1 then begin
FOND,tab(test,i),ff,ss
f(i)=ff & s(i)=ss
endif
endfor
if fichier ne '' then save,f,s,filename=fichier
return
end
pro RETIRE_FOND, f,s,seuil, tab
for i=0,n_elements(tab(*,0))-1 do tab(i,*)=(tab(i,*)-f-seuil*s) >0
return
end
pro SPDYNPS, image,xmin,xmax,ymin,ymax,legende_x,legende_y,titre, $
grid,fond,seuil,fracmin,fracmax,color,bar_titre, log=log, $
posxmin=posxmin,posymin=posymin,posxmax=posxmax,posymax=posymax,$
col_scale=col_scale
if n_elements(xmin) eq 0 or n_elements(xmax) eq 0 then begin
xmin=0 & xmax=n_elements(image(*,0))
endif
if n_elements(ymin) eq 0 or n_elements(ymax) eq 0 then begin
ymin=0 & ymax=n_elements(image(0,*))
endif
if n_elements(legende_x) eq 0 then legende_x=' '
if n_elements(legende_y) eq 0 then legende_y=' '
if n_elements(titre) eq 0 then titre=' '
if n_elements(grid) eq 0 then grid=0
if n_elements(fond) eq 0 then fond=0
if n_elements(seuil) eq 0 then seuil=0
if n_elements(fracmin) eq 0 or n_elements(fracmax) eq 0 then begin
fracmin=0.05 & fracmax=0.95
endif
if n_elements(color) eq 0 then color=0
if n_elements(bar_titre) eq 0 then bar_titre=' '
tab=image
if fond eq 1 then begin
FAIT_FOND, tab,'', f,s
RETIRE_FOND, f,s,seuil, tab
endif
if fracmin ge 0 and fracmax ge 0 then begin
if (fracmin ne 0.) or (fracmax ne 1.) then begin
DYN, tab,fracmin,fracmax, tabmin,tabmax
if tabmax eq -1 then RETURN
tab=bytscl(tab,min=tabmin,max=tabmax)
endif else begin
test=where(tab gt min(tab))
tabmin=min(tab(test)) & tabmax=max(tab(test))
tab=bytscl(tab,min=tabmin,max=tabmax)
endelse
endif
if fracmin lt 0 then begin
tabmin=fracmin & tabmax=fracmax
tab=bytscl(tab,min=tabmin,max=tabmax)
endif
if color eq 0 then tab=255-tab
print,'Writing in Postscript file ...'
tl=-0.015
if grid eq 1 then tl=1.0
nx=!p.multi(1) & ny=!p.multi(2)
if nx eq 0 then nx=1
if ny eq 0 then ny=1
x=!p.multi(0)
if x ne 0 then x=nx*ny-x
i=x mod nx
j=ny-(x-i)/nx-1
dx=(0.9-0.1*nx)/nx & dy=(0.9-0.1*ny)/ny
if ~keyword_set(posxmin) then posxmin=0.08+i*(0.12+dx)
if ~keyword_set(posymin) then posymin=0.14+j*(0.1+dy)
if ~keyword_set(posxmax) then posxmax=posxmin+dx
if ~keyword_set(posymax) then posymax=posymin+dy
cm=1. & if nx ge 3 or ny ge 3 then cm=1.5
if keyword_set(log) then $
plot_io, [xmin,xmax], [ymin,ymax], /nodata, xra=[xmin,xmax], xstyle=13, $
yra=[ymin,ymax], ystyle=13, title=titre, ticklen=tl, charsize=1.1*cm, $
pos = [posxmin,posymin,posxmax,posymax] else $
plot, [xmin,xmax], [ymin,ymax], /nodata, xra=[xmin,xmax], xstyle=13, $
yra=[ymin,ymax], ystyle=13, title=titre, ticklen=tl, charsize=1.1*cm, $
pos = [posxmin,posymin,posxmax,posymax]
if keyword_set(col_scale) then loadct,33
tv, tab, !x.window(0), !y.window(0), xsize=!x.window(1)-!x.window(0), $
ysize=!y.window(1)-!y.window(0),/normal
if keyword_set(col_scale) then loadct,0
axis, xaxis=0, xra=[xmin,xmax], xstyle=1, xticklen=tl, $
xtitle=legende_x, charsize = 1.*cm
axis, xaxis=1, xra=[xmin,xmax], xstyle=1, xticklen=tl, $
xtickname=replicate(' ',9)
axis, yaxis=0, yra=[ymin,ymax], ystyle=1, yticklen=tl, $
ytitle=legende_y, charsize = 1.*cm
axis, yaxis=1, yra=[ymin,ymax], ystyle=1, yticklen=tl, $
ytickname=replicate(' ',9)
posxmin=posxmax+0.03*dx/0.8 & posymin=posymin+0.05*dy/0.8
posxmax=posxmin+0.03*dx/0.8 & posymax=posymax-0.05*dy/0.8
bar_tick = [' ','dB',' ']
if bar_titre eq '.' then begin
bar_titre=' ' & bar_tick = [' ',' ',' ']
endif
plot, [0,1], [0,1], /nodata, /noerase, xst=1, yst=12, $
pos = [posxmin,posymin,posxmax,posymax], $
/norm, xticklen=0, xticks=2, xtickv=[0,0.5,1], $
xtickname=bar_tick, xtitle=bar_titre, charsize=1.1*cm
axis, /yaxis, yra=[tabmin,tabmax], ticklen=-0.02, /ysty, charsize=1.*cm
bcb = bytscl(replicate(1,10)#bindgen(256))
if color eq 0 then bcb=255-bcb
if keyword_set(col_scale) then loadct,33
tv, bcb, !x.window(0), !y.window(0), xsize = !x.window(1) - !x.window(0), $
ysize = !y.window(1) - !y.window(0), /normal
if keyword_set(col_scale) then loadct,0
oplot, [1,0,0,1], [1,1,0,0]
RETURN
END
pro HELP_SPDYNPS
print,'SPDYNPS, image, xmin,xmax,ymin,ymax, legende_x,legende_y,titre, $'
print,' grid,fond,seuil,fracmin,fracmax,color,bar_titre, [/log]'
return
end