Changeset 226 for trunk/SRC/Interpolation
- Timestamp:
- 03/16/07 10:22:26 (17 years ago)
- Location:
- trunk/SRC/Interpolation
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Interpolation/compute_fromirr_bilinear_weigaddr.pro
r202 r226 5 5 ; to any grid using the bilinear method 6 6 ; 7 ; @categories 7 ; @categories 8 8 ; Interpolation 9 9 ; … … 53 53 ; June 2006: Sebastien Masson (smasson\@lodyc.jussieu.fr) 54 54 ; 55 ; @version $Id$ 55 ; @version 56 ; $Id$ 56 57 ; 57 58 ;- … … 65 66 ; 66 67 jpio = (size(olonin, /dimensions))[0] 67 jpjo = (size(olonin, /dimensions))[1] 68 jpjo = (size(olonin, /dimensions))[1] 68 69 ; mask check 69 70 IF n_elements(omsk) EQ 1 AND omsk[0] EQ -1 THEN omsk = replicate(1b, jpio, jpjo) … … 73 74 stop 74 75 ENDIF 75 IF n_elements(amsk) NE jpia*jpja THEN BEGIN 76 IF n_elements(amsk) NE jpia*jpja THEN BEGIN 76 77 print, 'output grid mask do not have the good size' 77 78 stop … … 181 182 ind = good[ind] 182 183 ; now, we morph the quadrilateral ocean cell into the reference square (0 -> 1) 183 ; in addition we get the co rrdinates of the atmospheric point in this new morphed square184 ; in addition we get the coordinates of the atmospheric point in this new morphed square 184 185 IF onsphere THEN BEGIN 185 186 ; Warning! quadrilateral2square use anticlockwise quadrilateral definition … … 213 214 xy[1] EQ 0 AND (tmpmsk[0]+tmpmsk[1]) EQ 0 : foraddr[n] = -1 214 215 xy[1] EQ 1 AND (tmpmsk[2]+tmpmsk[3]) EQ 0 : foraddr[n] = -1 215 ELSE: BEGIN 216 ELSE: BEGIN 216 217 ; we keep its address 217 218 foraddr[n] = ind -
trunk/SRC/Interpolation/compute_fromreg_bilinear_weigaddr.pro
r208 r226 4 4 ; "regular grid" to any grid using the bilinear method 5 5 ; 6 ; @categories 6 ; @categories 7 7 ; Interpolation 8 8 ; … … 21 21 ; @keyword NONORTHERNLINE {type=scalar 0 or 1}{default=0} 22 22 ; put 1 if you don't want to take into 23 ; account the northe n line of the input data when performing the interpolation.23 ; account the northern line of the input data when performing the interpolation. 24 24 ; 25 25 ; @keyword NOSOUTHERNLINE {type=scalar 0 or 1}{default=0} … … 48 48 ; November 2005: Sebastien Masson (smasson\@lodyc.jussieu.fr) 49 49 ; 50 ; @version $Id$ 50 ; @version 51 ; $Id$ 51 52 ; 52 53 ;- … … 109 110 IF ma GE minalon+360. THEN stop 110 111 ; 111 ; we want to do bili ear interpolation => for each ocean point, we must112 ; we want to do bilinear interpolation => for each ocean point, we must 112 113 ; find in which atm cell it is located. 113 114 ; if the ocean point is out of the atm grid, we use closest neighbor 114 115 ; interpolation 115 116 ; 116 ; for each T point of oce grid, we find in which a rmospheric cell it is117 ; for each T point of oce grid, we find in which atmospheric cell it is 117 118 ; located. 118 119 ; As the atmospheric grid is regular, we can use inrecgrid instead -
trunk/SRC/Interpolation/compute_fromreg_imoms3_weigaddr.pro
r202 r226 5 5 ; "regular grid" to any grid using the imoms3 method 6 6 ; 7 ; @categories 7 ; @categories 8 8 ; Interpolation 9 9 ; … … 22 22 ; @keyword NONORTHERNLINE {type=scalar 0 or 1}{default=0} 23 23 ; put 1 if you don't want to take into 24 ; account the northe n line of the input data when performing the interpolation.24 ; account the northern line of the input data when performing the interpolation. 25 25 ; 26 26 ; @keyword NOSOUTHERNLINE {type=scalar 0 or 1}{default=0} -
trunk/SRC/Interpolation/extrapolate.pro
r202 r226 1 1 ;+ 2 2 ; @file_comments 3 ; extrapolate data (zinput) where maskinput eq 0 by filling step by 3 ; extrapolate data (zinput) where maskinput eq 0 by filling step by 4 4 ; step the coastline points with the mean value of the 8 neighbourgs 5 5 ; (weighted by their mask value). 6 6 ; 7 ; @categories 7 ; @categories 8 8 ; Interpolation 9 9 ; … … 47 47 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 48 48 ; 49 ; @version $Id$ 49 ; @version 50 ; $Id$ 50 51 ; 51 52 ;- … … 71 72 ztmp = bytarr(nx+2, ny+2) 72 73 IF n_elements(maskinput) EQ 1 AND maskinput[0] EQ -1 THEN maskinput = replicate(1b, nx, ny) 73 IF n_elements(maskinput) NE nx*ny THEN BEGIN 74 IF n_elements(maskinput) NE nx*ny THEN BEGIN 74 75 print, 'input grid mask do not have the good size' 75 76 return, -1 … … 97 98 ; 98 99 cnt = 1 99 ; When we look for the coast 100 ; When we look for the coastline, we don't want to select the 100 101 ; borderlines of the array. -> we force the value of the mask for 101 102 ; those lines. … … 109 110 WHILE cnt LE nb_iteration AND cnt_land NE 0 DO BEGIN 110 111 ;--------------------------------------------------------------- 111 ; find the coast 112 ; find the coastline points... 112 113 ;--------------------------------------------------------------- 113 114 ; Once the land points list has been found, we change back the the … … 148 149 weight = weight[temporary(ok)] 149 150 ;--------------------------------------------------------------- 150 ; fill the coast ine points151 ; fill the coastline points 151 152 ;--------------------------------------------------------------- 152 153 z = temporary(z)*msk -
trunk/SRC/Interpolation/extrapsmooth.pro
r202 r226 46 46 ;- 47 47 FUNCTION extrapsmooth, in, mskin, x_periodic = x_periodic, MINVAL = minval, MAXVAL = maxval, GE0 = ge0 48 ;49 compile_opt strictarr, strictarrsubs50 48 ; 51 sz = size(reform(in)) 52 IF sz[0] NE 2 THEN BEGIN 49 compile_opt strictarr, strictarrsubs 50 ; 51 sz = size(reform(in)) 52 IF sz[0] NE 2 THEN BEGIN 53 53 print, 'Input arrays must have 2 dimensions' 54 54 return, -1 … … 57 57 ny = sz[2] 58 58 IF n_elements(mskin) EQ 1 AND mskin[0] EQ -1 THEN mskin = replicate(1b, nx, ny) 59 IF n_elements(mskin) NE nx*ny THEN BEGIN 59 IF n_elements(mskin) NE nx*ny THEN BEGIN 60 60 print, 'input grid mask do not have the good size' 61 61 return, -1 … … 65 65 whmsk = where(mskin EQ 0, nbr) 66 66 IF nbr NE 0 THEN out[temporary(whmsk)] = !values.f_nan 67 ; add values on each side of the array to avoid bo ndary effects67 ; add values on each side of the array to avoid boundary effects 68 68 nx2 = nx/2 69 69 ny2 = ny/2 … … 74 74 add2 = out[nx-nx2:nx-1, *] 75 75 out = [add2, [temporary(out)], add1] 76 ENDIF ELSE BEGIN 76 ENDIF ELSE BEGIN 77 77 add = replicate(!values.f_nan, nx2, ny+2*ny2) 78 78 out = [add, [temporary(out)], add] -
trunk/SRC/Interpolation/get_gridparams.pro
r163 r226 142 142 1:BEGIN 143 143 IF array_equal(lon, lon[*, 0] # replicate(1, jpj)) NE 1 THEN BEGIN 144 print, 'Longitudes are not the same for all latitudes, impos ible to extract a 1D array of the longitudes'144 print, 'Longitudes are not the same for all latitudes, impossible to extract a 1D array of the longitudes' 145 145 stop 146 146 ENDIF … … 163 163 1:BEGIN 164 164 IF array_equal(lat, replicate(1, jpi) # lat[0, *]) NE 1 THEN BEGIN 165 print, 'Latitudes are not the same for all longitudes, impos ible to extract a 1D array of the latitudes'165 print, 'Latitudes are not the same for all longitudes, impossible to extract a 1D array of the latitudes' 166 166 stop 167 167 ENDIF … … 184 184 1:BEGIN 185 185 IF array_equal(lon, lon[*, 0] # replicate(1, jpj)) NE 1 THEN BEGIN 186 print, 'Longitudes are not the same for all latitudes, impos ible to extract a 1D array of the longitudes'186 print, 'Longitudes are not the same for all latitudes, impossible to extract a 1D array of the longitudes' 187 187 stop 188 188 ENDIF 189 189 lon = lon[*, 0] 190 190 IF array_equal(lat, replicate(1, jpi) # reform(lat[0, *])) NE 1 THEN BEGIN 191 print, 'Latitudes are not the same for all longitudes, impos ible to extract a 1D array of the latitudes'191 print, 'Latitudes are not the same for all longitudes, impossible to extract a 1D array of the latitudes' 192 192 stop 193 193 ENDIF -
trunk/SRC/Interpolation/inquad.pro
r163 r226 3 3 ; to find if an (x,y) point is in a quadrilateral (x1,x2,x3,x4) 4 4 ; 5 ; @categories 5 ; @categories 6 6 ; Grid 7 7 ; … … 205 205 ; 206 206 ; computation of test without any do loop for ntofind points (x,y) and 207 ; nquad quad ilateral((x1,x2,x3,x4),(y1,y2,y3,y4))207 ; nquad quadrilateral((x1,x2,x3,x4),(y1,y2,y3,y4)) 208 208 ; test dimensions are (ntofind, nquad) 209 209 ; column i of test corresponds to the intersection of point i with all 210 ; quad irlateral.210 ; quadrilateral. 211 211 ; row j of test corresponds to all the points localized in cell j 212 212 test = $
Note: See TracChangeset
for help on using the changeset viewer.