summaryrefslogtreecommitdiff
path: root/idl/idlmovie3.pro
blob: d9a81c0bcdfeca8d76b459f69b032a553beeb21b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
pro idlmovie3

; ------ input -------------------------------------------------

 dimx0 = 400
 dimv0 = 400
 xmax0 = 5.0
 vmax0 = 1.0

 cutx  = 0
 dimx  = 400
 cutv  = 0
 dimv  = dimv0 - 2*cutv

 file01     = "phasex-1-sp0-"
 file02     = "phasex-2-sp0-"
 file03     = "phasex-3-sp0-"

 file_begin = 0.0
 file_end   = 7.0
 increment  = 1.0

; --------------------------------------------------------------

 special_file = -100

 s1     = dimx
 s2     = dimv
 xmin   = xmax0/dimx0 * cutx
 xmax   = xmin + xmax0/dimx0 * dimx
 ymax   = vmax0 - vmax0/dimv0 * cutv  
 x      = xmin + (xmax-xmin)/s1 * findgen(s1)
 y      = -ymax + 2.0*ymax/s2 * findgen(s2)

 print, cutv
 print, ymax

 set_plot,"x"
 window, 1, xpos=540, ypos=28, xsize=dimx+200, ysize=dimv+180, title="phasespace(x,v)"
 xoff=120
 yoff=100

 loadct,13
 tvlct, r, g, b, /get
 r(0) = 255
 g(0) = 255
 b(0) = 255
 r(1) = 0
 g(1) = 0
 b(1) = 0
 tvlct, r, g, b
 	 
 plot, x, y, xstyle=1, ystyle=1, xrange=[xmin,xmax], yrange=[-ymax,ymax],$
	xtitle="!3x/!7k!3", ytitle="!3v/c!3",ticklen=-0.02,$
	charsize=1.5, color=1, position=[xoff-1,yoff-1,xoff+s1+1,yoff+s2+1],$
	/noerase, /nodata, /device

 if (special_file lt -10) then begin
	i=-1
	repeat	begin
		i = i+1
		f = floor( 1000.0*(file_begin+increment*i)+0.5 ) / 1000.0
		if (f lt 10) then s = string( format='(F5.3)',f )
		if (f ge 10) then s = string( format='(F6.3)',f )

		file1 = file01 + s 
		print, file1
		openu,1,file1
		a1 = assoc(1,bytarr(dimx0,dimv0,/nozero))
		phase1 = extrac(a1(0),cutx,cutv,dimx,dimv)

		file2 = file02 + s 
		print, file2
		openu,2,file2
		a2 = assoc(2,bytarr(dimx0,dimv0,/nozero))
		phase2 = extrac(a2(0),cutx,cutv,dimx,dimv)

		file3 = file03 + s 
		print, file3
		openu,3,file3
		a3 = assoc(3,bytarr(dimx0,dimv0,/nozero))
		phase3 = extrac(a3(0),cutx,cutv,dimx,dimv)

		tvscl,alog10(1+phase1+phase2+phase3),xoff,yoff
		close,1
		close,2
		close,3
	endrep until ( f gt file_end-increment )
 endif else begin
        if (special_file lt 10) then s = string( format='(F5.3)',special_file )
	if (special_file lt 0) then s = string( format='(F6.3)',special_file )
        if (special_file gt 10) then s = string( format='(F6.3)',special_file )
	file = file1 + s 
	print, file
	openu,1,file
	a = assoc(1,bytarr(dimx0,dimv0,/nozero))
	phase = extrac(a(0),cutx,cutv,dimx,dimv)
	tvscl,alog10(1+phase),xoff,yoff
	close,1
 endelse
end