source: trunk/MESOSCALE/PLOT/RESERVE/findxy.pro @ 163

Last change on this file since 163 was 85, checked in by aslmd, 14 years ago

LMD_MM_MARS et LMD_LES_MARS: ajout des routines IDL pour tracer les sorties --> voir mesoscale/PLOT

File size: 1.4 KB
Line 
1pro findxy,             $
2        x=x,            $       ;;IN
3        y=y,            $       ;;IN
4        point=point,    $       ;;IN
5        ind=ind,        $       ;;OUT           
6        flag=flag               ;;IN OPT
7
8
9
10pointint=[0,0]
11
12;;;if (point eq 'VL1') then pointint=[-48.22,22.70]
13;;;if (point eq 'VL2') then pointint=[133.74,47.93]
14;;;if (point eq 'PAT') then pointint=[-33.5,19.1]
15
16if (n_elements(point) eq 2) then begin
17        pointint=point
18endif else begin
19;;Si lon=312.050381 et lat=22.269628, alt=-3637.1396
20;;Si lon=134.282101 et lat=47.668093, alt=-4497.0474
21;;Si lon=326.747364 et lat=19.099641, alt=-3681.9993
22if (point eq 'VL1') then pointint=[312.050381-360.,22.269628]
23if (point eq 'VL2') then pointint=[134.282101,47.668093]
24if (point eq 'PAT') then pointint=[326.747364-360.,19.099641]
25endelse
26
27
28
29if (n_elements(x) eq 0) then print, 'set x='
30if (n_elements(y) eq 0) then print, 'set y='
31if (n_elements(flag) eq 0) then flag=1
32
33
34x=reform(x)
35y=reform(y)
36
37ind=intarr(2)
38
39
40
41CASE (flag) OF
421: begin
43
44        minim=abs(x-pointint(0))
45        w=where(minim eq min(minim))
46        print, 'distance is ', minim(w(0))
47        ind[0]=w(0)
48
49        minim=abs(y-pointint(1))
50        w=where(minim eq min(minim))
51        print, 'distance is ', minim(w(0))
52        ind[1]=w(0)
53
54end
552: begin
56
57        distance = sqrt((x - pointint(0))^2 + (y - pointint(1))^2)
58        mx = min(distance, location)
59        print, 'distance 2D is ',mx
60        ind = array_indices(distance, location)
61        print, 'on ... ', pointint(0), pointint(1)
62        print, 'found ... ', x[ind(0),ind(1)], y[ind(0),ind(1)]
63
64end
65endcase
66
67end
68
69
70
Note: See TracBrowser for help on using the repository browser.