1 | ;+ |
---|
2 | ; |
---|
3 | ; @todo seb |
---|
4 | ; |
---|
5 | ;- |
---|
6 | PRO pltsc,tab1,tab2, min1, max1, min2, max2, varname2, BOXZOOM = boxzoom, $ |
---|
7 | COL1D=col1d,STY1D=sty1d,OV1D=ov1d, _extra = ex |
---|
8 | ; |
---|
9 | ; scatter plot (inspired from plt1d) |
---|
10 | ; |
---|
11 | ; |
---|
12 | compile_opt idl2, strictarrsubs |
---|
13 | ; |
---|
14 | |
---|
15 | ;--------------------------------------------------------- |
---|
16 | ; include common |
---|
17 | @cm_4mesh |
---|
18 | @cm_4data |
---|
19 | IF NOT keyword_set(key_forgetold) THEN BEGIN |
---|
20 | @updatenew |
---|
21 | @updatekwd |
---|
22 | ENDIF |
---|
23 | ;-------------------------------------------------------------- |
---|
24 | |
---|
25 | ; Comment: We do not reinitializate when we call back pltsc |
---|
26 | if NOT keyword_set(ov1d) then reinitplt |
---|
27 | ;; reduce data xyzt domain |
---|
28 | |
---|
29 | if keyword_set(boxzoom) then BEGIN |
---|
30 | Case 1 Of |
---|
31 | N_Elements(Boxzoom) Eq 1:bte = [lon1, lon2, lat1, lat2, 0., boxzoom[0]] |
---|
32 | N_Elements(Boxzoom) Eq 2:bte = [lon1, lon2, lat1, lat2, boxzoom[0], boxzoom[1]] |
---|
33 | N_Elements(Boxzoom) Eq 4:bte = [Boxzoom, vert1, vert2] |
---|
34 | N_Elements(Boxzoom) Eq 5:bte = [Boxzoom[0:3], 0, Boxzoom[4]] |
---|
35 | N_Elements(Boxzoom) Eq 6:bte = Boxzoom |
---|
36 | Else: Begin |
---|
37 | ras = report('Wrong Definition of Boxzoom') |
---|
38 | return |
---|
39 | End |
---|
40 | endcase |
---|
41 | savedbox = 1b |
---|
42 | saveboxparam, 'boxparam4pltsc.dat' |
---|
43 | domdef, bte, GRIDTYPE = vargrid |
---|
44 | ENDIF |
---|
45 | |
---|
46 | ; extract indexes to plot |
---|
47 | |
---|
48 | indexm = where(tab1 LE valmask/10.) |
---|
49 | tab1 = tab1[indexm] |
---|
50 | tab2 = tab2[indexm] |
---|
51 | |
---|
52 | npts = (size(indexm))[1] |
---|
53 | |
---|
54 | ; deal with min and max of plot |
---|
55 | IF finite(min1) EQ 0 THEN min1 = min(tab1) |
---|
56 | IF finite(max1) EQ 0 THEN max1 = max(tab1) |
---|
57 | IF finite(min2) EQ 0 THEN min2 = min(tab2) |
---|
58 | IF finite(max2) EQ 0 THEN max2 = max(tab2) |
---|
59 | |
---|
60 | |
---|
61 | ; init plot if not overlay |
---|
62 | |
---|
63 | IF NOT keyword_set(ov1d) THEN placedessin, 'yfx', posfenetre, posbar, $ |
---|
64 | contour = contour, _extra = ex |
---|
65 | yy = tab1 |
---|
66 | xx = tab2 |
---|
67 | |
---|
68 | ; axis range |
---|
69 | !x.range = [min2-abs(max2-min2)/5.,max2+abs(max2-min2)/5.] |
---|
70 | !y.range = [min1-abs(max1-min1)/5.,max1+abs(max1-min1)/5.] |
---|
71 | |
---|
72 | IF (NOT keyword_set(sty1d)) THEN sty1d = 0 |
---|
73 | IF (NOT keyword_set(col1d)) THEN col1d = 0 |
---|
74 | IF NOT keyword_set(ov1d) THEN BEGIN |
---|
75 | legende, min1, max1, 'yfx', VARNAME2 = varname2, NPTS = npts, _EXTRA = ex |
---|
76 | ; |
---|
77 | plot,xx,yy, background = 255, psym = sty1d+1, color=col1d, thick=2 $ |
---|
78 | , title = '', subtitle = '',_extra = ex |
---|
79 | |
---|
80 | if n_elements(ex) NE 0 then BEGIN |
---|
81 | ; To have a 0 colored frame and trace a line at y=0 |
---|
82 | if (where(tag_names(ex) EQ 'COLOR'))[0] NE -1 then ex.COLOR = 0 |
---|
83 | if (where(tag_names(ex) EQ 'LINESTYLE'))[0] NE -1 then ex.LINESTYLE= 0 |
---|
84 | ENDIF |
---|
85 | plot, !x.range, [0, 0], /noerase, /nodata, xstyle = 1, ystyle = 1, _extra = ex |
---|
86 | ; trace a line at x=0 |
---|
87 | plot, [0, 0], !y.range, /noerase, /nodata, title = '', subtitle = '', _extra = ex |
---|
88 | ENDIF ELSE oplot,xx,yy,color=col1d,linestyle=sty1d,thick=2, _extra = ex |
---|
89 | ;------------------------------------------------------------ |
---|
90 | ;------------------------------------------------------------ |
---|
91 | ; 3rd part: Possible print |
---|
92 | ;------------------------------------------------------------ |
---|
93 | ;------------------------------------------------------------ |
---|
94 | fini: |
---|
95 | terminedessin, _extra = ex |
---|
96 | if keyword_set(savedbox) THEN restoreboxparam, 'boxparam4pltsc.dat' |
---|
97 | ;------------------------------------------------------------ |
---|
98 | if n_elements(key_performance) NE 0 then $ |
---|
99 | IF key_performance EQ 1 THEN print, 'temps plt1d', systime(1)-tempsun |
---|
100 | ;------------------------------------------------------------ |
---|
101 | ;------------------------------------------------------------ |
---|
102 | ;------------------------------------------------------------ |
---|
103 | return |
---|
104 | end |
---|
105 | |
---|
106 | |
---|