Документ взят из кэша поисковой машины. Адрес оригинального документа : http://xmm.vilspa.esa.es/calibration/ept/idl/plotPSuzaku.pro
Дата изменения: Mon Mar 17 18:10:32 2008
Дата индексирования: Sun Apr 10 14:00:59 2016
Кодировка:

Поисковые слова: phoenix
PRO plotpar, target=target,obsid=obsid,rev=rev,vn=vn

; to disinguish between the use for par(version) and par(revolution)
; more than 8 letters is a version

discrim=strlen(vn)


if (discrim(0) GT 8) then main_xtitle='Calibration Version '
if (discrim(0) LE 8) then main_xtitle='Revolution '




;target='xxx'
;obsid='yyy'
;rev='zzz'
;vn='www'


spawn, 'ls -1 my_*.txt > parall.txt'
readcol, 'parall.txt', versions, format='(a)'

spawn, 'rm parall.txt'

e=n_elements(versions)

par_num=numlines(versions(0))-1


j =fltarr(par_num,e)
m1 =fltarr(par_num,e)
m2 =fltarr(par_num,e)
pn =fltarr(par_num,e)
r1 =fltarr(par_num,e)
r2 =fltarr(par_num,e)
x0 =fltarr(par_num,e)
x1 =fltarr(par_num,e)
x2 =fltarr(par_num,e)
x3 =fltarr(par_num,e)






readcol, versions(0), name, format='(A,)'
x=findgen(n_elements(versions))

for i=0,e-1 do begin
print, "i:",i


readcol, versions(i), dummy, $
ji, m1i, m2i, pni, r1i, r2i, x0i, x1i, x2i, x3i, format='(A,f,f,f)'

for k=0,par_num-1 do begin
print, "k:",k
;print,ji(*)
;print,n_elements(j(*,i)),n_elements(j(k,*)),k,i,n_elements(ji)



j(k, i)= ji(k)/ji(k)
m1(k, i)= m1i(k)/ji(k)
m2(k, i)= m2i(k)/ji(k)
pn(k, i)= pni(k)/ji(k)
r1(k, i)= r1i(k)/ji(k)
r2(k, i)= r2i(k)/ji(k)
x0(k, i)= x0i(k)/ji(k)
x1(k, i)= x1i(k)/ji(k)
x2(k, i)= x2i(k)/ji(k)
x3(k, i)= x3i(k)/ji(k)





endfor
endfor


;stop
set_plot,'ps'
device, filename="params.ps",/portrait,xsize=21, ysize=28,yoffset=0,/times, /color

noticks=replicate(' ',8)
symsize=1.5
thick=10
loadct,13


xdyn=(max(x)-min(x))*0.02
xmin=min(x)-xdyn
xmax=max(x)+xdyn

for k=1,par_num do begin

print, "print:", k
;for k=1,1 do begin
par_name=name(k)
;pos=[0.15,0.73,0.95,0.95]

pydynmin=1.0*(k-1)/(par_num)+0.05
pydynmax=1.0*(k)/(par_num)

print, pydynmin
print, pydynmax

pos=[0.06,pydynmin,0.82,pydynmax]




yall=[x0(k-1, *),$
x1(k-1, *),$
x2(k-1, *),$
x3(k-1, *),$
j(k-1, *) , $
m1(k-1, *), $
m2(k-1, *), $
pn(k-1, *), $
r1(k-1, *), $
r2(k-1, *)]







indexy=where( yall NE 0)

; hack - just debugging while there are still 0 parameter --> ask micheal why
;if (indexy(0) EQ -1) then begin
; indexy(0)=0
; yall(0)=1 ;0.123
; print,yall
;endif
; end hack

if (total(yall) GT 0) then begin
yall=yall(indexy)
endif; else begin
;yall=yall
;endelse


if (total(yall) EQ 0) then yall=yall

ydyn=(max(yall)-min(yall))*0.2
if (max(yall) eq min(yall)) then begin
ymin=min(yall)*0.9
ymax=max(yall)*1.1
endif

if (max(yall) ne min(yall)) then begin
ymin=min(yall)-ydyn
ymax=max(yall)+ydyn
endif


symsize=2

plot, x, j(k-1,*) , psym=2,/noerase, $
xtitle=" ",$
ytitle=par_name, xstyle=1,ystyle=1, thick=4, $
position=pos, charsize=4.5/par_num, symsize=symsize,$
/color,xrange=[xmin,xmax], yrange=[ymin,ymax], /nodata

oplot, x, j(k-1,*), psym=1, color=0, thick=4, symsize=symsize
oplot, x, pn(k-1,*), psym=2, color=0, thick=4, symsize=symsize
oplot, x, m1(k-1,*), psym=4, color=240, thick=4, symsize=symsize
oplot, x, m2(k-1,*), psym=4, color=160, thick=4, symsize=symsize
oplot, x, r1(k-1,*), psym=4, color=60, thick=4, symsize=symsize
oplot, x, r2(k-1,*), psym=4, color=110, thick=4, symsize=symsize

plotsym, 3 ,/FILL
if (total(x0(k-1, *)) NE 0) then oplot, x,x0(k-1, *),psym=8, color=30, thick=4, symsize=symsize
if (total(x1(k-1, *)) NE 0) then oplot, x,x1(k-1, *),psym=8, color=40, thick=4, symsize=symsize
if (total(x2(k-1, *)) NE 0) then oplot, x,x2(k-1, *),psym=8, color=220, thick=4, symsize=symsize
if (total(x3(k-1, *)) NE 0) then oplot, x,x3(k-1, *),psym=8, color=230, thick=4, symsize=symsize






;fitj=linfit(x, j(k-1,*))
;fitp=linfit(x, p(k-1,*))
;fitm1=linfit(x, m1(k-1,*))
;fitm2=linfit(x, m2(k-1,*))
;fitr1=linfit(x, r1(k-1,*))
;fitr2=linfit(x, r2(k-1,*))


;oplot, x, (fitj(1)*x+fitj(0)) , color=0, thick=4, linestyle=2
;oplot, x, (fitp(1)*x+fitp(0)) , color=0, thick=4
;oplot, x, (fitm1(1)*x+fitm1(0)) , color=240, thick=4
;oplot, x, (fitm2(1)*x+fitm2(0)) , color=160, thick=4
;oplot, x, (fitr1(1)*x+fitr1(0)) , color=60, thick=4
;oplot, x, (fitr2(1)*x+fitr2(0)) , color=110, thick=4

axis, xaxis=1, xstyle=1, xtickname=strarr(30)+' '


axis, xaxis=0, xstyle=1,xtickname=vn, charsize=0.8,XTICKINTERVAL=1


;if (k EQ 1) then begin
; axis, xaxis=0, xstyle=1,xtickname=vn,XTICKINTERVAL= 1, charsize=1.
;endif else begin
; axis,xaxis=0, xstyle=1, xtickname=strarr(30)+' '
;endelse



;axis, xaxis=1, xstyle=1, xtickname=strarr(30)+' '

;axis, xaxis=0, xstyle=1, xtitle="energy ban", charsize=2.,

xyouts, 0.40,1.03, target, /normal, charsize=1.8, charthick=1.5,$
ALIGNMENT=0.5
xyouts, 0.1,1.01, "Rev: "+rev, /normal, charsize=1.5, charthick=1.5
xyouts, 0.6,1.01, obsid, /normal, charsize=1.5, charthick=1.5





xyouts, 0.83,0.95, "joint", /normal, charsize=1., charthick=1.5, color=0
xyouts, 0.83,0.93, "(dashed) ", /normal, charsize=1., charthick=1.5, color=0
xyouts, 0.83,0.90, "pn ", /normal, charsize=1.3, charthick=1.5, color=0
xyouts, 0.83,0.85, "MOS1 ", /normal, charsize=1.3, charthick=1.5, color=240
xyouts, 0.83,0.80, "MOS2 ", /normal, charsize=1.3, charthick=1.5, color=160
xyouts, 0.83,0.75, "RGS1 ", /normal, charsize=1.3, charthick=1.5, color=60
xyouts, 0.83,0.70, "RGS2 ", /normal, charsize=1.3, charthick=1.5, color=110


if (total(x0(k-1, *)) NE 0) then xyouts, 0.83,0.65, "x0", /normal, charsize=1.3, charthick=1.5, color=30
if (total(x1(k-1, *)) NE 0) then xyouts, 0.83,0.60, "x1", /normal, charsize=1.3, charthick=1.5, color=40
if (total(x2(k-1, *)) NE 0) then xyouts, 0.83,0.55, "x2", /normal, charsize=1.3, charthick=1.5, color=220
if (total(x3(k-1, *)) NE 0) then xyouts, 0.83,0.5, "x3 ", /normal, charsize=1.3, charthick=1.5, color=230





if (total(yall) EQ 0) then begin
xyouts, 0.3,pydynmax*0.8, "parameter not used in fit", /normal, charsize=1., charthick=2.5

endif

endfor
xyouts, 0.4,0.01, main_xtitle, /normal, charsize=1.3, charthick=1.5,ALIGNMENT=0.5

device,/close
set_plot,'x'


end