[142] | 1 | ;+ |
---|
[163] | 2 | ; @file_comments |
---|
[142] | 3 | ; |
---|
[163] | 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 |
---|
[231] | 21 | ; Vector indicating the geographic zone on which we want to cut the map. |
---|
[163] | 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 |
---|
[231] | 36 | ; Used to pass keywords |
---|
[163] | 37 | ; |
---|
| 38 | ; @returns |
---|
| 39 | ; |
---|
| 40 | ; @uses |
---|
| 41 | ; |
---|
| 42 | ; @restrictions |
---|
| 43 | ; |
---|
| 44 | ; @examples |
---|
| 45 | ; |
---|
| 46 | ; @history |
---|
| 47 | ; |
---|
| 48 | ; @version |
---|
| 49 | ; $Id$ |
---|
| 50 | ; |
---|
[142] | 51 | ; @todo seb |
---|
| 52 | ; |
---|
| 53 | ;- |
---|
[327] | 54 | PRO pltsc, tab1, tab2, min1, max1, min2, max2, varname2, BOXZOOM=boxzoom, $ |
---|
| 55 | COL1D=col1d, STY1D=sty1d, OV1D=ov1d, _EXTRA=ex |
---|
[325] | 56 | ; |
---|
[2] | 57 | ; scatter plot (inspired from plt1d) |
---|
| 58 | ; |
---|
[114] | 59 | compile_opt idl2, strictarrsubs |
---|
| 60 | ; |
---|
[35] | 61 | @cm_4mesh |
---|
| 62 | @cm_4data |
---|
| 63 | IF NOT keyword_set(key_forgetold) THEN BEGIN |
---|
| 64 | @updatenew |
---|
| 65 | @updatekwd |
---|
| 66 | ENDIF |
---|
[2] | 67 | |
---|
[295] | 68 | ; Comment: We do not reinitialize when we call back pltsc |
---|
[2] | 69 | if NOT keyword_set(ov1d) then reinitplt |
---|
[297] | 70 | ; reduce data xyzt domain |
---|
[2] | 71 | |
---|
[231] | 72 | if keyword_set(boxzoom) then BEGIN |
---|
[35] | 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 |
---|
[231] | 80 | ras = report('Wrong Definition of Boxzoom') |
---|
[35] | 81 | return |
---|
| 82 | End |
---|
| 83 | endcase |
---|
| 84 | savedbox = 1b |
---|
| 85 | saveboxparam, 'boxparam4pltsc.dat' |
---|
| 86 | domdef, bte, GRIDTYPE = vargrid |
---|
| 87 | ENDIF |
---|
[2] | 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 | |
---|
[231] | 103 | |
---|
[2] | 104 | ; init plot if not overlay |
---|
[231] | 105 | |
---|
[2] | 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 |
---|
[231] | 117 | IF NOT keyword_set(ov1d) THEN BEGIN |
---|
| 118 | legende, min1, max1, 'yfx', VARNAME2 = varname2, NPTS = npts, _EXTRA = ex |
---|
[2] | 119 | ; |
---|
| 120 | plot,xx,yy, background = 255, psym = sty1d+1, color=col1d, thick=2 $ |
---|
| 121 | , title = '', subtitle = '',_extra = ex |
---|
| 122 | |
---|
[231] | 123 | if n_elements(ex) NE 0 then BEGIN |
---|
[142] | 124 | ; To have a 0 colored frame and trace a line at y=0 |
---|
[35] | 125 | if (where(tag_names(ex) EQ 'COLOR'))[0] NE -1 then ex.COLOR = 0 |
---|
[2] | 126 | if (where(tag_names(ex) EQ 'LINESTYLE'))[0] NE -1 then ex.LINESTYLE= 0 |
---|
[35] | 127 | ENDIF |
---|
| 128 | plot, !x.range, [0, 0], /noerase, /nodata, xstyle = 1, ystyle = 1, _extra = ex |
---|
[142] | 129 | ; trace a line at x=0 |
---|
[35] | 130 | plot, [0, 0], !y.range, /noerase, /nodata, title = '', subtitle = '', _extra = ex |
---|
[2] | 131 | ENDIF ELSE oplot,xx,yy,color=col1d,linestyle=sty1d,thick=2, _extra = ex |
---|
| 132 | ;------------------------------------------------------------ |
---|
| 133 | ;------------------------------------------------------------ |
---|
[142] | 134 | ; 3rd part: Possible print |
---|
[2] | 135 | ;------------------------------------------------------------ |
---|
| 136 | ;------------------------------------------------------------ |
---|
| 137 | fini: |
---|
| 138 | terminedessin, _extra = ex |
---|
[35] | 139 | if keyword_set(savedbox) THEN restoreboxparam, 'boxparam4pltsc.dat' |
---|
[2] | 140 | ;------------------------------------------------------------ |
---|
| 141 | if n_elements(key_performance) NE 0 then $ |
---|
[231] | 142 | IF key_performance EQ 1 THEN print, 'temps plt1d', systime(1)-tempsun |
---|
[2] | 143 | ;------------------------------------------------------------ |
---|
| 144 | ;------------------------------------------------------------ |
---|
| 145 | ;------------------------------------------------------------ |
---|
| 146 | return |
---|
| 147 | end |
---|