- Timestamp:
- 06/19/06 15:20:37 (18 years ago)
- Location:
- trunk/SRC
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Documentation/idldoc_html_output/Interpolation/fromirr.html
r112 r113 717 717 718 718 <p class="header"> 719 <span class="result">result = </span>fromirr(<span class="result"><a href="#_fromirr_param_method">method</a>, <a href="#_fromirr_param_datain">datain</a> [, <a href="#_fromirr_param_lonin">lonin</a>][, <a href="#_fromirr_param_latin">latin</a>][, <a href="#_fromirr_param_mskin">mskin</a>][, <a href="#_fromirr_param_lonout">lonout</a>][, <a href="#_fromirr_param_latout">latout</a>][, <a href="#_fromirr_param_mskout">mskout</a>]</span>, <a href="#_fromirr_keyword_WEIG">WEIG</a>=<span class="result">WEIG</span>, <a href="#_fromirr_keyword_ADDR">ADDR</a>=<span class="result">ADDR</span>)</p>719 <span class="result">result = </span>fromirr(<span class="result"><a href="#_fromirr_param_method">method</a>, <a href="#_fromirr_param_datain">datain</a>, <a href="#_fromirr_param_lonin">lonin</a>, <a href="#_fromirr_param_latin">latin</a>, <a href="#_fromirr_param_mskin">mskin</a>, <a href="#_fromirr_param_lonout">lonout</a>, <a href="#_fromirr_param_latout">latout</a>, <a href="#_fromirr_param_mskout">mskout</a></span>, <a href="#_fromirr_keyword_WEIG">WEIG</a>=<span class="result">WEIG</span>, <a href="#_fromirr_keyword_ADDR">ADDR</a>=<span class="result">ADDR</span>)</p> 720 720 721 721 <div class="comments"> … … 758 758 <span class="attr">in</span> 759 759 760 <span class="attr">optional</span>761 760 761 <span class="attr">required</span> 762 762 763 763 … … 766 766 </h4> 767 767 768 <div class="comments"> a 2D array defining the longitude of the input data 769 optionals if WEIG and ADDR keywords used.</div> 768 <div class="comments"> a 2D array defining the longitude of the input data</div> 770 769 771 770 <h4 id="_fromirr_param_latin">latin 772 771 <span class="attr">in</span> 773 772 774 <span class="attr">optional</span>775 773 774 <span class="attr">required</span> 776 775 777 776 … … 780 779 </h4> 781 780 782 <div class="comments"> a 2D array defining the latitude of the input data. 783 optionals if WEIG and ADDR keywords used.</div> 781 <div class="comments"> a 2D array defining the latitude of the input data.</div> 784 782 785 783 <h4 id="_fromirr_param_mskin">mskin 786 784 <span class="attr">in</span> 787 785 788 <span class="attr">optional</span>789 786 787 <span class="attr">required</span> 790 788 791 789 … … 799 797 <span class="attr">in</span> 800 798 801 <span class="attr">optional</span>802 799 800 <span class="attr">required</span> 803 801 804 802 … … 807 805 </h4> 808 806 809 <div class="comments"> 1D or 2D array defining the longitude of the output data. 810 optionals if WEIG and ADDR keywords used.</div> 807 <div class="comments"> 1D or 2D array defining the longitude of the output data.</div> 811 808 812 809 <h4 id="_fromirr_param_latout">latout 813 810 <span class="attr">in</span> 814 811 815 <span class="attr">optional</span>816 812 813 <span class="attr">required</span> 817 814 818 815 … … 821 818 </h4> 822 819 823 <div class="comments"> 1D or 2D array defining the latitude of the output data. 824 optionals if WEIG and ADDR keywords used.</div> 820 <div class="comments"> 1D or 2D array defining the latitude of the output data.</div> 825 821 826 822 <h4 id="_fromirr_param_mskout">mskout 827 823 <span class="attr">in</span> 828 824 829 <span class="attr">optional</span>830 825 826 <span class="attr">required</span> 831 827 832 828 … … 869 865 </h4> 870 866 871 <div class="comments"> :2D arrays, weig and addr are the weight and addresses used to867 <div class="comments"> 2D arrays, weig and addr are the weight and addresses used to 872 868 perform the interpolation: 873 869 dataout = total(weig*datain[addr], 1) 874 870 dataout = reform(dataout, jpio, jpjo, /over) 875 Those keywords can be set to named variables into which the values will be876 copied when the current routine exits. Next, they can be used to perform871 Those keywords can be set to named variables (that are undefined or equal to 0) into which the 872 values will be copied when the current routine exits. Next, they can be used to perform 877 873 the interpolation whithout computing again those 2 parameters. This greatly 878 874 speed-up the interpolation! In that case, lonin, latin, lonout and latout are not necessary. -
trunk/SRC/Documentation/idldoc_html_output/Interpolation/fromreg.html
r111 r113 719 719 720 720 <p class="header"> 721 <span class="result">result = </span>fromreg(<span class="result"><a href="#_fromreg_param_method">method</a>, <a href="#_fromreg_param_datain">datain</a> [, <a href="#_fromreg_param_lonin">lonin</a>][, <a href="#_fromreg_param_latin">latin</a>][, <a href="#_fromreg_param_lonout">lonout</a>], <a href="#_fromreg_param_latout">latout</a></span>, <a href="#_fromreg_keyword_WEIG">WEIG</a>=<span class="result">WEIG</span>, <a href="#_fromreg_keyword_ADDR">ADDR</a>=<span class="result">ADDR</span>, <a href="#_fromreg_keyword_NONORTHERNLINE">NONORTHERNLINE</a>=<span class="result">NONORTHERNLINE</span>, <a href="#_fromreg_keyword_NOSOUTHERNLINE">NOSOUTHERNLINE</a>=<span class="result">NOSOUTHERNLINE</span>)</p>721 <span class="result">result = </span>fromreg(<span class="result"><a href="#_fromreg_param_method">method</a>, <a href="#_fromreg_param_datain">datain</a>, <a href="#_fromreg_param_lonin">lonin</a>, <a href="#_fromreg_param_latin">latin</a>, <a href="#_fromreg_param_lonout">lonout</a>, <a href="#_fromreg_param_latout">latout</a></span>, <a href="#_fromreg_keyword_WEIG">WEIG</a>=<span class="result">WEIG</span>, <a href="#_fromreg_keyword_ADDR">ADDR</a>=<span class="result">ADDR</span>, <a href="#_fromreg_keyword_NONORTHERNLINE">NONORTHERNLINE</a>=<span class="result">NONORTHERNLINE</span>, <a href="#_fromreg_keyword_NOSOUTHERNLINE">NOSOUTHERNLINE</a>=<span class="result">NOSOUTHERNLINE</span>)</p> 722 722 723 723 <div class="comments"> … … 761 761 <span class="attr">in</span> 762 762 763 <span class="attr">optional</span>764 763 764 <span class="attr">required</span> 765 765 766 766 … … 769 769 </h4> 770 770 771 <div class="comments"> longitude of the input data. optionals if 772 WEIG and ADDR keywords used.</div> 771 <div class="comments"> 1D or 2D array defining the longitude of the input data</div> 773 772 774 773 <h4 id="_fromreg_param_latin">latin 775 774 <span class="attr">in</span> 776 775 777 <span class="attr">optional</span>778 776 777 <span class="attr">required</span> 779 778 780 779 … … 783 782 </h4> 784 783 785 <div class="comments"> latitude of the input data. optionals if 786 WEIG and ADDR keywords used.</div> 784 <div class="comments"> 1D or 2D array defining the latitude of the input data</div> 787 785 788 786 <h4 id="_fromreg_param_lonout">lonout 789 787 <span class="attr">in</span> 790 788 791 <span class="attr">optional</span>792 789 790 <span class="attr">required</span> 793 791 794 792 … … 797 795 </h4> 798 796 799 <div class="comments"> longitude of the output data. optionals if 800 WEIG and ADDR keywords used. 801 latitude of the output data. optionals if 802 WEIG and ADDR keywords used. 797 <div class="comments"> 1D or 2D array defining the longitude of the output data 798 1D or 2D array defining the latitude of the output data 803 799 </div> 804 800 … … 851 847 dataout = total(weig*datain[addr], 1) 852 848 dataout = reform(dataout, jpio, jpjo, /over) 853 Those keywords can be set to named variables into which the values will be854 copied when the current routine exits. Next, they can be used to perform849 Those keywords can be set to named variables (that are undefined or equal to 0) into which the 850 values will be copied when the current routine exits. Next, they can be used to perform 855 851 the interpolation whithout computing again those 2 parameters. In that 856 852 case, lonin, latin, lonout and latout are not necessary. -
trunk/SRC/Documentation/idldoc_html_output/overview.html
r111 r113 969 969 <tr> 970 970 <td>Lines of code</td> 971 <td class="value"> 55 805</td>971 <td class="value"> 55797</td> 972 972 </tr> 973 973 </table> -
trunk/SRC/Documentation/idldoc_html_output/search.js
r111 r113 40 40 a[38] = new Array("./Interpolation/cutsegment.html", "cutsegment.pro", "", " file_comments cut p segments into p n equal parts categories basic work examples res cutsegment x0 y0 x1 y1 n param x0 y0 and x1 y1 in required 1d arrays of p elements the coordinates of the endpoints of the p segmements param n in required the number of pieces we want to cut each segment keyword endpoints see ouputs keyword onsphere to specify that the points are located on a sphere In this case x and y corresponds to longitude and latitude in degrees returns defaut: a 3d array 2 n p that gives the coordinates of the middle of the cutted segments if endpoints a 3d array 2 n 1 p that gives the coordinates of the endpoints of the cutted segments examples IDL x0 2 5 IDL y0 5 1 IDL x1 9 3 IDL y1 1 8 IDL res cutsegment x0 y0 x1 y1 10 IDL splot 0 10 0 10 xstyle 1 ystyle 1 nodata IDL oplot x0 0 x1 0 y0 0 y1 0 IDL oplot res 0 0 res 1 0 color 20 psym 1 thick 3 IDL oplot x0 1 x1 1 y0 1 y1 1 IDL oplot res 0 1 res 1 1 color 40 psym 1 thick 3 history S Masson smasson lodyc jussieu fr July 5th 2002 FUNCTION cutsegment x0 y0 x1 y1 n endpoints endpoints onsphere onsphere number of segment nseg n_elements x0 number of point to find on each segment n2find n keyword_set endpoints IF keyword_set onsphere THEN BEGIN save the inputs arrays x0in temporary x0 y0in temporary y0 x1in temporary x1 y1in temporary y1 sp_cood transpose x0in transpose y0in replicate 1 1 nseg rect_coord CV_COORD FROM_SPHERE temporary sp_cood TO_RECT DEGREES x0 rect_coord 0 y0 rect_coord 1 z0 rect_coord 2 rect_coord 1 free memory sp_cood transpose x1in transpose y1in replicate 1 1 nseg rect_coord CV_COORD FROM_SPHERE temporary sp_cood TO_RECT DEGREES x1 rect_coord 0 y1 rect_coord 1 z1 rect_coord 2 rect_coord 1 free memory ENDIF resx replicate 1 n2find x0 resx temporary resx 1 n findgen n2find 5 1 keyword_set endpoints x1 x0 resx temporary resx resy replicate 1 n2find y0 resy temporary resy 1 n findgen n2find 5 1 keyword_set endpoints y1 y0 resy temporary resy IF keyword_set onsphere THEN BEGIN resz replicate 1 n2find z0 resz temporary resz 1 n findgen n2find 5 1 keyword_set endpoints z1 z0 resz temporary resz rec_cood transpose temporary resx transpose temporary resy transpose temporary resz res CV_COORD FROM_RECT temporary rec_cood TO_SPHERE DEGREES restore the input arrays x0 temporary x0in y0 temporary y0in x1 temporary x1in y1 temporary y1in ENDIF ELSE res transpose temporary resx transpose temporary resy res reform res 0:1 2 n2find nseg overwrite RETURN res END"); 41 41 a[39] = new Array("./Interpolation/extrapolate.html", "extrapolate.pro", "", " file_comments extrapolate data zinput where maskinput eq 0 by filling step by step the coastline points with the mean value of the 8 neighbourgs FUNCTION extrapolate zinput maskinput nb_iteration x_periodic x_periodic MINVAL minval MAXVAL maxval compile_opt strictarr strictarrsubs check the number of iteration used in the extrapolation IF n_elements nb_iteration EQ 0 THEN nb_iteration 10 E20 IF nb_iteration EQ 0 THEN return zinput nx size zinput 1 ny size zinput 2 take care of the boundary conditions for the x direction we put 2 additional columns at the left and right side of the array for the y direction we put 2 additional lines at the bottom and top side of the array These changes allow us to use shift function without taking care of the x and y periodicity ztmp bytarr nx 2 ny 2 ztmp 1:nx 1:ny byte maskinput msk temporary ztmp ztmp replicate 1 e20 nx 2 ny 2 ztmp 1:nx 1:ny zinput if keyword_set x_periodic then begin ztmp 0 1:ny zinput nx 1 ztmp nx 1 1:ny zinput 0 ENDIF remove NaN points if there is some nan where finite ztmp EQ 0 cnt_nan IF cnt_nan NE 0 THEN ztmp temporary nan 1 e20 z temporary ztmp nx2 nx 2 ny2 ny 2 extrapolation sqrtinv 1 sqrt 2 cnt 1 When we look for the coast line we don t whant to select the borderlines of the array we force the value of the mask for those lines msk 0 1b msk nx 1 1b msk 0 1b msk ny 1 1b find the land points land where msk EQ 0 cnt_land WHILE cnt LE nb_iteration AND cnt_land NE 0 DO BEGIN find the coast line points Once the land points list has been found we change back the the mask values for the boundary conditions msk 0 0b msk nx 1 0b msk 0 0b msk ny 1 0b if keyword_set x_periodic then begin msk 0 msk nx msk nx 1 msk 1 endif we compute the weighted number of sea neighbourgs those 4 neighbours have a weight of 1: those 4 neighbours have a weight of 1 sqrt 2 : As we make sure that none of the land points are located on the border of the array we can compute the weight without shift faster weight msk land 1 msk land 1 msk land nx2 msk land nx2 sqrtinv msk land nx2 1 msk land nx2 1 msk land nx2 1 msk land nx2 1 list all the points that have sea neighbourgs ok where weight GT 0 the coastline points coast land ok their weighted number of sea neighbourgs weight weight temporary ok fill the coastine points z temporary z msk zcoast z 1 coast z 1 coast z nx2 coast z nx2 coast 1 sqrt 2 z nx2 1 coast z nx2 1 coast z nx2 1 coast z nx2 1 coast IF n_elements minval NE 0 THEN zcoast minval temporary zcoast IF n_elements maxval NE 0 THEN zcoast temporary zcoast we force the value of the mask for those lines msk 0 1b msk nx 1 1b msk 0 1b msk ny 1 1b find the land points land where msk EQ 0 cnt_land ENDWHILE we return the original size of the array return z 1:nx 1:ny END "); 42 a[40] = new Array("./Interpolation/fromirr.html", "fromirr.pro", "", " file_comments interpolate data from an irregular 2D grid to any 2D grid Only 1 metod available: bilinear categories interpolation examples dataout fromirr method datain lonin latin mskin lonout latout mskout param method: in required a string defining the interpolation method must be bilinear param datain: in required a 2D array the input data to interpolate param lonin: in optional a 2D array defining the longitude of the input data optionals if WEIG and ADDR keywords used param latin: in optional a 2D array defining the latitude of the input data optionals if WEIG and ADDR keywords used param mskin: in optional a 2D array the land sea mask of the input data 1 on ocean 0 on land param lonout: in optional 1D or 2D array defining the longitude of the output data optionals if WEIG and ADDR keywords used param latout: in optional 1D or 2D array defining the latitude of the output data optionals if WEIG and ADDR keywords used param mskout: in optional a 2D array the land sea mask of the ouput data 1 on ocean 0 on land keyword WEIG see ADDR keyword ADDR: 2D arrays weig and addr are the weight and addresses used to perform the interpolation: dataout total weig datain addr 1 dataout reform dataout jpio jpjo over Those keywords can be set to named variables into which the values will be copied when the current routine exits Next they can be used to perform the interpolation whithout computing again those 2 parameters This greatly speed up the interpolation In that case lonin latin lonout and latout are not necessary returns 2D array: the interpolated data restrictions We supposed the data are located on a sphere with a periodicity along the longitude Note that the input data can contain the same cells several times like ORCA grid near the north pole boundary examples tncep fromirr bilinear topa glamt gphit tmask 0 lonout latout mskout or t1ncep fromirr bilinear topa glamt gphit tmask 0 lonout latout mskout WEIG a ADDR b help a b t2ncep fromirr bilinear topa WEIG a ADDR b history June 2006: Sebastien Masson smasson lodyc jussieu fr FUNCTION fromirr method datain lonin latin mskin lonout latout mskout WEIG weig ADDR addr compile_opt strictarr strictarrsubs IF NOT keyword_set weig AND keyword_set addr THEN BEGIN atmospheric grid parameters alon lonin alat latin get_gridparams alon alat jpia jpja 2 double Oceanic grid parameters olon lonout olat latout get_gridparams olon olat jpio jpjo 2 double Compute weight and addressCASE method OF bilinear :compute_fromirr_bilinear_weigaddr alon alat mskin olon olat mskout weig addr ELSE:BEGIN print unknown interpolation method we stop stop ENDELSE ENDCASE ENDIF to the interpolation dataout total weig datain addr 1 dataout reform dataout jpio jpjo over RETURN dataout END");43 a[41] = new Array("./Interpolation/fromreg.html", "fromreg.pro", "", " file_comments interpolate data from a regular rectangular grid to any grid 2 metods availables: bilinear and imoms3 A regular rectangular grid is defined as a grid for which each lontitudes lines have the same latitude and each latitudes columns have the same longitude categories interpolation examples dataout fromreg method datain lonin latin lonout latout param method in required a string defining the interpolation method must be bilinear or imoms3 param datain in required a 2D array the input data to interpolate param lonin in optional longitude of the input data optionals if WEIG and ADDR keywords used param latin in optional latitude of the input data optionals if WEIG and ADDR keywords used param lonout in optional longitude of the output data optionals if WEIG and ADDR keywords used param lonout in optional latitude of the output data optionals if WEIG and ADDR keywords used keyword WEIG see ADDR keyword ADDR 2D arrays weig and addr are the weight and addresses used to perform the interpolation: dataout total weig datain addr 1 dataout reform dataout jpio jpjo over Those keywords can be set to named variables into which the values will be copied when the current routine exits Next they can be used to perform the interpolation whithout computing again those 2 parameters In that case lonin latin lonout and latout are not necessary keyword NONORTHERNLINE and NOSOUTHERNLINE activate if you don t whant to take into account the northen southern line of the input data when perfoming the interpolation returns 2D array: the interpolated data restrictions We supposed the data are located on a sphere with a periodicity along the longitude examples topa fromreg bilinear tncep xncep yncep glamt gphit or t1opa fromreg bilinear t1ncep xncep yncep glamt gphit WEIG a ADDR b help a b t2opa fromreg bilinear t2ncep xncep WEIG a ADDR b history November 2005: Sebastien Masson smasson lodyc jussieu fr FUNCTION fromreg method datain lonin latin lonout latout WEIG weig ADDR addr NONORTHERNLINE nonorthernline NOSOUTHERNLINE nosouthernline compile_opt strictarr strictarrsubs IF NOT keyword_set weig AND keyword_set addr THEN BEGIN atmospheric grid parameters alon lonin alat latin get_gridparams alon alat jpia jpja 1 double Oceanic grid parameters olon lonout olat latout get_gridparams olon olat jpio jpjo 2 double Compute weight and addressCASE method OF bilinear :compute_fromreg_bilinear_weigaddr alon alat olon olat weig addr NONORTHERNLINE nonorthernline NOSOUTHERNLINE nosouthernline imoms3 : compute_fromreg_imoms3_weigaddr alon alat olon olat weig addr NONORTHERNLINE nonorthernline NOSOUTHERNLINE nosouthernline ELSE:BEGIN print unknown interpolation method we stop stop ENDELSE ENDCASE ENDIF dataout total weig datain addr 1 dataout reform dataout jpio jpjo over RETURN dataout END");42 a[40] = new Array("./Interpolation/fromirr.html", "fromirr.pro", "", " file_comments interpolate data from an irregular 2D grid to any 2D grid Only 1 metod available: bilinear categories interpolation examples dataout fromirr method datain lonin latin mskin lonout latout mskout param method: in required a string defining the interpolation method must be bilinear param datain: in required a 2D array the input data to interpolate param lonin: in required a 2D array defining the longitude of the input data param latin: in required a 2D array defining the latitude of the input data param mskin: in required a 2D array the land sea mask of the input data 1 on ocean 0 on land param lonout: in required 1D or 2D array defining the longitude of the output data param latout: in required 1D or 2D array defining the latitude of the output data param mskout: in required a 2D array the land sea mask of the ouput data 1 on ocean 0 on land keyword WEIG see ADDR keyword ADDR 2D arrays weig and addr are the weight and addresses used to perform the interpolation: dataout total weig datain addr 1 dataout reform dataout jpio jpjo over Those keywords can be set to named variables that are undefined or equal to 0 into which the values will be copied when the current routine exits Next they can be used to perform the interpolation whithout computing again those 2 parameters This greatly speed up the interpolation In that case lonin latin lonout and latout are not necessary returns 2D array: the interpolated data restrictions We supposed the data are located on a sphere with a periodicity along the longitude Note that the input data can contain the same cells several times like ORCA grid near the north pole boundary examples tncep fromirr bilinear topa glamt gphit tmask 0 lonout latout mskout or t1ncep fromirr bilinear topa glamt gphit tmask 0 lonout latout mskout WEIG a ADDR b help a b t2ncep fromirr bilinear topa WEIG a ADDR b history June 2006: Sebastien Masson smasson lodyc jussieu fr FUNCTION fromirr method datain lonin latin mskin lonout latout mskout WEIG weig ADDR addr compile_opt strictarr strictarrsubs atmospheric grid parameters alon lonin alat latin get_gridparams alon alat jpia jpja 2 double Oceanic grid parameters olon lonout olat latout get_gridparams olon olat jpio jpjo 2 double Compute weight and address IF NOT keyword_set weig AND keyword_set addr THEN BEGIN CASE method OF bilinear :compute_fromirr_bilinear_weigaddr alon alat mskin olon olat mskout weig addr ELSE:BEGIN print unknown interpolation method we stop stop ENDELSE ENDCASE ENDIF to the interpolation dataout total weig datain addr 1 dataout reform dataout jpio jpjo over RETURN dataout END"); 43 a[41] = new Array("./Interpolation/fromreg.html", "fromreg.pro", "", " file_comments interpolate data from a regular rectangular grid to any grid 2 metods availables: bilinear and imoms3 A regular rectangular grid is defined as a grid for which each lontitudes lines have the same latitude and each latitudes columns have the same longitude categories interpolation examples dataout fromreg method datain lonin latin lonout latout param method in required a string defining the interpolation method must be bilinear or imoms3 param datain in required a 2D array the input data to interpolate param lonin in required 1D or 2D array defining the longitude of the input data param latin in required 1D or 2D array defining the latitude of the input data param lonout in required 1D or 2D array defining the longitude of the output data param lonout in required 1D or 2D array defining the latitude of the output data keyword WEIG see ADDR keyword ADDR 2D arrays weig and addr are the weight and addresses used to perform the interpolation: dataout total weig datain addr 1 dataout reform dataout jpio jpjo over Those keywords can be set to named variables that are undefined or equal to 0 into which the values will be copied when the current routine exits Next they can be used to perform the interpolation whithout computing again those 2 parameters In that case lonin latin lonout and latout are not necessary keyword NONORTHERNLINE and NOSOUTHERNLINE activate if you don t whant to take into account the northen southern line of the input data when perfoming the interpolation returns 2D array: the interpolated data restrictions We supposed the data are located on a sphere with a periodicity along the longitude examples topa fromreg bilinear tncep xncep yncep glamt gphit or t1opa fromreg bilinear t1ncep xncep yncep glamt gphit WEIG a ADDR b help a b t2opa fromreg bilinear t2ncep xncep WEIG a ADDR b history November 2005: Sebastien Masson smasson lodyc jussieu fr FUNCTION fromreg method datain lonin latin lonout latout WEIG weig ADDR addr NONORTHERNLINE nonorthernline NOSOUTHERNLINE nosouthernline compile_opt strictarr strictarrsubs atmospheric grid parameters alon lonin alat latin get_gridparams alon alat jpia jpja 1 double Oceanic grid parameters olon lonout olat latout get_gridparams olon olat jpio jpjo 2 double Compute weight and address IF NOT keyword_set weig AND keyword_set addr THEN BEGIN CASE method OF bilinear :compute_fromreg_bilinear_weigaddr alon alat olon olat weig addr NONORTHERNLINE nonorthernline NOSOUTHERNLINE nosouthernline imoms3 : compute_fromreg_imoms3_weigaddr alon alat olon olat weig addr NONORTHERNLINE nonorthernline NOSOUTHERNLINE nosouthernline ELSE:BEGIN print unknown interpolation method we stop stop ENDELSE ENDCASE ENDIF dataout total weig datain addr 1 dataout reform dataout jpio jpjo over RETURN dataout END"); 44 44 a[42] = new Array("./Interpolation/get_gridparams.html", "get_gridparams.pro", "", " file_comments 1 extract from a NetCDF file the longitude latidude and their dimensions and make sure it is 1D or 2D arrays or 2 given longitude and latitude arrays get their dimensions and make sure they are 1D or 2D arrays categories interpolation examples 1 get_gridparams file lonname latname lon lat jpi jpj n_dimensions or 2 get_gridparams lon lat jpi jpj n_dimensions 1 param in1 in required the name of the netcdf file param in2 in required the name of the variable that contains the longitude in the NetCDF file param in3 in required the name of the variable that contains the latitude in the NetCDF file param in4 out the number of points in the longitudinal direction param in5 out the number of points in the latitudinal direction param in6 out the variable that will contain the longitudes param in7 out the variable that will contain the latitudes param in8 out 1 or 2 to specify if lon and lat should be 1D jpi or jpj or 2 param in1 in required 1d or 2D arrays defining longitudes and latitudes param in2 in required 1d or 2D arrays defining longitudes and latitudes Note that these arrays are also outputs and can therefore be modified param in1 out the variable that will contain the longitudes param in2 out the variable that will contain the latitudes param in3 in the number of points in the longitudinal direction param in4 in the number of points in the latitudinal direction param in5 in 1 or 2 to specify if lon and lat should be 1D jpi or jpj arrays or 2D arrays jpi jpj Note that of n_dimensions 1 then the grid must be regular each longitudes must be the same for all latitudes and each latitudes should be the sae for all longitudes examples 1 ncdf_get_gridparams coordinates_ORCA_R05 nc glamt gphit olon olat jpio jpjo 2 2 ncdf_get_gridparams olon olat jpio jpjo 2 history November 2005: Sebastien Masson smasson lodyc jussieu fr PRO get_gridparams in1 in2 in3 in4 in5 in6 in7 in8 DOUBLE double file lonname latname lon lat jpi jpj n_dimensions lon lat jpi jpj n_dimensions CASE n_params OF 8:BEGIN get longitude and latitude IF file_test in1 EQ 0 THEN BEGIN print file in1 does not exist stop ENDIF cdfido ncdf_open in1 ncdf_varget cdfido in2 lon ncdf_varget cdfido in3 lat ncdf_close cdfido n_dimensions in8 END 5:BEGIN lon temporary in1 lat temporary in2 n_dimensions in5 END ELSE:BEGIN print Bad nimber of input parameters stop end ENDCASE sizelon size lon sizelat size lat CASE 1 OF lon and lat are 1D arrays sizelon 0 EQ 1 AND sizelat 0 EQ 1:BEGIN get jpi and jpj jpi sizelon 1 jpj sizelat 1 make sure that lon and lat have the good number of dimensions CASE n_dimensions OF 1: 2:BEGIN make lon and lat 2D arrays lon temporary lon replicate 1 jpj lat replicate 1 jpi temporary lat END ELSE:stop ENDCASE END lon is 2D array and lat is 1D array sizelon 0 EQ 2 AND sizelat 0 EQ 1:BEGIN get jpi and jpj jpi sizelon 1 jpj sizelon 2 IF jpj NE n_elements lat THEN stop make sure that lon and lat have the good number of dimensions CASE n_dimensions OF 1:BEGIN IF array_equal lon lon 0 replicate 1 jpj NE 1 THEN BEGIN print Longitudes are not the same for all latitudes imposible to extract a 1D array of the longitudes stop ENDIF lon lon 0 END 2:lat replicate 1 jpi temporary lat ELSE:stop ENDCASE END lon is 1D array and lat is 2D array sizelon 0 EQ 1 AND sizelat 0 EQ 2:BEGIN get jpi and jpj jpi sizelat 1 jpj sizelat 2 IF jpi NE n_elements lon THEN stop make sure that lon and lat have the good number of dimensions CASE n_dimensions OF 1:BEGIN IF array_equal lat replicate 1 jpi lat 0 NE 1 THEN BEGIN print Latitudes are not the same for all longitudes imposible to extract a 1D array of the latitudes stop ENDIF lat reform lat 0 END 2:lon temporary lon replicate 1 jpj ELSE:stop ENDCASE END lon and lat are 2D arrays sizelon 0 EQ 2 AND sizelat 0 EQ 2:BEGIN get jpi and jpj IF array_equal sizelon 1:2 sizelat 1:2 NE 1 THEN stop jpi sizelon 1 jpj sizelon 2 make sure that lon and lat have the good number of dimensions CASE n_dimensions OF 1:BEGIN IF array_equal lon lon 0 replicate 1 jpj NE 1 THEN BEGIN print Longitudes are not the same for all latitudes imposible to extract a 1D array of the longitudes stop ENDIF lon lon 0 IF array_equal lat replicate 1 jpi reform lat 0 NE 1 THEN BEGIN print Latitudes are not the same for all longitudes imposible to extract a 1D array of the latitudes stop ENDIF lat reform lat 0 END 2: ELSE:stop ENDCASE END lon and lat are not 1D and or 2D arrays ELSE:stop ENDCASE double keyword if keyword_set double then BEGIN lon double temporary lon lat double temporary lat ENDIF give back the right outparameters CASE n_params OF 8:BEGIN in4 temporary lon in5 temporary lat in6 temporary jpi in7 temporary jpj END 5:BEGIN in1 temporary lon in2 temporary lat in3 temporary jpi in4 temporary jpj END ENDCASE return END"); 45 45 a[43] = new Array("./Interpolation/imoms3.html", "imoms3.pro", "", " FUNCTION imoms3 xin x abs xin y fltarr n_elements x test1 where x LT 1 IF test1 0 NE 1 THEN BEGIN xtmp x test1 y test1 0 5 xtmp xtmp xtmp xtmp xtmp 0 5 xtmp 1 ENDIF test1 where x LT 2 AND x GE 1 IF test1 0 NE 1 THEN BEGIN xtmp x test1 y test1 1 6 xtmp xtmp xtmp xtmp xtmp 11 6 xtmp 1 ENDIF RETURN y END"); -
trunk/SRC/Documentation/xmldoc/savesaxo.sh
r111 r113 167 167 EOF 168 168 # launch idl with the file built above 169 IDL_STARTUP=${pro}; idl169 IDL_STARTUP=${pro};$IDL_DIR/bin/idl 170 170 /bin/rm ${pro} 171 171 # In order to do not have to many revision in svn, we modify some -
trunk/SRC/Interpolation/fromirr.pro
r110 r113 11 11 ; @param method: {in}{required} a string defining the interpolation method. must be 'bilinear' 12 12 ; @param datain: {in}{required} a 2D array the input data to interpolate 13 ; @param lonin: {in}{optional} a 2D array defining the longitude of the input data 14 ; optionals if WEIG and ADDR keywords used. 15 ; @param latin: {in}{optional} a 2D array defining the latitude of the input data. 16 ; optionals if WEIG and ADDR keywords used. 17 ; @param mskin: {in}{optional} a 2D array, the land-sea mask of the input data (1 on ocean, 0 on land) 18 ; @param lonout: {in}{optional} 1D or 2D array defining the longitude of the output data. 19 ; optionals if WEIG and ADDR keywords used. 20 ; @param latout: {in}{optional} 1D or 2D array defining the latitude of the output data. 21 ; optionals if WEIG and ADDR keywords used. 22 ; @param mskout: {in}{optional} a 2D array, the land-sea mask of the ouput data (1 on ocean, 0 on land) 13 ; @param lonin: {in}{required} a 2D array defining the longitude of the input data 14 ; @param latin: {in}{required} a 2D array defining the latitude of the input data. 15 ; @param mskin: {in}{required} a 2D array, the land-sea mask of the input data (1 on ocean, 0 on land) 16 ; @param lonout: {in}{required} 1D or 2D array defining the longitude of the output data. 17 ; @param latout: {in}{required} 1D or 2D array defining the latitude of the output data. 18 ; @param mskout: {in}{required} a 2D array, the land-sea mask of the ouput data (1 on ocean, 0 on land) 23 19 ; 24 20 ; @keyword WEIG (see ADDR) 25 ; @keyword ADDR :2D arrays, weig and addr are the weight and addresses used to21 ; @keyword ADDR 2D arrays, weig and addr are the weight and addresses used to 26 22 ; perform the interpolation: 27 23 ; dataout = total(weig*datain[addr], 1) 28 24 ; dataout = reform(dataout, jpio, jpjo, /over) 29 ; Those keywords can be set to named variables into which the values will be30 ; copied when the current routine exits. Next, they can be used to perform25 ; Those keywords can be set to named variables (that are undefined or equal to 0) into which the 26 ; values will be copied when the current routine exits. Next, they can be used to perform 31 27 ; the interpolation whithout computing again those 2 parameters. This greatly 32 28 ; speed-up the interpolation! In that case, lonin, latin, lonout and latout are not necessary. … … 62 58 compile_opt strictarr, strictarrsubs 63 59 ; 64 IF NOT (keyword_set(weig) AND keyword_set(addr)) THEN BEGIN65 60 ;--------------- 66 61 ; atmospheric grid parameters … … 78 73 ; Compute weight and address 79 74 ;--------------- 75 IF NOT (keyword_set(weig) AND keyword_set(addr)) THEN BEGIN 80 76 CASE method OF 81 77 'bilinear':compute_fromirr_bilinear_weigaddr, alon, alat, mskin, olon, olat, mskout, weig, addr -
trunk/SRC/Interpolation/fromreg.pro
r110 r113 14 14 ; must be 'bilinear' or 'imoms3' 15 15 ; @param datain {in}{required} a 2D array the input data to interpolate 16 ; @param lonin {in}{optional} longitude of the input data. optionals if 17 ; WEIG and ADDR keywords used. 18 ; @param latin {in}{optional} latitude of the input data. optionals if 19 ; WEIG and ADDR keywords used. 20 ; @param lonout {in}{optional} longitude of the output data. optionals if 21 ; WEIG and ADDR keywords used. 22 ; @param lonout {in}{optional} latitude of the output data. optionals if 23 ; WEIG and ADDR keywords used. 16 ; @param lonin {in}{required} 1D or 2D array defining the longitude of the input data 17 ; @param latin {in}{required} 1D or 2D array defining the latitude of the input data 18 ; @param lonout {in}{required} 1D or 2D array defining the longitude of the output data 19 ; @param lonout {in}{required} 1D or 2D array defining the latitude of the output data 24 20 ; 25 21 ; @keyword WEIG (see ADDR) … … 28 24 ; dataout = total(weig*datain[addr], 1) 29 25 ; dataout = reform(dataout, jpio, jpjo, /over) 30 ; Those keywords can be set to named variables into which the values will be31 ; copied when the current routine exits. Next, they can be used to perform26 ; Those keywords can be set to named variables (that are undefined or equal to 0) into which the 27 ; values will be copied when the current routine exits. Next, they can be used to perform 32 28 ; the interpolation whithout computing again those 2 parameters. In that 33 29 ; case, lonin, latin, lonout and latout are not necessary. … … 66 62 compile_opt strictarr, strictarrsubs 67 63 ; 68 IF NOT (keyword_set(weig) AND keyword_set(addr)) THEN BEGIN69 64 ;--------------- 70 65 ; atmospheric grid parameters … … 82 77 ; Compute weight and address 83 78 ;--------------- 79 IF NOT (keyword_set(weig) AND keyword_set(addr)) THEN BEGIN 84 80 CASE method OF 85 81 'bilinear':compute_fromreg_bilinear_weigaddr, alon, alat, olon, olat, weig, addr, NONORTHERNLINE = nonorthernline, NOSOUTHERNLINE = nosouthernline
Note: See TracChangeset
for help on using the changeset viewer.