source: trunk/SRC/ToBeReviewed/PLOTS/DESSINE/pltsc.pro @ 292

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

corrections of some headers and parameters and keywords case. change of pro2href to replace proidl

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.1 KB
Line 
1;+
2; @file_comments
3;
4; @categories
5;
6; @param TAB1
7;
8; @param TAB2
9;
10; @param MIN1
11;
12; @param MAX1
13;
14; @param MIN2
15;
16; @param MAX2
17;
18; @param VARNAME2
19;
20; @keyword BOXZOOM
21; Vector indicating the geographic zone on which we want to cut the map.
22;  If BOXZOOM has :
23; 1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]]
24; 2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]]
25; 4 elements: The extraction is made on [Boxzoom, 0, max([gdept, gdepw])]
26; 5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]]
27; 6 elements: The extraction is made on Boxzoom
28;
29; @keyword COL1D
30;
31; @keyword STY1D
32;
33; @keyword OV1D
34;
35; @keyword _EXTRA
36; Used to pass keywords
37;
38; @returns
39;
40; @uses
41;
42; @restrictions
43;
44; @examples
45;
46; @history
47;
48; @version
49; $Id$
50;
51; @todo seb
52;
53;-
54;
55PRO pltsc, tab1, tab2, min1, max1, min2, max2, varname2, BOXZOOM = boxzoom, $
56           COL1D=col1d, STY1D=sty1d, OV1D=ov1d, _EXTRA = ex
57; scatter plot (inspired from plt1d)
58;
59  compile_opt idl2, strictarrsubs
60;
61@cm_4mesh
62@cm_4data
63  IF NOT keyword_set(key_forgetold) THEN BEGIN
64@updatenew
65@updatekwd
66  ENDIF
67
68; Comment: We do not reinitializate when we call back pltsc
69   if NOT keyword_set(ov1d) then reinitplt
70   ;; reduce data xyzt domain
71
72   if keyword_set(boxzoom) then BEGIN
73     Case 1 Of
74       N_Elements(Boxzoom) Eq 1:bte = [lon1, lon2, lat1, lat2, 0., boxzoom[0]]
75       N_Elements(Boxzoom) Eq 2:bte = [lon1, lon2, lat1, lat2, boxzoom[0], boxzoom[1]]
76       N_Elements(Boxzoom) Eq 4:bte = [Boxzoom, vert1, vert2]
77       N_Elements(Boxzoom) Eq 5:bte = [Boxzoom[0:3], 0, Boxzoom[4]]
78       N_Elements(Boxzoom) Eq 6:bte = Boxzoom
79       Else: Begin
80         ras = report('Wrong Definition of Boxzoom')
81         return
82       End
83     endcase
84     savedbox = 1b
85     saveboxparam, 'boxparam4pltsc.dat'
86     domdef, bte, GRIDTYPE = vargrid
87   ENDIF
88
89; extract indexes to plot
90
91   indexm = where(tab1 LE valmask/10.)
92   tab1 = tab1[indexm]
93   tab2 = tab2[indexm]
94
95   npts = (size(indexm))[1]
96
97; deal with  min and max of plot
98   IF finite(min1) EQ 0 THEN min1 = min(tab1)
99   IF finite(max1) EQ 0 THEN max1 = max(tab1)
100   IF finite(min2) EQ 0 THEN min2 = min(tab2)
101   IF finite(max2) EQ 0 THEN max2 = max(tab2)
102
103
104; init plot if not overlay
105
106   IF NOT keyword_set(ov1d) THEN placedessin, 'yfx', posfenetre, posbar, $
107    contour = contour, _extra = ex
108   yy = tab1
109   xx = tab2
110
111; axis range
112   !x.range = [min2-abs(max2-min2)/5.,max2+abs(max2-min2)/5.]
113   !y.range = [min1-abs(max1-min1)/5.,max1+abs(max1-min1)/5.]
114
115   IF (NOT keyword_set(sty1d)) THEN sty1d = 0
116   IF (NOT keyword_set(col1d)) THEN col1d = 0
117   IF  NOT keyword_set(ov1d) THEN  BEGIN
118      legende, min1, max1, 'yfx', VARNAME2 = varname2, NPTS = npts, _EXTRA = ex
119;
120      plot,xx,yy, background = 255, psym = sty1d+1, color=col1d, thick=2 $
121       , title = '', subtitle = '',_extra = ex
122
123      if n_elements(ex) NE 0 then BEGIN
124; To have a 0 colored frame and trace a line at y=0
125         if (where(tag_names(ex) EQ 'COLOR'))[0] NE -1 then ex.COLOR = 0
126         if (where(tag_names(ex) EQ 'LINESTYLE'))[0] NE -1 then ex.LINESTYLE= 0
127       ENDIF
128       plot, !x.range, [0, 0], /noerase, /nodata, xstyle = 1, ystyle = 1, _extra = ex
129; trace a line at x=0
130      plot, [0, 0], !y.range, /noerase, /nodata, title = '', subtitle = '', _extra = ex
131   ENDIF ELSE oplot,xx,yy,color=col1d,linestyle=sty1d,thick=2, _extra = ex
132;------------------------------------------------------------
133;------------------------------------------------------------
134; 3rd part: Possible print
135;------------------------------------------------------------
136;------------------------------------------------------------
137fini:
138   terminedessin, _extra = ex
139  if keyword_set(savedbox) THEN restoreboxparam, 'boxparam4pltsc.dat'
140;------------------------------------------------------------
141   if n_elements(key_performance) NE 0 then $
142    IF key_performance EQ 1 THEN print, 'temps plt1d', systime(1)-tempsun
143;------------------------------------------------------------
144;------------------------------------------------------------
145;------------------------------------------------------------
146   return
147end
Note: See TracBrowser for help on using the repository browser.