Changeset 371 for trunk/SRC/Interpolation
- Timestamp:
- 08/07/08 11:32:02 (16 years ago)
- Location:
- trunk/SRC/Interpolation
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Interpolation/clickincell.pro
r370 r371 43 43 ; 44 44 ; @examples 45 ; IDL> res = clickincell()45 ; IDL> res = clickincell() 46 46 ; 47 47 ; Click with the left button to select a cell. Clicking one more … … 49 49 ; Click on the right button to quit. 50 50 ; 51 ; IDL> plt, findgen(jpi,jpj),/nodata,map=[90,0,0],/ortho52 ; IDL> print, clickincell(/draw,color=150,/xy)51 ; IDL> plt, findgen(jpi,jpj),/nodata,map=[90,0,0],/ortho 52 ; IDL> print, clickincell(/draw,color=150,/xy) 53 53 ; 54 54 ; @history -
trunk/SRC/Interpolation/cutpar.pro
r327 r371 42 42 ; @examples 43 43 ; 44 ; IDL> x0 = [2,6,2]45 ; IDL> y0 = [0,2,6]46 ; IDL> x1 = [3,8,4]47 ; IDL> y1 = [4,4,6]48 ; IDL> x2 = [1,6,4]49 ; IDL> y2 = [5,6,8]50 ; IDL> x3 = [0,4,2]51 ; IDL> y3 = [1,4,8]52 ; IDL> n = 453 ; IDL> splot, [0,10], [0,10], xstyle = 1, ystyle = 1,/nodata54 ; IDL> for i=0,2 do oplot, [x0[i],x1[i],x2[i],x3[i],x0[i]],[y0[i],y1[i],y2[i],y3[i],y0[i]]55 ; IDL> res=cutpar(x0, y0, x1, y1, x2, y2, x3, y3, n)56 ; IDL> for i=0,2 do oplot, [res[0,*,i]], [res[1,*,i]], color = 20+10*i, psym = 1, thick = 344 ; IDL> x0 = [2,6,2] 45 ; IDL> y0 = [0,2,6] 46 ; IDL> x1 = [3,8,4] 47 ; IDL> y1 = [4,4,6] 48 ; IDL> x2 = [1,6,4] 49 ; IDL> y2 = [5,6,8] 50 ; IDL> x3 = [0,4,2] 51 ; IDL> y3 = [1,4,8] 52 ; IDL> n = 4 53 ; IDL> splot, [0,10], [0,10], xstyle = 1, ystyle = 1,/nodata 54 ; IDL> for i=0,2 do oplot, [x0[i],x1[i],x2[i],x3[i],x0[i]],[y0[i],y1[i],y2[i],y3[i],y0[i]] 55 ; IDL> res=cutpar(x0, y0, x1, y1, x2, y2, x3, y3, n) 56 ; IDL> for i=0,2 do oplot, [res[0,*,i]], [res[1,*,i]], color = 20+10*i, psym = 1, thick = 3 57 57 ; 58 58 ; @history -
trunk/SRC/Interpolation/cutsegment.pro
r327 r371 30 30 ; 31 31 ; @examples 32 ; IDL> x0=[2,5] 33 ; IDL> y0=[5,1] 34 ; IDL> x1=[9,3] 35 ; IDL> y1=[1,8] 36 ; IDL> res=cutsegment(x0, y0, x1, y1, 10) 37 ; IDL> splot, [0,10], [0,10], xstyle = 1, ystyle = 1,/nodata 38 ; IDL> oplot, [x0[0], x1[0]], [y0[0], y1[0]] 39 ; IDL> oplot, [res[0,*,0]], [res[1,*,0]], color = 20, psym = 1, thick = 3 40 ; IDL> oplot, [x0[1], x1[1]], [y0[1], y1[1]] 41 ; IDL> oplot, [res[0,*,1]], [res[1,*,1]], color = 40, psym = 1, thick = 3 32 ; 33 ; IDL> x0=[2,5] 34 ; IDL> y0=[5,1] 35 ; IDL> x1=[9,3] 36 ; IDL> y1=[1,8] 37 ; IDL> res=cutsegment(x0, y0, x1, y1, 10) 38 ; IDL> splot, [0,10], [0,10], xstyle = 1, ystyle = 1,/nodata 39 ; IDL> oplot, [x0[0], x1[0]], [y0[0], y1[0]] 40 ; IDL> oplot, [res[0,*,0]], [res[1,*,0]], color = 20, psym = 1, thick = 3 41 ; IDL> oplot, [x0[1], x1[1]], [y0[1], y1[1]] 42 ; IDL> oplot, [res[0,*,1]], [res[1,*,1]], color = 40, psym = 1, thick = 3 42 43 ; 43 44 ; @history -
trunk/SRC/Interpolation/extrapolate.pro
r327 r371 39 39 ; 40 40 ; @examples 41 ; IDL> a=extrapolate(dist(jpi,jpj),tmask[*,*,0],/x_periodic) 42 ; IDL> tvplus, a 43 ; IDL> tvplus, a*(1-tmask[*,*,0]) 41 ; 42 ; IDL> a=extrapolate(dist(jpi,jpj),tmask[*,*,0],/x_periodic) 43 ; IDL> tvplus, a 44 ; IDL> tvplus, a*(1-tmask[*,*,0]) 45 ; 44 46 ; get the coastline: 45 ; IDL> a=extrapolate(tmask[*,*,0],tmask[*,*,0],1,/x_periodic) 46 ; IDL> tvplus, a-tmask[*,*,0] 47 ; 48 ; IDL> a=extrapolate(tmask[*,*,0],tmask[*,*,0],1,/x_periodic) 49 ; IDL> tvplus, a-tmask[*,*,0] 47 50 ; 48 51 ; @history -
trunk/SRC/Interpolation/extrapsmooth.pro
r327 r371 37 37 ; 38 38 ; @examples 39 ; IDL> a=extrapsmooth(dist(jpi,jpj),tmask[*,*,0],/x_periodic) 40 ; IDL> tvplus, a 39 ; 40 ; IDL> a=extrapsmooth(dist(jpi,jpj),tmask[*,*,0],/x_periodic) 41 ; IDL> tvplus, a 42 ; 41 43 ; compare to extrapolate result: 42 ; IDL> b=extrapolate(dist(jpi,jpj),tmask[*,*,0],/x_periodic) 43 ; IDL> tvplus, b, window = 1 44 ; 45 ; IDL> b=extrapolate(dist(jpi,jpj),tmask[*,*,0],/x_periodic) 46 ; IDL> tvplus, b, window = 1 44 47 ; 45 48 ; @history -
trunk/SRC/Interpolation/file_interp.pro
r362 r371 232 232 ; @examples 233 233 ; 234 ; IDL> file_interp, filein, fileout, gridout, inxaxisname = 'lo', inyaxisname = 'la', keep = ['lo', 'la', 'cond_sed'] 235 ; 236 ; IDL> file_interp, in, out, gdout, inuseasmask = 'sst', inmissing_value = -1.00000e+30, missing_value = -1000.00 234 ; IDL> file_interp, filein, fileout, gridout, inxaxisname = 'lo', inyaxisname = 'la', keep = ['lo', 'la', 'cond_sed'] 235 ; IDL> file_interp, in, out, gdout, inuseasmask = 'sst', inmissing_value = -1.00000e+30, missing_value = -1000.00 237 236 ; 238 237 ; @history -
trunk/SRC/Interpolation/fromirr.pro
r327 r371 65 65 ; To interpolate 1 field: 66 66 ; 67 ; IDL> tncep = fromirr('bilinear', topa, glamt, gphit, tmask[*,*,0], lonout, latout, mskout)67 ; IDL> tncep = fromirr('bilinear', topa, glamt, gphit, tmask[*,*,0], lonout, latout, mskout) 68 68 ; 69 69 ; or if you have several fields to interpolate from the same source and target grids … … 72 72 ; (that must be undefined or equal to 0 before calling fromirr) 73 73 ; 74 ; IDL> t1ncep = fromirr('bilinear', topa, glamt, gphit, tmask[*,*,0], lonout, latout, mskout $74 ; IDL> t1ncep = fromirr('bilinear', topa, glamt, gphit, tmask[*,*,0], lonout, latout, mskout $ 75 75 ; , WEIG = a, ADDR = b) 76 ; IDL> help, a, b76 ; IDL> help, a, b 77 77 ; 78 78 ; 2) use a and b that are now defined to bypass the computation of the weights 79 79 ; and addresses and speed-up the computation! 80 80 ; 81 ; IDL> t2ncep = fromirr('bilinear', topa, WEIG = a, ADDR = b)81 ; IDL> t2ncep = fromirr('bilinear', topa, WEIG = a, ADDR = b) 82 82 ; 83 83 ; @history -
trunk/SRC/Interpolation/fromreg.pro
r327 r371 67 67 ; To interpolate 1 field: 68 68 ; 69 ; IDL> topa = fromreg('bilinear', tncep, xncep, yncep, glamt, gphit)69 ; IDL> topa = fromreg('bilinear', tncep, xncep, yncep, glamt, gphit) 70 70 ; 71 71 ; or if you have several fields to interpolate from the same source and target grids … … 74 74 ; (that must be undefined or equal to 0 before calling fromreg 75 75 ; 76 ; IDL> t1opa = fromreg('bilinear', t1ncep, xncep, yncep, glamt, gphit, WEIG = a, ADDR = b)77 ; IDL> help, a, b76 ; IDL> t1opa = fromreg('bilinear', t1ncep, xncep, yncep, glamt, gphit, WEIG = a, ADDR = b) 77 ; IDL> help, a, b 78 78 ; 79 79 ; 2) use a and b that are now defined to bypass the computation of the weights and addresses 80 80 ; and speed-up the computation! 81 81 ; 82 ; IDL> t2opa = fromreg('bilinear', t2ncep, xncep, yncep, glamt, gphit, WEIG = a, ADDR = b)82 ; IDL> t2opa = fromreg('bilinear', t2ncep, xncep, yncep, glamt, gphit, WEIG = a, ADDR = b) 83 83 ; 84 84 ; @history -
trunk/SRC/Interpolation/get_gridparams.pro
r327 r371 14 14 ; 15 15 ; Case 1: 16 ; IDL> get_gridparams, file name/id, lonname, latname, lon, lat, jpi, jpj, n_dimensions16 ; IDL> get_gridparams, file name/id, lonname, latname, lon, lat, jpi, jpj, n_dimensions 17 17 ; 18 18 ; Case 2: 19 ; IDL> get_gridparams, lon, lat, jpi, jpj, n_dimensions19 ; IDL> get_gridparams, lon, lat, jpi, jpj, n_dimensions 20 20 ; 21 21 ; @param in1 {in}{required} -
trunk/SRC/Interpolation/inquad.pro
r327 r371 54 54 ; @examples 55 55 ; 56 ; IDL> x = 1.*[1, 2, 6, 7, 3]57 ; IDL> y = 1.*[1, 3, 3, 4, 7]58 ; IDL> x1 = 1.*[0,4,2]59 ; IDL> y1 = 1.*[1,4,8]60 ; IDL> x2 = 1.*[1,6,4]61 ; IDL> y2 = 1.*[5,6,8]62 ; IDL> x3 = 1.*[3,8,4]63 ; IDL> y3 = 1.*[4,4,6]64 ; IDL> x4 = 1.*[2,6,2]65 ; IDL> y4 = 1.*[0,2,6]66 ; IDL> splot, [0,10], [0,10], xstyle = 1, ystyle = 1,/nodata67 ; IDL> for i=0,2 do oplot, [x4[i],x1[i],x2[i],x3[i],x4[i]],[y4[i],y1[i],y2[i],y3[i],y4[i]]68 ; IDL> oplot, x, y, color = 20, psym = 1, thick = 269 ; IDL> print, inquad(x, y, x1, y1, x2, y2, x3, y3, x4, y4)56 ; IDL> x = 1.*[1, 2, 6, 7, 3] 57 ; IDL> y = 1.*[1, 3, 3, 4, 7] 58 ; IDL> x1 = 1.*[0,4,2] 59 ; IDL> y1 = 1.*[1,4,8] 60 ; IDL> x2 = 1.*[1,6,4] 61 ; IDL> y2 = 1.*[5,6,8] 62 ; IDL> x3 = 1.*[3,8,4] 63 ; IDL> y3 = 1.*[4,4,6] 64 ; IDL> x4 = 1.*[2,6,2] 65 ; IDL> y4 = 1.*[0,2,6] 66 ; IDL> splot, [0,10], [0,10], xstyle = 1, ystyle = 1,/nodata 67 ; IDL> for i=0,2 do oplot, [x4[i],x1[i],x2[i],x3[i],x4[i]],[y4[i],y1[i],y2[i],y3[i],y4[i]] 68 ; IDL> oplot, x, y, color = 20, psym = 1, thick = 2 69 ; IDL> print, inquad(x, y, x1, y1, x2, y2, x3, y3, x4, y4) 70 70 ; 71 71 ; On a sphere see -
trunk/SRC/Interpolation/inrecgrid.pro
r327 r371 35 35 ; @examples 36 36 ; 37 ; IDL> a=indgen(5)38 ; IDL> b=indgen(7)39 ; IDL> r=inrecgrid([0.25,3.25,2],[4.25,2.8,1.4],a,b)40 ; IDL> print, r37 ; IDL> a=indgen(5) 38 ; IDL> b=indgen(7) 39 ; IDL> r=inrecgrid([0.25,3.25,2],[4.25,2.8,1.4],a,b) 40 ; IDL> print, r 41 41 ; 20 13 7 42 ; IDL> r=inrecgrid([0.25,3.25,2],[4.25,2.8,1.4],a,a+1,b,b+1,/output2d)43 ; IDL> print, r42 ; IDL> r=inrecgrid([0.25,3.25,2],[4.25,2.8,1.4],a,a+1,b,b+1,/output2d) 43 ; IDL> print, r 44 44 ; 0.00000 4.00000 45 45 ; 3.00000 2.00000 -
trunk/SRC/Interpolation/lbcorca.pro
r331 r371 29 29 ; 30 30 ; @examples 31 ; IDL> \@tst_initorca2 32 ; IDL> a = dist(jpiglo, jpjglo) 33 ; IDL> print, lbcorca(a, 'T') 34 ; IDL> dummy = lbcorca(a, 'T', /correction) 35 ; IDL> print, lbcorca(a, 'T') 31 ; 32 ; IDL> \@tst_initorca2 33 ; IDL> a = dist(jpiglo, jpjglo) 34 ; IDL> print, lbcorca(a, 'T') 35 ; IDL> dummy = lbcorca(a, 'T', /correction) 36 ; IDL> print, lbcorca(a, 'T') 36 37 37 38 ; @history -
trunk/SRC/Interpolation/ll_narcs_distances.pro
r327 r371 40 40 ; 41 41 ; @examples 42 ; IDL> Lon_lat0 = [1.0, 2.0]; Initial point specified in radians 43 ; IDL> Arc_Dist = 2.0; Arc distance in radians 44 ; IDL> Az = 1.0; Azimuth in radians 45 ; IDL> Result = LL_ARC_DISTANCE(Lon_lat0, Arc_Dist, Az) 46 ; IDL> PRINT, Result 42 ; 43 ; IDL> Lon_lat0 = [1.0, 2.0]; Initial point specified in radians 44 ; IDL> Arc_Dist = 2.0; Arc distance in radians 45 ; IDL> Az = 1.0; Azimuth in radians 46 ; IDL> Result = LL_ARC_DISTANCE(Lon_lat0, Arc_Dist, Az) 47 ; IDL> PRINT, Result 47 48 ; 2.91415 -0.622234 48 49 ; 49 ; IDL> lon0 = [-10, 20, 100]50 ; IDL> lat0 = [0, -10, 45]51 ; IDL> lon1 = [10, 60, 280]52 ; IDL> lat1 = [0, 10, 45]53 ; IDL> dist = map_npoints(lon0, lat0, lon1, lat1, azimuth = azi, /two_by_two)54 ; IDL> earthradius = 6378206.4d055 ; IDL> res = ll_narcs_distances(lon0, lat0, dist/earthradius, azi, /degrees)56 ; IDL> print, reform(res[0, *])50 ; IDL> lon0 = [-10, 20, 100] 51 ; IDL> lat0 = [0, -10, 45] 52 ; IDL> lon1 = [10, 60, 280] 53 ; IDL> lat1 = [0, 10, 45] 54 ; IDL> dist = map_npoints(lon0, lat0, lon1, lat1, azimuth = azi, /two_by_two) 55 ; IDL> earthradius = 6378206.4d0 56 ; IDL> res = ll_narcs_distances(lon0, lat0, dist/earthradius, azi, /degrees) 57 ; IDL> print, reform(res[0, *]) 57 58 ; 10.000000 60.000000 280.00000 58 ; IDL> print, reform(res[1, *])59 ; IDL> print, reform(res[1, *]) 59 60 ; 1.1999280e-15 10.000000 45.000000 60 61 ; -
trunk/SRC/Interpolation/map_npoints.pro
r327 r371 48 48 ; and P1[i] (in that case, we have np0 = np1 = np) ; if /MIDDLE see this keyword. 49 49 ; @examples 50 ; IDL> print, $51 ; IDL> map_npoints([-105.15,1],[40.02,1],[-0.07,100,50],[51.30,20,0])50 ; IDL> print, $ 51 ; IDL> map_npoints([-105.15,1],[40.02,1],[-0.07,100,50],[51.30,20,0]) 52 52 ; 7551369.3 5600334.8 53 53 ; 12864354. 10921254. 54 54 ; 14919237. 5455558.8 55 55 ; 56 ; IDL> lon0 = [-10, 20, 100]57 ; IDL> lat0 = [0, -10, 45]58 ; IDL> lon1 = [10, 60, 280]59 ; IDL> lat1 = [0, 10, 45]60 ; IDL> dist = map_npoints(lon0, lat0, lon1, lat1, AZIMUTH = azi)61 ; IDL> help, dist, azi56 ; IDL> lon0 = [-10, 20, 100] 57 ; IDL> lat0 = [0, -10, 45] 58 ; IDL> lon1 = [10, 60, 280] 59 ; IDL> lat1 = [0, 10, 45] 60 ; IDL> dist = map_npoints(lon0, lat0, lon1, lat1, AZIMUTH = azi) 61 ; IDL> help, dist, azi 62 62 ; DIST DOUBLE = Array[3, 3] 63 63 ; AZI DOUBLE = Array[3, 3] 64 ; IDL> print, dist[4*lindgen(3)], azi[4*lindgen(3)]64 ; IDL> print, dist[4*lindgen(3)], azi[4*lindgen(3)] 65 65 ; 2226414.0 4957944.5 10018863. 66 66 ; 90.000000 64.494450 4.9615627e-15 67 ; IDL> dist = map_npoints(lon0, lat0, lon1, lat1, AZIMUTH = azi, /TWO_BY_TWO)68 ; IDL> help, dist, azi67 ; IDL> dist = map_npoints(lon0, lat0, lon1, lat1, AZIMUTH = azi, /TWO_BY_TWO) 68 ; IDL> help, dist, azi 69 69 ; DIST DOUBLE = Array[3] 70 70 ; AZI DOUBLE = Array[3] 71 ; IDL> print, dist, azi71 ; IDL> print, dist, azi 72 72 ; 2226414.0 4957944.5 10018863. 73 73 ; 90.000000 64.494450 4.9615627e-15 74 ; IDL> print, map_2points(lon0[0], lat0[0], lon1[0], lat1[0])74 ; IDL> print, map_2points(lon0[0], lat0[0], lon1[0], lat1[0]) 75 75 ; 20.000000 90.000000 76 ; IDL> print, map_npoints(lon0[0], lat0[0], lon1[0], lat1[0], AZIMUTH=azi)/6378206.4d0 / !dtor, azi76 ; IDL> print, map_npoints(lon0[0], lat0[0], lon1[0], lat1[0], AZIMUTH=azi)/6378206.4d0 / !dtor, azi 77 77 ; 20.000000 78 78 ; 90.000000 79 79 ; 80 ; IDL> lon0 = [-10, 20, 100]81 ; IDL> lat0 = [0, -10, 45]82 ; IDL> lon1 = [10, 60, 280]83 ; IDL> lat1 = [0, 10, 45]84 ; IDL> mid = map_npoints(lon0, lat0, lon1, lat1, /MIDDLE, /TWO_BY_TWO)85 ; IDL> print, reform(mid[0,*]), reform(mid[1,*])80 ; IDL> lon0 = [-10, 20, 100] 81 ; IDL> lat0 = [0, -10, 45] 82 ; IDL> lon1 = [10, 60, 280] 83 ; IDL> lat1 = [0, 10, 45] 84 ; IDL> mid = map_npoints(lon0, lat0, lon1, lat1, /MIDDLE, /TWO_BY_TWO) 85 ; IDL> print, reform(mid[0,*]), reform(mid[1,*]) 86 86 ; 0.0000000 40.000000 190.00000 87 87 ; 0.0000000 -1.5902773e-15 90.000000 88 ; IDL> print, (map_2points(lon0[0], lat0[0], lon1[0], lat1[0], npath = 3))[*, 1]88 ; IDL> print, (map_2points(lon0[0], lat0[0], lon1[0], lat1[0], npath = 3))[*, 1] 89 89 ; 0.0000000 0.0000000 90 ; IDL> print, (map_2points(lon0[1], lat0[1], lon1[1], lat1[1], npath = 3))[*, 1]90 ; IDL> print, (map_2points(lon0[1], lat0[1], lon1[1], lat1[1], npath = 3))[*, 1] 91 91 ; 40.000000 -1.5902773e-15 92 ; IDL> print, (map_2points(lon0[2], lat0[2], lon1[2], lat1[2], npath = 3))[*, 1]92 ; IDL> print, (map_2points(lon0[2], lat0[2], lon1[2], lat1[2], npath = 3))[*, 1] 93 93 ; 190.00000 90.000000 94 94 ; -
trunk/SRC/Interpolation/neighbor.pro
r327 r371 32 32 ; 33 33 ; @examples 34 ; IDL> print, neighbor(-105.15,40.02,[-0.07,100,50],[51.30,20,0], $ 35 ; IDL> distance=dis) 34 ; 35 ; IDL> print, neighbor(-105.15,40.02,[-0.07,100,50],[51.30,20,0], $ 36 ; distance=dis) 36 37 ; 0 37 ; IDL> print, dis38 ; IDL> print, dis 38 39 ; 105.684 206.125 160.228 39 40 ; -
trunk/SRC/Interpolation/quadrilateral2square.pro
r358 r371 56 56 ; @examples 57 57 ; 58 ; IDL> splot,[0,5],[0,3],/nodata,xstyle=1,ystyle=159 ; IDL> tracegrille, findgen(11)*.1, findgen(11)*.1,color=indgen(12)*2060 ; IDL> xin = (findgen(11)*.1)#replicate(1, 11)61 ; IDL> yin = replicate(1, 11)#(findgen(11)*.1)62 ; IDL> out = square2quadrilateral(2,1,3,0,5,1,2,3, xin, yin)63 ; IDL> tracegrille, reform(out[0,*],11,11), reform(out[1,*],11,11),color=indgen(12)*2058 ; IDL> splot,[0,5],[0,3],/nodata,xstyle=1,ystyle=1 59 ; IDL> tracegrille, findgen(11)*.1, findgen(11)*.1,color=indgen(12)*20 60 ; IDL> xin = (findgen(11)*.1)#replicate(1, 11) 61 ; IDL> yin = replicate(1, 11)#(findgen(11)*.1) 62 ; IDL> out = square2quadrilateral(2,1,3,0,5,1,2,3, xin, yin) 63 ; IDL> tracegrille, reform(out[0,*],11,11), reform(out[1,*],11,11),color=indgen(12)*20 64 64 ; 65 ; IDL> inorg=quadrilateral2square(2,1,3,0,5,1,2,3,out[0,*],out[1,*])66 ; IDL> tracegrille, reform(inorg[0,*],11,11), reform(inorg[1,*],11,11),color=indgen(12)*2065 ; IDL> inorg=quadrilateral2square(2,1,3,0,5,1,2,3,out[0,*],out[1,*]) 66 ; IDL> tracegrille, reform(inorg[0,*],11,11), reform(inorg[1,*],11,11),color=indgen(12)*20 67 67 ; 68 68 ; @history -
trunk/SRC/Interpolation/spl_fstdrv.pro
r325 r371 13 13 ; 14 14 ; @examples 15 ; IDL> y2 = spl_fstdrv(x, y, yscd, x2) 15 ; 16 ; IDL> y2 = spl_fstdrv(x, y, yscd, x2) 16 17 ; 17 18 ; @param x {in}{required} -
trunk/SRC/Interpolation/spl_incr.pro
r327 r371 34 34 ; 35 35 ; @examples 36 ; IDL> n = 100L 37 ; IDL> x = (dindgen(n))^2 38 ; IDL> y = abs(randomn(0, n)) 39 ; IDL> y[n/2:n/2+1] = 0. 40 ; IDL> y[n-n/3] = 0. 41 ; IDL> y[n-n/6:n-n/6+5] = 0. 42 ; IDL> y = total(y, /cumulative, /double) 43 ; IDL> x2 = dindgen((n-1)^2) 44 ; IDL> n2 = n_elements(x2) 45 ; IDL> print, min(y[1:n-1]-y[0:n-2]) LT 0 46 ; IDL> y2 = spl_incr( x, y, x2) 47 ; IDL> splot, x, y, xstyle = 1, ystyle = 1, ysurx=.25, petit = [1, 2, 1], /land 48 ; IDL> oplot, x2, y2, color = 100 49 ; IDL> c = y2[1:n2-1] - y2[0:n2-2] 50 ; IDL> print, min(c) LT 0 51 ; IDL> print, min(c, max = ma), ma 52 ; IDL> splot,c,xstyle=1,ystyle=1, yrange=[-.01,.05], ysurx=.25, petit = [1, 2, 2], /noerase 53 ; IDL> oplot,[0, n_elements(c)], [0, 0], linestyle = 1 36 ; 37 ; IDL> n = 100L 38 ; IDL> x = (dindgen(n))^2 39 ; IDL> y = abs(randomn(0, n)) 40 ; IDL> y[n/2:n/2+1] = 0. 41 ; IDL> y[n-n/3] = 0. 42 ; IDL> y[n-n/6:n-n/6+5] = 0. 43 ; IDL> y = total(y, /cumulative, /double) 44 ; IDL> x2 = dindgen((n-1)^2) 45 ; IDL> n2 = n_elements(x2) 46 ; IDL> print, min(y[1:n-1]-y[0:n-2]) LT 0 47 ; IDL> y2 = spl_incr( x, y, x2) 48 ; IDL> splot, x, y, xstyle = 1, ystyle = 1, ysurx=.25, petit = [1, 2, 1], /land 49 ; IDL> oplot, x2, y2, color = 100 50 ; IDL> c = y2[1:n2-1] - y2[0:n2-2] 51 ; IDL> print, min(c) LT 0 52 ; IDL> print, min(c, max = ma), ma 53 ; IDL> splot,c,xstyle=1,ystyle=1, yrange=[-.01,.05], ysurx=.25, petit = [1, 2, 2], /noerase 54 ; IDL> oplot,[0, n_elements(c)], [0, 0], linestyle = 1 54 55 ; 55 56 ; @history -
trunk/SRC/Interpolation/spl_keep_mean.pro
r327 r371 49 49 ; 12 monthly values of precipitations into daily values: 50 50 ; 51 ; IDL> yr1 = 199052 ; IDL> yr2 = 199253 ; IDL> nyr = yr2-yr1+154 ; IDL> n1 = 12*nyr+155 ; IDL> x = julday(1+findgen(n1), replicate(1, n1) $56 ; IDL> , replicate(yr1, n1), fltarr(n1))57 ; IDL> n2 = 365*nyr + total(leapyr(yr1+indgen(nyr))) + 158 ; IDL> x2 = julday(replicate(1, n2), 1+findgen(n2) $59 ; IDL> , replicate(yr1, n2), fltarr(n2))60 ; IDL> y = abs(randomn(0, n1-1))61 ; IDL> y2 = spl_keep_mean(x, y, x2, /ge0)62 63 ; IDL> print, min(x, max = ma), ma64 ; IDL> print, min(x2, max = ma), ma65 ; IDL> print, vairdate([min(x, max = ma), ma])66 ; IDL> print, total(y*(x[1:n1-1]-x[0:n1-2]))67 ; IDL> print, total(y2*(x2[1:n2-1]-x2[0:n2-2]))51 ; IDL> yr1 = 1990 52 ; IDL> yr2 = 1992 53 ; IDL> nyr = yr2-yr1+1 54 ; IDL> n1 = 12*nyr+1 55 ; IDL> x = julday(1+findgen(n1), replicate(1, n1) $ 56 ; IDL> , replicate(yr1, n1), fltarr(n1)) 57 ; IDL> n2 = 365*nyr + total(leapyr(yr1+indgen(nyr))) + 1 58 ; IDL> x2 = julday(replicate(1, n2), 1+findgen(n2) $ 59 ; IDL> , replicate(yr1, n2), fltarr(n2)) 60 ; IDL> y = abs(randomn(0, n1-1)) 61 ; IDL> y2 = spl_keep_mean(x, y, x2, /ge0) 62 ; 63 ; IDL> print, min(x, max = ma), ma 64 ; IDL> print, min(x2, max = ma), ma 65 ; IDL> print, vairdate([min(x, max = ma), ma]) 66 ; IDL> print, total(y*(x[1:n1-1]-x[0:n1-2])) 67 ; IDL> print, total(y2*(x2[1:n2-1]-x2[0:n2-2])) 68 68 ; 69 69 ; @history -
trunk/SRC/Interpolation/square2quadrilateral.pro
r358 r371 51 51 ; @examples 52 52 ; 53 ; IDL> splot,[0,5],[0,3],/nodata,xstyle=1,ystyle=154 ; IDL> tracegrille, findgen(11)*.1, findgen(11)*.1,color=indgen(12)*2055 ; IDL> xin = (findgen(11)*.1)#replicate(1, 11)56 ; IDL> yin = replicate(1, 11)#(findgen(11)*.1)57 ; IDL> out = square2quadrilateral(2,1,3,0,5,1,2,3, xin, yin)58 ; IDL> tracegrille, reform(out[0,*],11,11), reform(out[1,*],11,11),color=indgen(12)*2053 ; IDL> splot,[0,5],[0,3],/nodata,xstyle=1,ystyle=1 54 ; IDL> tracegrille, findgen(11)*.1, findgen(11)*.1,color=indgen(12)*20 55 ; IDL> xin = (findgen(11)*.1)#replicate(1, 11) 56 ; IDL> yin = replicate(1, 11)#(findgen(11)*.1) 57 ; IDL> out = square2quadrilateral(2,1,3,0,5,1,2,3, xin, yin) 58 ; IDL> tracegrille, reform(out[0,*],11,11), reform(out[1,*],11,11),color=indgen(12)*20 59 59 ; 60 60 ; @history
Note: See TracChangeset
for help on using the changeset viewer.