Changeset 231 for trunk/SRC/ToBeReviewed/GRILLE/v2t.pro
- Timestamp:
- 03/19/07 18:15:51 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/GRILLE/v2t.pro
r163 r231 1 ;------------------------------------------------------------2 ;------------------------------------------------------------3 ;------------------------------------------------------------4 1 ;+ 5 2 ; 6 3 ; @file_comments 7 ; Allows to pass a field referring to the grid V on the grid T, 8 ; thanks to the average: 9 ; res = 0.5*(res + shift(res, 1, 0)) 4 ; Allows to pass a field referring to the grid V on the grid T, 5 ; thanks to the average: 6 ; res = 0.5*(res + shift(res, 1, 0)) 10 7 ; 11 ; @categories 8 ; @categories 12 9 ; Grid 13 10 ; … … 21 18 ; common.pro 22 19 ; 23 ; @restrictions 24 ; Force parameters of the zoom on the grid V to be the same as 20 ; @restrictions 21 ; Force parameters of the zoom on the grid V to be the same as 25 22 ; those on the grid T. 26 23 ; 27 ; @restrictions 28 ; Points which can not be calculated are put at the value NaN 24 ; @restrictions 25 ; Points which can not be calculated are put at the value NaN 29 26 ; consecrated by IDL: !values.f_nan 30 27 ; … … 37 34 ; $Id$ 38 35 ; 39 ; @todo seb: nom du input? 36 ; @todo 37 ; seb: nom du input? 40 38 ; 41 39 ;- 42 ;------------------------------------------------------------ 43 ;------------------------------------------------------------ 44 ;------------------------------------------------------------ 40 ; 45 41 FUNCTION v2t, temp 46 ;---------------------------------------------------------47 42 ; 48 43 compile_opt idl2, strictarrsubs … … 70 65 ; case on tha array's size and application 71 66 taille = size(temp) 72 CASE taille[0] OF 67 CASE taille[0] OF 73 68 1: res = -1 74 2: BEGIN 69 2: BEGIN 75 70 case 1 of 76 71 taille[1] eq nxv and taille[2] eq nyv: … … 81 76 endcase 82 77 mask = (vmask())[firstxv:lastxv, firstyv:lastyv, 0] 83 terre = where(mask EQ 0) 78 terre = where(mask EQ 0) 84 79 IF terre[0] NE -1 THEN res[terre] = !values.f_nan 85 80 res = 0.5*(res + shift(res, 0, +1)) 86 81 res[*, 0] = !values.f_nan 87 82 mask = tmask[firstxv:lastxv, firstyv:lastyv, 0] 88 terre = where(mask EQ 0) 83 terre = where(mask EQ 0) 89 84 IF terre[0] NE -1 THEN res[terre] = valmask 90 85 END 91 3: BEGIN 86 3: BEGIN 92 87 case 1 of 93 88 taille[1] eq nxv and taille[2] eq nyv AND taille[3] EQ nzt: … … 107 102 mask = reform(mask, nxv, nyv, jpt, /over) 108 103 ENDIF ELSE mask = (vmask())[firstxv:lastxv, firstyv:lastyv, firstzt:lastzt] 109 terre = where(temporary(mask) EQ 0) 104 terre = where(temporary(mask) EQ 0) 110 105 IF terre[0] NE -1 THEN res[temporary(terre)] = !values.f_nan 111 106 res = 0.5*(res + shift(res, 0, +1, 0)) … … 116 111 mask = reform(mask, nxv, nyv, jpt, /over) 117 112 ENDIF ELSE mask = tmask[firstxv:lastxv, firstyv:lastyv, firstzt:lastzt] 118 terre = where(temporary(mask) EQ 0) 113 terre = where(temporary(mask) EQ 0) 119 114 IF terre[0] NE -1 THEN res[temporary(terre)] = valmask 120 115 END 121 4: BEGIN 116 4: BEGIN 122 117 case 1 of 123 118 taille[1] eq nxv and taille[2] eq nyv AND taille[3] EQ nzt AND taille[4] EQ jpt: … … 132 127 mask = temporary(mask[*])#replicate(1, jpt) 133 128 mask = reform(mask, nxv, nyv, nzt, jpt, /over) 134 terre = where(temporary(mask) EQ 0) 129 terre = where(temporary(mask) EQ 0) 135 130 IF terre[0] NE -1 THEN res[temporary(terre)] = !values.f_nan 136 131 res = 0.5*(res + shift(res, 0, +1, 0, 0)) … … 139 134 mask = temporary(mask[*])#replicate(1, jpt) 140 135 mask = reform(mask, nxv, nyv, nzt, jpt, /over) 141 terre = where(temporary(mask) EQ 0) 136 terre = where(temporary(mask) EQ 0) 142 137 IF terre[0] NE -1 THEN res[temporary(terre)] = valmask 143 138 END … … 146 141 IF NOT keyword_set(key_forgetold) THEN BEGIN 147 142 @updateold 148 ENDIF 143 ENDIF 149 144 150 145 return, res 151 146 END 152
Note: See TracChangeset
for help on using the changeset viewer.