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

Last change on this file since 163 was 163, checked in by navarro, 18 years ago

header improvements : type of parameters and keywords, default values, spell checking + idldoc assistant (IDL online_help)

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