source: trunk/SRC/ToBeReviewed/IMAGE/animgif.pro @ 238

Last change on this file since 238 was 238, checked in by pinsard, 17 years ago

improvements/corrections of some *.pro headers

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.3 KB
Line 
1;+
2;
3; @file_comments
4; Build a gif animation
5;
6; @categories
7; Animated drawings.
8;
9; @param NOMFIC {in}{required}
10; It is the name of the gif file containing the animation.
11;          Comment: this file is placed in the directory defined by iodir.
12;
13; @uses
14; common.pro
15;
16; @restrictions
17; We use the Z buffer to go faster!.
18;              So, if it failed in animgif, you have to do:
19;              IDL> device, /close
20;              IDL> set_plot, 'x'
21;              IDL> retall
22;
23; @restrictions
24; If we want to delete the \@common,
25;               we have to define manually the picture's size
26;               (variables xsize and ysize) just as iodir.
27;
28; @history
29; Guillaume Roullet (grlod\@ipsl.jussieu.fr)
30;          Sebastien Masson (smasson\@lodyc.jussieu.fr)
31;          30/4/1999
32;
33; @version
34; $Id$
35;
36;-
37;
38PRO animgif, nomfic
39;
40  compile_opt idl2, strictarrsubs
41;
42@common
43;
44;  It recuperates the color palette and put it in red, green, blue.
45;
46   tvlct,  rouge,vert,bleu,/get
47;
48;  It completes the current palette on 256 colors.
49;
50   red = [rouge, replicate(255, 256-n_elements(rouge))]
51   green = [vert, replicate(255, 256-n_elements(rouge))]
52   blue = [bleu, replicate(255, 256-n_elements(rouge))]
53;
54; It rocks on the z device, allowing to create the picture without display it.
55   thisOS = !VERSION.OS_FAMILY
56   thisOS = STRMID(thisOS, 0, 3)
57   thisOS = STRUPCASE(thisOS)
58   set_plot, 'z'
59; size of the picture (in pixel):
60   xsize = 30*(min(page_size, max = ma)*key_portrait + ma*(1-key_portrait))
61   ysize = 30*(min(page_size, max = ma)*(1-key_portrait) + ma*key_portrait)
62   device, set_resolution = [xsize, ysize]
63;
64; Beginning of the gif file. Writing of an empty picture.
65;
66   reinitplt
67   plot, [0], [0], /nodata
68   write_gif,iodir+nomfic,tvrd(),red, green, blue, /multiple
69;
70;
71;----------------------------------------------------------------
72; Beggining of the part we want to change.
73;----------------------------------------------------------------
74;
75; Loop of picture's creation.
76;
77   calen = TIMEGEN(366, START=JULDAY(1,1,2000))
78   debut = where(calen EQ 19810105)
79   debut = where(calen EQ 19790105)
80   debut = debut[0]
81   if debut EQ -1 then begin
82      device, /close
83      CASE thisOS of
84         'MAC': SET_PLOT, thisOS
85         'WIN': SET_PLOT, thisOS
86         ELSE: SET_PLOT, 'X'
87      ENDCASE
88      stop
89   endif
90
91   for i = 0, 73*15-1 do begin
92;   for i = 0, 3*2-1 do begin
93;   for i = 0, 73*2-1 do begin
94;     print, 'Image numero : '+strtrim(i, 2)
95      date = calen[debut+i]
96      erase, 255
97      plt, nlec('sst', date, 'ATF'), 19, 29, int = .5, /noerase
98;      plt, nlec('sss', date, 'ATF'), label = 2, /noerase
99;      plt, nlec('htoth', date, 'RE3')-nlec('hpycn', date, 'RE3'), 10, 60, int = 5, /inv, /noerase
100;      domdef, 290,340,-5,15
101;      plt, norme(nlec('unsurf', date, 'RE3'), nlec('vnsurf', date, 'RE3')), 0, 1.2, int = .1, /noerase
102;
103;     Writing of the picture in the file .gif.
104;
105      write_gif,iodir+nomfic,tvrd(),red, green, blue, /multiple
106   ENDFOR
107;----------------------------------------------------------------
108; End of the part we want to change.
109;----------------------------------------------------------------
110;
111; Closing of the file.
112   write_gif,iodir+nomfic,/close
113; Rerock on terminal X mode.
114;   device, /close
115   CASE thisOS of
116      'MAC': SET_PLOT, thisOS
117      'WIN': SET_PLOT, thisOS
118      ELSE: SET_PLOT, 'X'
119   ENDCASE
120
121
122   return
123end
Note: See TracBrowser for help on using the repository browser.