source: trunk/SRC/Interpolation/testinterp.pro @ 80

Last change on this file since 80 was 59, checked in by pinsard, 18 years ago

upgrade of Interpolation according to cerbere.lodyc.jussieu.fr: /usr/home/smasson/SAXO_RD/

  • Property svn:executable set to *
File size: 4.6 KB
Line 
1PRO testinterp
2
3  method = 'bilinear'
4;  method = 'imoms3'
5;
6
7  jpia = 300L
8  jpja = 200L
9  torg = findgen(jpia, jpja)
10  xorg =  20.d + 360.d/jpia*dindgen(jpia)
11  yorg = -89.d + 178.d/(jpja-1)*dindgen(jpja)
12
13
14  jpio = 400L
15  jpjo = 150L
16  xnew =  0.d + 360.d/jpio*dindgen(jpio)
17  ynew = -89.5d + 179.d/(jpjo-1)*dindgen(jpjo)
18 
19
20  outnorth = where(ynew GT yorg[jpja-2], noutn)
21  outsouth = where(ynew LT yorg[1], nouts)
22
23  t2 = fromreg(method, torg, xorg, yorg, xnew, ynew)
24
25  t3 = fromreg(method, reverse(torg, 2), xorg, reverse(yorg), xnew, ynew)
26  IF  array_equal(t2, t3) EQ 0 THEN stop ELSE print, 'ok1'
27
28
29  xshift = 20
30  torg2 = shift(torg, xshift, 0)
31  xorg2 = shift(xorg, xshift)
32  xorg2[0: xshift-1] = xorg2[0: xshift-1]-360
33  IF array_equal(sort(xorg2), lindgen(n_elements(xorg2))) EQ 0 THEN stop
34  t3 = fromreg(method, torg2, xorg2, yorg, xnew, ynew)
35  IF  array_equal(t2, t3) EQ 0 THEN stop ELSE print, 'ok2'
36
37
38  xshift = 20
39  torg2 = shift(torg, xshift, 0)
40  xorg2 = shift(xorg, xshift)
41  xorg2[0: xshift-1] = xorg2[0: xshift-1]-360
42  IF array_equal(sort(xorg2), lindgen(n_elements(xorg2))) EQ 0 THEN stop
43  t3 = fromreg(method, reverse(torg2, 2), xorg2, reverse(yorg), xnew, ynew)
44  IF  array_equal(t2, t3) EQ 0 THEN stop ELSE print, 'ok3'
45
46
47  xshift = 20
48  torg2 = shift(torg, xshift, 0)
49  xorg2 = shift(xorg, xshift)
50  t3 = fromreg(method, torg2, xorg2, yorg, xnew, ynew)
51  IF  array_equal(t2, t3) EQ 0 THEN stop ELSE print, 'ok4'
52
53  xshift = 20
54  torg2 = shift(torg, xshift, 0)
55  xorg2 = shift(xorg, xshift)
56  t3 = fromreg(method, reverse(torg2, 2), xorg2, reverse(yorg), xnew, ynew)
57  IF  array_equal(t2, t3) EQ 0 THEN stop ELSE print, 'ok5'
58
59  t3 = fromreg(method, torg, xorg, yorg, xnew, ynew, /nonorthernline)
60  IF  array_equal(t2[*, 0:jpjo-1-noutn], t3[*, 0:jpjo-1-noutn]) EQ 0 THEN stop ELSE print, 'ok6'
61  FOR i = 1, noutn-1 DO if array_equal(t3[*, jpjo-1], t3[*, jpjo-1-i]) EQ 0 THEN stop ELSE print, 'ok7', i
62  t3 = fromreg(method, torg, xorg, yorg, xnew, ynew, /nosouthernline)
63  IF  array_equal(t2[*, nouts:*], t3[*, nouts:*]) EQ 0 THEN stop ELSE print, 'ok8'
64  FOR i = 1, nouts-1 DO if array_equal(t3[*, 0], t3[*, i]) EQ 0 THEN stop ELSE print, 'ok9', i
65
66
67  t3 = fromreg(method, reverse(torg, 2), xorg, reverse(yorg), xnew, ynew, /nonorthernline)
68  IF  array_equal(t2[*, 0:jpjo-1-noutn], t3[*, 0:jpjo-1-noutn]) EQ 0 THEN stop ELSE print, 'ok10'
69  FOR i = 1, noutn-1 DO if array_equal(t3[*, jpjo-1], t3[*, jpjo-1-i]) EQ 0 THEN stop ELSE print, 'ok11', i
70  t3 = fromreg(method, reverse(torg, 2), xorg, reverse(yorg), xnew, ynew, /nosouthernline)
71  IF  array_equal(t2[*, nouts:*], t3[*, nouts:*]) EQ 0 THEN stop ELSE print, 'ok12'
72  FOR i = 1, nouts-1 DO if array_equal(t3[*, 0], t3[*, i]) EQ 0 THEN stop ELSE print, 'ok13', i
73
74  xshift = 20
75  torg2 = shift(torg, xshift, 0)
76  xorg2 = shift(xorg, xshift)
77  xorg2[0: xshift-1] = xorg2[0: xshift-1]-360
78  IF array_equal(sort(xorg2), lindgen(n_elements(xorg2))) EQ 0 THEN stop
79  t3 = fromreg(method, torg2, xorg2, yorg, xnew, ynew, /nonorthernline)
80  IF  array_equal(t2[*, 0:jpjo-1-noutn], t3[*, 0:jpjo-1-noutn]) EQ 0 THEN stop ELSE print, 'ok14'
81  FOR i = 1, noutn-1 DO if array_equal(t3[*, jpjo-1], t3[*, jpjo-1-i]) EQ 0 THEN stop ELSE print, 'ok15', i
82
83  xshift = 20
84  torg2 = shift(torg, xshift, 0)
85  xorg2 = shift(xorg, xshift)
86  xorg2[0: xshift-1] = xorg2[0: xshift-1]-360
87  IF array_equal(sort(xorg2), lindgen(n_elements(xorg2))) EQ 0 THEN stop
88  t3 = fromreg(method, torg2, xorg2, yorg, xnew, ynew, /nosouthernline)
89  IF  array_equal(t2[*, nouts:*], t3[*, nouts:*]) EQ 0 THEN stop ELSE print, 'ok16'
90  FOR i = 1, nouts-1 DO if array_equal(t3[*, 0], t3[*, i]) EQ 0 THEN stop ELSE print, 'ok17', i
91
92  xshift = 20
93  torg2 = shift(torg, xshift, 0)
94  xorg2 = shift(xorg, xshift)
95  xorg2[0: xshift-1] = xorg2[0: xshift-1]-360
96  IF array_equal(sort(xorg2), lindgen(n_elements(xorg2))) EQ 0 THEN stop
97  t3 = fromreg(method, reverse(torg2, 2), xorg2, reverse(yorg), xnew, ynew, /nonorthernline)
98  IF  array_equal(t2[*, 0:jpjo-1-noutn], t3[*, 0:jpjo-1-noutn]) EQ 0 THEN stop ELSE print, 'ok18'
99  FOR i = 1, noutn-1 DO if array_equal(t3[*, jpjo-1], t3[*, jpjo-1-i]) EQ 0 THEN stop ELSE print, 'ok19', i
100
101
102  xshift = 20
103  torg2 = shift(torg, xshift, 0)
104  xorg2 = shift(xorg, xshift)
105  xorg2[0: xshift-1] = xorg2[0: xshift-1]-360
106  IF array_equal(sort(xorg2), lindgen(n_elements(xorg2))) EQ 0 THEN stop
107  t3 = fromreg(method, reverse(torg2, 2), xorg2, reverse(yorg), xnew, ynew, /nosouthernline)
108  IF  array_equal(t2[*, nouts:*], t3[*, nouts:*]) EQ 0 THEN stop ELSE print, 'ok20'
109  FOR i = 1, nouts-1 DO if array_equal(t3[*, 0], t3[*, i]) EQ 0 THEN stop ELSE print, 'ok21', i
110
111
112  return
113end
Note: See TracBrowser for help on using the repository browser.