1 | ;+ |
---|
2 | ; |
---|
3 | ; scatter plot (inspired from plt1d) |
---|
4 | ; |
---|
5 | ; @uses |
---|
6 | ; <pro>common</pro> |
---|
7 | ; |
---|
8 | ; @version |
---|
9 | ; $Id$ |
---|
10 | ; |
---|
11 | ;- |
---|
12 | PRO pltsc,tab1,tab2, min1, max1, min2, max2, varname2 $ |
---|
13 | , BOITE=boite $ |
---|
14 | , COL1D=col1d $ |
---|
15 | , STY1D=sty1d $ |
---|
16 | , OV1D=ov1d $ |
---|
17 | , THICKN=thickn $ |
---|
18 | , FRACTION=fraction $ |
---|
19 | , _EXTRA=extra |
---|
20 | ; |
---|
21 | compile_opt idl2, strictarrsubs |
---|
22 | ; |
---|
23 | @common |
---|
24 | |
---|
25 | c_cote = 0 |
---|
26 | |
---|
27 | ; Rq: on ne reinitialise pas qd on rapelle pltsc |
---|
28 | IF NOT keyword_set(ov1d) THEN reinitplt |
---|
29 | IF NOT keyword_set(thickn) THEN thickn = 2 |
---|
30 | IF NOT keyword_set(fraction) THEN fraction = 1. |
---|
31 | ;; reduce data xyzt domain |
---|
32 | |
---|
33 | oldboite = [lon1, lon2, lat1, lat2, prof1, prof2] |
---|
34 | IF keyword_set(boite) THEN BEGIN |
---|
35 | IF n_elements(integration3d) EQ 0 THEN integration3d = n_elements(boite) NE 4 |
---|
36 | CASE 1 Of |
---|
37 | N_Elements(Boite) Eq 1:bte=[lon1, lon2, lat1, lat2, 0.,boite[0]] |
---|
38 | N_Elements(Boite) Eq 2:bte=[lon1, lon2, lat1, lat2, boite[0],boite[1]] |
---|
39 | N_Elements(Boite) Eq 4:bte=[Boite, prof1, prof2] |
---|
40 | N_Elements(Boite) Eq 5:bte=[Boite[0:3], 0, Boite[4]] |
---|
41 | N_Elements(Boite) Eq 6:bte=Boite |
---|
42 | ELSE: BEGIN |
---|
43 | ras = report('Mauvaise Definition de Boite') |
---|
44 | return |
---|
45 | END |
---|
46 | ENDCASE |
---|
47 | ENDIF ELSE bte=[lon1, lon2, lat1, lat2, prof1, prof2] |
---|
48 | |
---|
49 | domdef, bte,GRILLE=vargrid |
---|
50 | |
---|
51 | ; extract indexes to plot |
---|
52 | |
---|
53 | indexm = where(tab1 LE valmask/10.) |
---|
54 | tab1 = tab1[indexm] |
---|
55 | tab2 = tab2[indexm] |
---|
56 | |
---|
57 | npts = (size(indexm))[1] |
---|
58 | |
---|
59 | ; deal with min and max of plot |
---|
60 | IF finite(min1) EQ 0 THEN min1 = min(tab1) |
---|
61 | IF finite(max1) EQ 0 THEN max1 = max(tab1) |
---|
62 | IF finite(min2) EQ 0 THEN min2 = min(tab2) |
---|
63 | IF finite(max2) EQ 0 THEN max2 = max(tab2) |
---|
64 | |
---|
65 | |
---|
66 | ; init plot if not overlay |
---|
67 | |
---|
68 | IF NOT keyword_set(ov1d) THEN placedessin, 'yfx', posfenetre, posbar, $ |
---|
69 | contour = contour, _EXTRA=EXTRA |
---|
70 | yy = tab1 |
---|
71 | xx = tab2 |
---|
72 | |
---|
73 | ; axis range |
---|
74 | |
---|
75 | fraction = 0. |
---|
76 | |
---|
77 | !x.range = [min2-fraction*abs(max2-min2)/5.,max2+fraction*abs(max2-min2)/5.] |
---|
78 | !y.range = [min1-fraction*abs(max1-min1)/5.,max1+fraction*abs(max1-min1)/5.] |
---|
79 | |
---|
80 | IF (NOT keyword_set(sty1d)) THEN sty1d = 0 |
---|
81 | IF (NOT keyword_set(col1d)) THEN col1d = 0 |
---|
82 | IF NOT keyword_set(ov1d) THEN BEGIN |
---|
83 | legende, min1, max1, 'yfx', VARNAME2 = varname2, NPTS = npts, _EXTRA=extra |
---|
84 | ; |
---|
85 | plot,xx,yy, background = 255, psym = sty1d+1, color=col1d, thick=thickn $ |
---|
86 | , title = '', subtitle = '',_EXTRA=extra |
---|
87 | |
---|
88 | IF n_elements(ex) NE 0 THEN BEGIN |
---|
89 | ; pour avoir un cadre de la couleur c_cote et trace une ligne a y=0 |
---|
90 | IF (where(tag_names(ex) EQ 'COLOR'))[0] NE -1 THEN ex.COLOR = c_cote |
---|
91 | IF (where(tag_names(ex) EQ 'LINESTYLE'))[0] NE -1 THEN ex.LINESTYLE= 0 |
---|
92 | ENDIF |
---|
93 | plot, !x.range, [0, 0],/noerase,color=c_cote, xstyle = 1, ystyle = 1, _EXTRA=extra |
---|
94 | ; trace une ligne a x=0 |
---|
95 | plot, [0, 0],!y.range ,/noerase,color=c_cote, title = '', subtitle = '', _EXTRA=extra |
---|
96 | ENDIF ELSE oplot,xx,yy,color=col1d,psym=sty1d+1,thick=thickn, _EXTRA=extra |
---|
97 | ;------------------------------------------------------------ |
---|
98 | ;------------------------------------------------------------ |
---|
99 | ; 3eme partie: impression eventuelle |
---|
100 | ;------------------------------------------------------------ |
---|
101 | ;------------------------------------------------------------ |
---|
102 | fini: |
---|
103 | domdef, oldboite,GRILLE=vargrid |
---|
104 | terminedessin, _EXTRA=extra |
---|
105 | ;------------------------------------------------------------ |
---|
106 | IF n_elements(key_performance) NE 0 THEN $ |
---|
107 | IF key_performance EQ 1 THEN print, 'temps plt1d', systime(1)-tempsun |
---|
108 | return |
---|
109 | END |
---|