Ignore:
Timestamp:
06/12/06 10:29:56 (18 years ago)
Author:
pinsard
Message:

start to modify headers of Interpolation *.pro files for better idldoc output

Location:
trunk/SRC/Interpolation
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/Interpolation/angle.pro

    r59 r101  
    11;--------- 
    22;+ 
    3 ; NAME:angle.pro (fom angle.F,v 2.2 in OPA8.2) 
     3; @file_comments north stereographic polar projection 
    44; 
    5 ; PURPOSE:Compute angles between grid lines and direction of the North 
     5; @keyword    /DOUBLE use double precision (default is float) 
    66; 
    7 ; CALLING SEQUENCE:  
    8 ;     angle, fileocemesh, gcosu, gsinu, gcosv, gsinv, gcost, gsint 
    9 ; 
    10 ; INPUTS: 
    11 ;     fileocemesh a netcdf file that contains (at least): 
    12 ;        glamu, gphiu: longitudes and latitudes at U-points 
    13 ;        glamv, gphiv: longitudes and latitudes at V-points 
    14 ;        glamf, gphif: longitudes and latitudes at F-points 
    15 ; 
    16 ; KEYWORD PARAMETERS: 
    17 ; 
    18 ;    IODIRECTORY: the directory path where is located fileocemesh 
    19 ; 
    20 ;    /DOUBLE: use double precision (default is float) 
    21 ; 
    22 ; OUTPUTS: 
     7; @returns 
    238;       gsinu,gcosu : sinus and cosinus of the angle  
    249;       gsinv,gcosv   between north-south direction  
    2510;       gsint,gcost   and the j-direction of the mesh 
    26 ;                      
    2711; 
    28 ; RESTRICTIONS: to compute the lateral boundary conditions, we assume 
     12; @restrictions to compute the lateral boundary conditions, we assume 
    2913; that:  
    3014;     (1) the first line is similar to the second line 
     
    3721; 
    3822; 
    39 ; MODIFICATION HISTORY: 
     23; @history 
    4024;   -------------- 
    4125;       Original :  96-07 (O. Marti) 
     
    4529;--------- 
    4630; 
    47 ;  fsnspp: north stereographic polar projection 
    4831FUNCTION fsnspp, plam, pphi, DOUBLE = double 
    4932  IF keyword_set(double) THEN BEGIN 
     
    5942END 
    6043;--------- 
     44;+ 
     45; @file_comments Compute angles between grid lines and direction of the North 
     46;(fom angle.F,v 2.2 in OPA8.2) 
     47; 
     48; @param fileocemesh {in}{required} a netcdf file that contains (at least): 
     49;        glamu, gphiu: longitudes and latitudes at U-points 
     50;        glamv, gphiv: longitudes and latitudes at V-points 
     51;        glamf, gphif: longitudes and latitudes at F-points 
     52; 
     53; @keyword IODIRECTORY the directory path where is located fileocemesh 
     54; @keyword    /DOUBLE use double precision (default is float) 
     55;- 
    6156;--------- 
    6257; 
  • trunk/SRC/Interpolation/clickincell.pro

    r69 r101  
    11;+ 
    2 ; NAME:clickincell 
     2; @file_comments click on a map and find in which cell the click was 
    33; 
    4 ; PURPOSE: click on a map and find in which cell the click was 
     4; @categories finding where is a point on a grid 
    55; 
    6 ; CATEGORY:finding where is a point on a grid 
    7 ; 
    8 ; CALLING SEQUENCE: 
     6; @examples  
    97; 
    108;     res = clickincell() 
     
    1311;     Click on the right button to quit.   
    1412; 
    15 ; INPUTS:None 
    16 ; 
    17 ; KEYWORD PARAMETERS: 
    18 ; 
    19 ;     CELLTYPE = 'T', 'W', 'U', 'V' or 'F': This this the type of point 
     13; @keyword     CELLTYPE = 'T', 'W', 'U', 'V' or 'F' This this the type of point 
    2014;     that is located in the center of the cell which the click is 
    2115;     located. default is T type of cell (with corner defined by F 
    2216;     points). 
    2317; 
    24 ;     /DRAWCELL: to draw the cell in which we clicked 
     18; @keyword     /DRAWCELL to draw the cell in which we clicked 
    2519; 
    26 ;     COLOR = the color used to draw the cells (Clicking one more 
     20; @keyword     COLOR the color used to draw the cells (Clicking one more 
    2721;     time in the same cell will draw the cell with the white color) 
    2822; 
    29 ;     /ORIGINAL: to get the position of the cell regarding the original 
     23; @keyword     /ORIGINAL to get the position of the cell regarding the original 
    3024;     grid (with no key_shift, ixminmesh, iyminmesh...) 
    3125; 
    32 ;     /IJ: see outpus 
     26; @keyword     /IJ see outpus 
    3327; 
    34 ;     _EXTRA: to pass extra keywords to inquad and plot (when /drawcell) 
     28; @keyword     _EXTRA to pass extra keywords to inquad and plot (when /drawcell) 
    3529; 
    36 ; OUTPUTS: 
    37 ;     the the index of the selected cells regarding to the grid which 
     30; @returns 
     31;     the index of the selected cells regarding to the grid which 
    3832;     is in memory in the variable of the common. If /ij keyword is 
    3933;     activated give 2D array (2, n) which are the i,j position of the 
    4034;     n selected cells.  
    4135; 
    42 ; COMMON BLOCKS:common.pro 
     36; @uses common.pro 
    4337; 
    44 ; SIDE EFFECTS: 
    45 ; 
    46 ; RESTRICTIONS: 
    47 ; 
    48 ; EXAMPLE: 
     38; @examples  
    4939; 
    5040;   IDL> plt, findgen(jpi,jpj),/nodata,map=[90,0,0],/ortho 
    5141;   IDL> print, clickincell(/draw,color=150,/xy) 
    5242; 
    53 ; MODIFICATION HISTORY: 
    54 ;      Sebastien Masson (smasson@lodyc.jussieu.fr) 
     43; @history 
     44;      Sebastien Masson (smasson\@lodyc.jussieu.fr) 
    5545;      August 2003 
    5646; 
  • trunk/SRC/Interpolation/compute_fromreg_bilinear_weigaddr.pro

    r98 r101  
    11;+ 
    2 ; NAME: compute_fromreg_bilinear_weigaddr 
    3 ; 
    4 ; PURPOSE: compute the weight and address neede to interpolate data from a 
     2; @file_comments compute the weight and address neede to interpolate data from a 
    53;          "regular grid" to any grid using the bilinear method 
    64;    
    7 ; CATEGORY:interpolation 
    8 ; 
    9 ; CALLING SEQUENCE:  
    10 ;     compute_fromreg_bilinear_weigaddr, alon, alat, olon, olat, weig, addr 
    11 ; 
    12 ; INPUTS: 
    13 ;     lonin and latin: longitude/latitude of the input data. Must be 1D arrays 
    14 ;     lonout and latout: longitude/latitude of the output data. Must be 2D arrays 
    15 ; 
    16 ; KEYWORD PARAMETERS:  
    17 ; 
    18 ;     /NONORTHERNLINE and /NOSOUTHERNLINE: activate if you don't whant to take into 
    19 ;          account the northen/southern line of the input data when perfoming the 
     5; @categories interpolation 
     6; 
     7;     @param alonin {in}{required} longitudeof the input data  
     8;     @param alatin  {in}{required} latitude of the input data  
     9;     @param olonin {in}{required} longitude of the output data  
     10;     @param olat  {in}{required} latitude of the output data  
     11; 
     12; @keyword     /NONORTHERNLINE activate if you don't whant to take into 
     13;          account the northen line of the input data when perfoming the 
     14; @keyword     /NOSOUTHERNLINE activate if you don't whant to take into 
     15;          account the southern line of the input data when perfoming the 
    2016;          interpolation. 
    2117; 
    22 ; OUTPUTS:  
     18; @returns  
    2319;     weig, addr: 2D arrays, weig and addr are the weight and addresses used to 
    2420;     perform the interpolation: 
     
    2622;          dataout = reform(dataout, jpio, jpjo, /over) 
    2723; 
    28 ; COMMON BLOCKS: none 
    29 ; 
    30 ; SIDE EFFECTS: ? 
    31 ; 
    32 ; RESTRICTIONS: 
     24; @restrictions 
    3325;  -  the input grid must be a "regular grid", defined as a grid for which each 
    3426;     lontitudes lines have the same latitude and each latitudes columns have the 
     
    3931;     using a linear interpolation only along the longitudinal direction. 
    4032;  
    41 ; EXAMPLE:  
    42 ; 
    43 ; MODIFICATION HISTORY: 
     33; @history 
    4434;  November 2005: Sebastien Masson (smasson@lodyc.jussieu.fr)  
    4535;  
  • trunk/SRC/Interpolation/compute_fromreg_imoms3_weigaddr.pro

    r69 r101  
    11;+ 
    2 ; NAME: compute_fromreg_imoms3_weigaddr 
    3 ; 
    4 ; PURPOSE: compute the weight and address neede to interpolate data from a 
     2; 
     3; @file_comments compute the weight and address neede to interpolate data from a 
    54;          "regular grid" to any grid using the imoms3 method 
    65;    
    7 ; CATEGORY:interpolation 
    8 ; 
    9 ; CALLING SEQUENCE:  
    10 ;     compute_fromreg_imoms3_weigaddr, alon, alat, olon, olat, weig, addr 
    11 ; 
    12 ; INPUTS: 
    13 ;     lonin and latin: longitude/latitude of the input data  
    14 ;     lonout and latout: longitude/latitude of the output data  
    15 ; 
    16 ; KEYWORD PARAMETERS:  
    17 ; 
    18 ;     /NONORTHERNLINE and /NOSOUTHERNLINE: activate if you don't whant to take into 
     6; @categories interpolation 
     7PRO compute_fromreg_imoms3_weigaddr, alonin, alatin, olonin, olat, weig, addr $ 
     8; 
     9;     @param alonin {in}{required} longitude of the input data  
     10;     @param alatin  {in}{required} latitude of the input data  
     11;     @param olonin {in}{required} longitude of the output data  
     12;     @param olat {in}{required} latitude of the output data  
     13; 
     14; @keyword /NONORTHERNLINE and /NOSOUTHERNLINE activate if you don't whant to take into 
    1915;          account the northen/southern line of the input data when perfoming the 
    2016;          interpolation. 
    2117; 
    22 ; OUTPUTS:  
     18; @returns  
    2319;     weig, addr: 2D arrays, weig and addr are the weight and addresses used to 
    2420;     perform the interpolation: 
     
    2622;          dataout = reform(dataout, jpio, jpjo, /over) 
    2723; 
    28 ; COMMON BLOCKS: none 
    29 ; 
    30 ; SIDE EFFECTS: ? 
    31 ; 
    32 ; RESTRICTIONS: 
     24; @restrictions 
    3325;  -  the input grid must be a "regular/rectangular grid", defined as a grid for 
    3426;     which each lontitudes lines have the same latitude and each latitudes columns 
     
    4234;     using a imoms3 interpolation only along the longitudinal direction. 
    4335;  
    44 ; EXAMPLE:  
    45 ; 
    46 ; MODIFICATION HISTORY: 
    47 ;  November 2005: Sebastien Masson (smasson@lodyc.jussieu.fr)  
     36; @history 
     37;  November 2005: Sebastien Masson (smasson\@lodyc.jussieu.fr)  
    4838;  March 2006: works for rectangular grids 
    4939;- 
  • trunk/SRC/Interpolation/cutpar.pro

    r59 r101  
    11;+ 
    2 ; NAME: cutpar 
    32; 
    4 ; PURPOSE: cut p parallelogram(s) into p*n^2 parallelograms 
     3; @file_comments cut p parallelogram(s) into p*n^2 parallelograms 
    54; 
    6 ; CATEGORY: basic work 
     5; @categories basic work 
    76; 
    8 ; CALLING SEQUENCE:res = cutpar(x0, y0, x1, y1, x2, y2, x3, y3, n) 
     7; @examples  
     8; res = cutpar(x0, y0, x1, y1, x2, y2, x3, y3, n) 
    99; 
    10 ; INPUTS: 
    11 ;       x0,y0 1d arrays of p elements, giving the edge positions. The 
     10;       @param x0,y0  {in}{required} 1d arrays of p elements, giving the edge positions. The 
    1211;       edges must be given as in plot to traw the parallelogram. (see 
    1312;       example). 
    14 ;       n: each parallelogram will be cutted in n^2 pieces 
     13;       @param n {in}{required} each parallelogram will be cutted in n^2 pieces 
    1514; 
    16 ; KEYWORD PARAMETERS:  
     15; @keyword         /endpoints see outputs 
    1716; 
    18 ;         /endpoints: see outputs 
    19 ; 
    20 ;         /onsphere: to specify that the points are located on a 
     17; @keyword         /onsphere to specify that the points are located on a 
    2118;         sphere. In this case, x and y corresponds to longitude and 
    2219;         latitude in degrees. 
    2320; 
    24 ; OUTPUTS: 
     21; @returns 
    2522;        -defaut: 3d array(2,n^2,p) giving the center position of each 
    2623;        piece of the parallelograms 
     
    2825;        of each piece of the parallelograms 
    2926; 
    30 ; COMMON BLOCKS: no 
     27; @uses cutsegment.pro 
    3128; 
    32 ; SIDE EFFECTS: need cutsegment.pro 
    33 ; 
    34 ; RESTRICTIONS: ? 
    35 ; 
    36 ; EXAMPLE: 
     29; @examples  
    3730; 
    3831; x0 = [2,6,2] 
     
    5043; for i=0,2 do oplot, [res[0,*,i]], [res[1,*,i]], color = 20+10*i, psym = 1, thick = 3 
    5144; 
    52 ; MODIFICATION HISTORY: 
    53 ;           S. Masson (smasson@lodyc.jussieu.fr) 
     45; @history 
     46;           S. Masson (smasson\@lodyc.jussieu.fr) 
    5447;           July 5th, 2002 
    5548;- 
  • trunk/SRC/Interpolation/cutsegment.pro

    r59 r101  
    11;+ 
    2 ; NAME: cutsegment 
    32; 
    4 ; PURPOSE: cut p segments into p*n equal parts 
     3; @file_comments cut p segments into p*n equal parts 
    54; 
    6 ; CATEGORY: basic work 
     5; @categories basic work 
    76; 
    8 ; CALLING SEQUENCE: res = cutsegment(x0, y0, x1, y1, n) 
     7; @examples   
     8; res = cutsegment(x0, y0, x1, y1, n) 
    99; 
    10 ; INPUTS:  
    11 ;         x0,y0 and x1,y1, 1d arrays of p elements, the coordinates of 
     10;         @param x0,y0 and x1,y1  {in}{required}  1d arrays of p elements, the coordinates of 
    1211;         the endpoints of the p segmements 
    13 ;         n: the number of pieces we want to cut each segment 
     12;         @param  n {in}{required} the number of pieces we want to cut each segment 
    1413; 
    15 ; KEYWORD PARAMETERS: 
    1614; 
    17 ;         /endpoints: see ouputs 
     15; @keyword         /endpoints see ouputs 
    1816; 
    19 ;         /onsphere: to specify that the points are located on a 
     17; @keyword         /onsphere to specify that the points are located on a 
    2018;         sphere. In this case, x and y corresponds to longitude and 
    2119;         latitude in degrees. 
    2220; 
    23 ; OUTPUTS: 
     21; @returns 
    2422;        defaut: a 3d array (2,n,p) that gives the coordinates of the 
    2523;        middle of the cutted segments. 
     
    2725;        coordinates of the endpoints of the cutted segments. 
    2826; 
    29 ; COMMON BLOCKS: no 
    30 ; 
    31 ; SIDE EFFECTS: no 
    32 ; 
    33 ; RESTRICTIONS: ? 
    34 ; 
    35 ; EXAMPLE: 
     27; @examples  
    3628; 
    3729;  IDL> x0=[2,5] 
     
    4638;  IDL> oplot, [res[0,*,1]], [res[1,*,1]], color = 40, psym = 1, thick = 3 
    4739; 
    48 ; MODIFICATION HISTORY: 
    49 ;           S. Masson (smasson@lodyc.jussieu.fr) 
     40; @history 
     41;           S. Masson (smasson\@lodyc.jussieu.fr) 
    5042;           July 5th, 2002 
    5143;- 
  • trunk/SRC/Interpolation/extrapolate.pro

    r69 r101  
     1;+ 
     2; @file_comments extrapolate data (zinput) where maskinput eq 0 by filling step by 
     3; step the coastline points with the mean value of the 8 neighbourgs. 
     4; 
     5;- 
    16FUNCTION extrapolate, zinput, maskinput, nb_iteration, x_periodic = x_periodic, MINVAL = minval, MAXVAL = maxval 
    27; 
    38  compile_opt strictarr, strictarrsubs  
    4 ; 
    5 ; extrapolate data (zinput) where maskinput eq 0 by filling step by 
    6 ; step the coastline points with the mean value of the 8 neighbourgs. 
    79; 
    810; check the number of iteration used in the extrapolation. 
  • trunk/SRC/Interpolation/fromreg.pro

    r69 r101  
    11;+ 
    2 ; NAME: fromreg 
    32; 
    4 ; PURPOSE: interpolate data from a "regular/rectangular grid" to any grid. 
     3; @file_comments interpolate data from a "regular/rectangular grid" to any grid. 
    54;   2 metods availables: bilinear and imoms3  
    65;   A "regular/rectangular grid" is defined as a grid for which each lontitudes lines have  
    76;   the same latitude and each latitudes columns have the same longitude. 
    87;    
    9 ; CATEGORY:interpolation 
     8; @categories interpolation 
    109; 
    11 ; CALLING SEQUENCE: dataout = fromreg(method, datain [, lonin, latin, lonout, latout]) 
     10; @examples   
     11; dataout = fromreg(method, datain [, lonin, latin, lonout, latout]) 
    1212; 
    13 ; INPUTS: 
    14 ;    method: a string defining the interpolation method.  
     13;    @param method {in}{required}  a string defining the interpolation method.  
    1514;            must be 'bilinear' or 'imoms3' 
    16 ;    datain: a 2D array the input data to interpolate 
    17 ;    lonin and latin: longitude/latitude of the input data. optionals if 
     15;    @param datain {in}{required} a 2D array the input data to interpolate 
     16;    @param lonin latin {in}{required} longitude/latitude of the input data. optionals if 
    1817;            WEIG and ADDR keywords used. 
    19 ;    lonout and latout: longitude/latitude of the output data. optionals if 
     18;    @param lonout latout {in}{required} longitude/latitude of the output data. optionals if 
    2019;            WEIG and ADDR keywords used. 
    2120; 
    22 ; KEYWORD PARAMETERS:  
    23 ; 
    24 ;     WEIG, ADDR: 2D arrays, weig and addr are the weight and addresses used to 
     21; @keyword     WEIG, ADDR 2D arrays, weig and addr are the weight and addresses used to 
    2522;     perform the interpolation: 
    2623;          dataout = total(weig*datain[addr], 1) 
     
    3128;     case, lonin, latin, lonout and latout are not necessary. 
    3229; 
    33 ;     /NONORTHERNLINE and /NOSOUTHERNLINE: activate if you don't whant to take into 
     30; @keyword     /NONORTHERNLINE and /NOSOUTHERNLINE activate if you don't whant to take into 
    3431;          account the northen/southern line of the input data when perfoming the 
    3532;          interpolation. 
    3633; 
    37 ; OUTPUTS: 2D array: the interpolated data 
     34; @returns 2D array: the interpolated data 
    3835; 
    39 ; COMMON BLOCKS: none 
     36; @restrictions We supposed the data are located on a sphere, with a  
     37; periodicity along the longitude. 
    4038; 
    41 ; SIDE EFFECTS: ? 
    42 ; 
    43 ; RESTRICTIONS:We supposed the data are located on a sphere, with a periodicity along 
    44 ;              the longitude. 
    45 ; 
    46 ; EXAMPLE:  
     39; @examples   
    4740 
    4841;  topa = fromreg('bilinear', tncep, xncep, yncep, glamt, gphit) 
     
    5447;  t2opa = fromreg('bilinear', t2ncep, xncep, WEIG = a, ADDR = b) 
    5548; 
    56 ; MODIFICATION HISTORY: 
    57 ;  November 2005: Sebastien Masson (smasson@lodyc.jussieu.fr)  
     49; @history 
     50;  November 2005: Sebastien Masson (smasson\@lodyc.jussieu.fr)  
    5851;  
    5952;- 
  • trunk/SRC/Interpolation/get_gridparams.pro

    r69 r101  
    11;+ 
    2 ; NAME: get_gridparams 
    3 ; 
    4 ; PURPOSE:  
     2; 
     3; @file_comments  
    54;   1) extract from a NetCDF file the longitude, latidude, and their dimensions 
    65;      and make sure it is 1D or 2D arrays  
     
    98;      they are 1D or 2D arrays  
    109; 
    11 ; CATEGORY:for interpolations tools 
    12 ; 
    13 ; CALLING SEQUENCE: 
     10; @categories interpolation 
     11; 
     12; @examples  
    1413;  
    1514; 1) get_gridparams, file, lonname, latname, lon, lat, jpi, jpj, n_dimensions 
     
    1918; 2) get_gridparams, lon, lat, jpi, jpj, n_dimensions 
    2019; 
    21 ; INPUTS: 
    22 ; 
    2320; 1)  
    24 ;  file: the name of the netcdf file 
    25 ;  loname: the name of the variable that contains the longitude in the NetCDF file 
    26 ;  latname: the name of the variable that contains the latitude in the NetCDF file 
     21; @param in1 {in}{required}  the name of the netcdf file 
     22;  @param in2 {in}{required}  the name of the variable that contains the longitude in the NetCDF file 
     23;  @param in3 {in}{required}  the name of the variable that contains the latitude in the NetCDF file 
     24;  @param in4  {out} the number of points in the longitudinal direction 
     25;  @param in5  {out} the number of points in the latitudinal direction 
     26; @param in6 {out} the variable that will contain the longitudes 
     27;  @param in7  {out} the variable that will contain the latitudes 
     28;  @param in8 {out} 1 or 2 to specify if lon and lat should be 1D (jpi or jpj) 
    2729; 
    2830; or  
    2931; 
    30 ; 2) lon and lat: 1d or 2D arrays defining longitudes and latitudes.  
     32; 2)  
     33; @param lon lat {in}{required}  1d or 2D arrays defining longitudes and latitudes.  
    3134;    Note that these arrays are also outputs and can therefore be modified.  
    3235 
    33 ; KEYWORD PARAMETERS: none 
    34 ; 
    35 ; OUTPUTS: 
    36 ;  lon the variable that will contain the longitudes 
    37 ;  lat the variable that will contain the latitudes 
    38 ;  jpi the number of points in the longitudinal direction 
    39 ;  jpj the number of points in the latitudinal direction 
    40 ;  n_dimensions: 1 or 2 to specify if lon and lat should be 1D (jpi or jpj) 
     36; @param in1 {out} the variable that will contain the longitudes 
     37;  @param in2  {out} the variable that will contain the latitudes 
     38;  @param in3  {out} the number of points in the longitudinal direction 
     39;  @param in4  {out} the number of points in the latitudinal direction 
     40;  @param in5 {out} 1 or 2 to specify if lon and lat should be 1D (jpi or jpj) 
    4141;    arrays or 2D arrays (jpi,jpj). Note that of  n_dimensions = 1, then the 
    4242;    grid must be regular (each longitudes must be the same for all latitudes 
    4343;    and each latitudes should be the sae for all longitudes).  
    4444; 
    45 ; COMMON BLOCKS: none 
    46 ; 
    47 ; SIDE EFFECTS: ? 
    48 ; 
    49 ; RESTRICTIONS: ? 
    50 ; 
    51 ; EXAMPLE:  
     45; @examples   
    5246;  
    5347; 1) ncdf_get_gridparams, 'coordinates_ORCA_R05.nc', 'glamt', 'gphit' $ 
     
    5650; 2) ncdf_get_gridparams, olon, olat, jpio, jpjo, 2 
    5751; 
    58 ; MODIFICATION HISTORY: 
    59 ;  November 2005: Sebastien Masson (smasson@lodyc.jussieu.fr)  
     52; @history 
     53;  November 2005: Sebastien Masson (smasson\@lodyc.jussieu.fr)  
    6054;  
    6155;- 
  • trunk/SRC/Interpolation/imoms3.pro

    r69 r101  
     1;+ 
     2;  
     3;- 
    14FUNCTION imoms3, xin 
    25 
  • trunk/SRC/Interpolation/inquad.pro

    r59 r101  
    11;+ 
    2 ; NAME:inquad 
    3 ; 
    4 ; PURPOSE: to find if an (x,y) point is in a quadrilateral (x1,x2,x3,x4) 
    5 ; 
    6 ; CATEGORY:grid manipulation 
    7 ; 
    8 ; CALLING SEQUENCE: 
     2; @file_comments to find if an (x,y) point is in a quadrilateral (x1,x2,x3,x4) 
     3; 
     4; @categories grid manipulation 
     5; 
     6; @examples  
    97; 
    108;     res = inquad(x, y, x1, y1, x2, y2, x3, y3, x4, y4) 
    119; 
    12 ; INPUTS: 
    13 ; 
    14 ;     x,y: the coordinates of the point we want to know where it 
     10;     @param x y {in}{required}  the coordinates of the point we want to know where it 
    1511;     is. Must be a scalar if /onsphere activated else can be scalar 
    1612;     or array.  
    1713; 
    18 ;     x1, y1, x2, y2, x3, y3, x4, y4: the coordinates of the 
     14;     @param x1 y1 x2 y2 x3 y3 x4 y4 {in}{required} the coordinates of the 
    1915;     quadrilateral given in the CLOCKWISE order. Scalar or array. 
    2016; 
    21 ; KEYWORD PARAMETERS: 
    22 ; 
    23 ;    /DOUBLE: use double precision to perform the computation  
    24 ; 
    25 ;    /ONSPHERE: to specify that the quadilateral are on a sphere and 
     17; 
     18; @keyword    /DOUBLE use double precision to perform the computation  
     19; 
     20; @keyword    /ONSPHERE to specify that the quadilateral are on a sphere and 
    2621;    that teir coordinates are longitude-latitude coordinates. In this 
    2722;    case, est-west periodicity, poles singularity and other pbs 
     
    2924;    automatically.  
    3025; 
    31 ;    ZOOMRADIUS:the zoom (circle centred on the (x,y) with a radius of 
     26; @keyword    ZOOMRADIUS :the zoom (circle centred on the (x,y) with a radius of 
    3227;    zoomradius degree where we look for the the quadrilateral which;    contains the (x,y) point) used for the satellite projection 
    3328;    when /onsphere is activated. Default is 4 and seems to be the 
     
    3530;    larger than 5 degrees. 
    3631;    
    37 ;    /NOPRINT: to suppress the print messages. 
    38 ; 
    39 ; OUTPUTS: 
    40 ; 
    41 ;    res, a n element vector. Where n is the number of elements of 
     32; @keyword    /NOPRINT to suppress the print messages. 
     33; 
     34; @returns 
     35;    a n element vector. Where n is the number of elements of 
    4236;    x. res[i]=j means that the point number i is located in the 
    4337;    quadrilateral number j with (0 <= j <= n_elements(x0)-1) 
    4438; 
    45 ; COMMON BLOCKS:none 
    46 ; 
    47 ; SIDE EFFECTS: 
    48 ; 
    49 ; RESTRICTIONS: I think degenerated quadrilateral (e.g. flat of 
     39; @restrictions I think degenerated quadrilateral (e.g. flat of 
    5040; twisted) is not work. This has to be tested. 
    5141; 
    52 ; EXAMPLE: 
     42; @examples  
    5343; 
    5444;       x = 1.*[1, 2, 6, 7, 3] 
     
    6959;      On a sphere see clickincell.pro... 
    7060; 
    71 ; MODIFICATION HISTORY: 
    72 ;      Sebastien Masson (smasson@lodyc.jussieu.fr) 
     61; @history 
     62;      Sebastien Masson (smasson\@lodyc.jussieu.fr) 
    7363;      August 2003 
    7464;      Based on Convert_clic_ij.pro written by Gurvan Madec  
     
    192182; the point is inside the quadilateral if test eq 1 
    193183; with test equal to: 
    194 ;     test = ((x-x1)*(y2-y1) GE (x2-x1)*(y-y1)) $        
     184;     test = ((x-x1)*(y2-y1) GE (x2-x1)*(y-y1)) $ 
    195185;       *((x-x2)*(y3-y2) GT (x3-x2)*(y-y2)) $ 
    196186;       *((x-x3)*(y4-y3) GT (x4-x3)*(y-y3)) $ 
  • trunk/SRC/Interpolation/inrecgrid.pro

    r59 r101  
    11;+ 
    2 ; NAME: inrecgrid 
    32; 
    4 ; PURPOSE: given - a list of points, (x,y) position   
     3; @file_comments given - a list of points, (x,y) position   
    54;                - the x and y limits of a rectangular grid 
    65;          find in which cell is located each given point. 
    76; 
    8 ; CATEGORY: no DO loop, use the wonderfull value_locate function! 
     7; @categories no DO loop, use the wonderfull value_locate function! 
    98; 
    10 ; CALLING SEQUENCE:res = inrecgrid(xin, yin, left, bottom) 
     9; @examples  
     10; res = inrecgrid(xin, yin, left, bottom) 
    1111; 
    12 ; INPUTS:  
    13 ; 
    14 ;    x1d: a 1d array, the x position on the points 
    15 ;    y1d: a 1d array, the y position on the points 
    16 ;    left: a 1d, monotonically increasing array, the position of the 
     12;    @param x1d {in}{required}  a 1d array, the x position on the points 
     13;    @param y1d {in}{required}  a 1d array, the y position on the points 
     14;    left {in}{required}  a 1d, monotonically increasing array, the position of the 
    1715;    "left" border of each cell. 
    18 ;    bottom: a 1d, monotonically increasing array, the position of the 
     16;    @param bottom {in}{required} a 1d, monotonically increasing array, the position of the 
    1917;    "bottom" border of each cell. 
    2018; 
    21 ; OPTIONAL INPUTS: 
    2219; 
    23 ; KEYWORD PARAMETERS:; 
    24 ; 
    25 ;    /output2d: to get the output as a 2d array (2,n_elements(x1d)), 
     20; @keyword    /output2d to get the output as a 2d array (2,n_elements(x1d)), 
    2621;    with res[0,*] the x index accoring to the 1d array defined by 
    2722;    left and res[1,*] the y index accoring to the 1d array defined by 
    2823;    bottom. 
    2924; 
    30 ;    checkout=[rbgrid,ubgrid] specify the right and upper bondaries of 
     25; @keyword    checkout=[rbgrid,ubgrid] specify the right and upper bondaries of 
    3126;    the grid and check if some points are out. 
    3227; 
    33 ; OUTPUTS:the index on the cell accoring to the 2d array defined by 
     28; @returns the index on the cell accoring to the 2d array defined by 
    3429; left and bottom. 
    3530; 
    36 ; OPTIONAL OUTPUTS: 
    37 ; 
    38 ; COMMON BLOCKS: no 
    39 ; 
    40 ; SIDE EFFECTS: 
    41 ; 
    42 ; RESTRICTIONS: 
    43 ; 
    44 ; PROCEDURE: 
    45 ; 
    46 ; EXAMPLE: 
     31; @examples  
    4732; 
    4833;  IDL> a=indgen(5) 
     
    5742;        2.00000      1.00000 
    5843 
    59 ; MODIFICATION HISTORY: 
    60 ;            S. Masson (smasson@lodyc.jussieu.fr) 
     44; @history 
     45;            S. Masson (smasson\@lodyc.jussieu.fr) 
    6146;                      July 3rd, 2002 
    6247;                      October 3rd, 2003: use value_locate 
  • trunk/SRC/Interpolation/ll_narcs_distances.pro

    r59 r101  
    11;+ 
    2 ; NAME: 
    3 ;       LL_NARCS_DISTANCES 
    42; 
    5 ; PURPOSE: 
    6 ;       This function returns the longitude and latitude [lon, lat] of 
    7 ;       a point a given arc distance (-pi <= Arc_Dist <= pi), and azimuth (Az), 
    8 ;       from a specified location Lon0, lat0. 
     3; @file_comments 
     4; This function returns the longitude and latitude [lon, lat] of 
     5;a point a given arc distance (-pi <= Arc_Dist <= pi), and azimuth (Az), 
     6;from a specified location Lon0, lat0. 
    97;       Same as LL_ARC_DISTANCE but for n points without do loop. 
    108; 
    11 ; CATEGORY: 
    12 ;       Mapping, geography. 
     9; @categories Mapping, geography 
    1310; 
    14 ; CALLING SEQUENCE: 
    15 ;       Result = LL_NARCS_DISTANCES(Lon, lat0, Arc_Dist, Az) 
     11; @examples  
     12;Result = LL_NARCS_DISTANCES(Lon, lat0, Arc_Dist, Az) 
    1613; 
    17 ; INPUTS: 
    18 ;       Lon0: An array containing the longitude of the starting point. 
     14;    @param Lon0 {in}{required}  An array containing the longitude of the starting point. 
    1915;             Values are assumed to be in radians unless the keyword 
    2016;             DEGREES is set. 
    21 ;       Lat0: An array containing the latitude of the starting point. 
     17;    @param Lat0 {in}{required} An array containing the latitude of the starting point. 
    2218;             Values are assumed to be in radians unless the keyword 
    2319;             DEGREES is set. 
    24 ;       Arc_Dist: The arc distance from Lon_lat0. The value must be between 
    25 ;                -!PI and +!PI. To express distances in arc units, divide 
    26 ;                 by the radius of the globe expressed in the original units. 
    27 ;                 For example, if the radius of the earth is 6371 km, divide 
    28 ;                 the distance in km by 6371 to obtain the arc distance.     
    29 ;       Az:       The azimuth from Lon_lat0. The value is assumed to be in 
    30 ;                 radians unless the keyword DEGREES is set. 
     20;    @param Arc_Dist {in}{required} The arc distance from Lon_lat0. The value must be between 
     21; -!PI and +!PI. To express distances in arc units, divide 
     22;  by the radius of the globe expressed in the original units. 
     23;  For example, if the radius of the earth is 6371 km, divide 
     24;  the distance in km by 6371 to obtain the arc distance.     
     25;    @param Az {in}{required}   The azimuth from Lon_lat0. The value is assumed to be in 
     26;  radians unless the keyword DEGREES is set. 
    3127; 
    32 ; KEYWORD PARAMETERS: 
    33 ;       DEGREES:  Set this keyword to express all measurements and 
    34 ;                 results in degrees. 
     28; @keyword    DEGREES  Set this keyword to express all measurements and 
     29;  results in degrees. 
    3530; 
    36 ; OUTPUTS: 
    37 ;       This function returns a (2, n) array containing the  
     31; @returns 
     32; a (2, n) array containing the  
    3833;       longitude / latitude of the resultings points. Values are in radians 
    3934;       unless the keyword DEGREES is set. 
    4035; 
    41 ; PROCEDURE: 
    42 ;       Formula from Map Projections - a working manual.  USGS paper 
    43 ;       1395.  Equations (5-5) and (5-6). 
     36; @file_comments 
     37;Formula from Map Projections - a working manual.  USGS paper 
     38;1395.  Equations (5-5) and (5-6). 
    4439; 
    45 ; EXAMPLE: 
    46 ;       Lon_lat0 = [1.0, 2.0]           ; Initial point specified in radians     
    47 ;       Arc_Dist = 2.0                  ; Arc distance in radians 
    48 ;       Az = 1.0                        ; Azimuth in radians 
    49 ;       Result = LL_ARC_DISTANCE(Lon_lat0, Arc_Dist, Az) 
    50 ;       PRINT, Result 
    51 ;         2.91415    -0.622234 
     40; @examples  
     41;Lon_lat0 = [1.0, 2.0]; Initial point specified in radians 
     42;Arc_Dist = 2.0; Arc distance in radians 
     43;Az = 1.0; Azimuth in radians 
     44;Result = LL_ARC_DISTANCE(Lon_lat0, Arc_Dist, Az) 
     45;PRINT, Result 
     46;       2.91415    -0.622234 
    5247; 
    53 ;       IDL> lon0 = [-10, 20, 100] 
    54 ;       IDL> lat0 = [0, -10, 45] 
    55 ;       IDL> lon1 = [10, 60, 280] 
    56 ;       IDL> lat1 = [0, 10, 45] 
    57 ;       IDL> dist = map_npoints(lon0, lat0, lon1, lat1, azimuth = azi, /two_by_two) 
    58 ;       IDL> earthradius = 6378206.4d0 
    59 ;       IDL> res = ll_narcs_distances(lon0, lat0, dist/earthradius, azi, /degrees) 
    60 ;       IDL> print, reform(res[0, *]) 
    61 ;              10.000000       60.000000       280.00000 
    62 ;       IDL> print, reform(res[1, *]) 
     48;IDL> lon0 = [-10, 20, 100] 
     49;IDL> lat0 = [0, -10, 45] 
     50;IDL> lon1 = [10, 60, 280] 
     51;IDL> lat1 = [0, 10, 45] 
     52;IDL> dist = map_npoints(lon0, lat0, lon1, lat1, azimuth = azi, /two_by_two) 
     53;IDL> earthradius = 6378206.4d0 
     54;IDL> res = ll_narcs_distances(lon0, lat0, dist/earthradius, azi, /degrees) 
     55;IDL> print, reform(res[0, *]) 
     56;       10.000000       60.000000       280.00000 
     57;IDL> print, reform(res[1, *]) 
    6358;          1.1999280e-15       10.000000       45.000000 
    6459; 
    65 ; MODIFICATION HISTORY: 
     60; @history 
    6661;       Based on the IDL function ll_arc_distance.pro,v 1.11 2003/02/03 
    67 ;       Sebastien Masson (smasson@lodyc.jussieu.fr) 
     62; Sebastien Masson (smasson\@lodyc.jussieu.fr) 
    6863;                  August 2005 
    6964;- 
    7065 
    71 ; Return the [lon, lat] of the point a given arc distance  
    72 ;       (-pi <= arc_dist <= pi), 
     66;+ 
     67; @file_comments Return the [lon, lat] of the point a given arc distance  
     68;(-pi <= arc_dist <= pi), 
    7369; and azimuth (az), from lon_lat0. 
     70;- 
    7471; 
    7572FUNCTION LL_NARCS_DISTANCES, lon0, lat0, arc_dist, az, DEGREES = degs 
  • trunk/SRC/Interpolation/map_npoints.pro

    r59 r101  
    11;+ 
    2 ; NAME: 
    3 ;       Map_nPoints 
    42; 
    5 ; PURPOSE: 
    6 ;       Return the distance in meter between all np0 points P0 and all 
     3; @file_comments 
     4;Return the distance in meter between all np0 points P0 and all 
    75;       np1 points P1 on a sphere. If keyword /TWO_BY_TWO is given then 
    86;       returns the distances between number n of P0 points and number 
     
    119;       without do loop. 
    1210; 
    13 ; CATEGORY: 
    14 ;       Maps. 
     11; @categories Maps 
    1512; 
    16 ; CALLING SEQUENCE: 
    17 ;       Result = Map_nPoints(lon0, lat0, lon1, lat1) 
     13; @examples  
     14;Result = Map_nPoints(lon0, lat0, lon1, lat1) 
    1815; 
    19 ; INPUTS: 
    20 ;       Lon0, Lat0 = np0 elements vector. longitudes and latitudes of 
    21 ;       np0 points P0  
    22 ;       Lon1, Lat1 = np1 elements vector. longitude and latitude of 
    23 ;       np1 points P1  
     16;@param Lon0 Lat0  {in}{required} np0 elements vector. longitudes and latitudes of np0 points P0  
     17;@param Lon1 Lat1  {in}{required}  np1 elements vector. longitude and latitude of np1 points P1  
    2418; 
    25 ; KEYWORD PARAMETERS: 
    26 ; 
    27 ;   AZIMUTH: A named variable that will receive the azimuth of the great 
     19; @keyword   AZIMUTH A named variable that will receive the azimuth of the great 
    2820;       circle  connecting the two points, P0 to P1 
    29 ;   /MIDDLE: to get the longitude/latitude of the middle point betwen P0 and P1. 
    30 ;   RADIANS = if set, inputs and angular outputs are in radians, otherwise 
    31 ;       degrees. 
    32 ;   RADIUS: If given, return the distance between the two points 
    33 ;       calculated using the given radius. 
     21; @keyword   /MIDDLE to get the longitude/latitude of the middle point betwen P0 and P1. 
     22; @keyword   RADIANS = if set, inputs and angular outputs are in radians, otherwise 
     23;degrees. 
     24; @keyword   RADIUS If given, return the distance between the two points 
     25;calculated using the given radius. 
    3426;       Default value is the earth radius : 6378206.4d0 
    35 ;   TWO_BY_TWO:If given,then Map_nPoints returns the distances between 
     27; @keyword   TWO_BY_TWO:If given,then Map_nPoints returns the distances between 
    3628;       number n of P0 points and number n of P1 points (in that case, 
    3729;       np0 and np1 must be equal). 
    3830; 
    39 ; OUTPUTS: 
     31; @returns 
    4032;       An (np0,np1) array giving the distance in meter between np0 
    4133;       points P0 and np1 points P1. Element (i,j) of the ouput is the 
     
    4638;       if /MIDDLE see this keyword. 
    4739; 
    48 ; EXAMPLES: 
    49 ;       IDL> print, $ 
    50 ;       map_npoints([-105.15,1],[40.02,1],[-0.07,100,50],[51.30,20,0]) 
    51 ;              7551369.3       5600334.8 
    52 ;              12864354.       10921254. 
    53 ;              14919237.       5455558.8 
    54 ;        
    55 ;       IDL> lon0 = [-10, 20, 100] 
    56 ;       IDL> lat0 = [0, -10, 45] 
    57 ;       IDL> lon1 = [10, 60, 280] 
    58 ;       IDL> lat1 = [0, 10, 45] 
    59 ;       IDL> dist = map_npoints(lon0, lat0, lon1, lat1, azimuth = azi) 
    60 ;       IDL> help, dist, azi 
    61 ;       DIST            DOUBLE    = Array[3, 3] 
    62 ;       AZI             DOUBLE    = Array[3, 3] 
    63 ;       IDL> print, dist[4*lindgen(3)], azi[4*lindgen(3)] 
    64 ;              2226414.0       4957944.5       10018863. 
    65 ;              90.000000       64.494450   4.9615627e-15 
    66 ;       IDL> dist = map_npoints(lon0, lat0, lon1, lat1, azimuth = azi, /two_by_two) 
    67 ;       IDL> help, dist, azi 
    68 ;       DIST            DOUBLE    = Array[3] 
    69 ;       AZI             DOUBLE    = Array[3] 
    70 ;       IDL> print, dist, azi 
    71 ;              2226414.0       4957944.5       10018863. 
    72 ;              90.000000       64.494450   4.9615627e-15 
    73 ;       IDL> print, map_2points(lon0[0], lat0[0], lon1[0], lat1[0]) 
    74 ;              20.000000       90.000000 
    75 ;       IDL> print, map_npoints(lon0[0], lat0[0], lon1[0], lat1[0], azi=azi)/6378206.4d0 / !dtor, azi 
    76 ;              20.000000 
    77 ;              90.000000 
     40; @examples 
     41;IDL> print, $ 
     42;map_npoints([-105.15,1],[40.02,1],[-0.07,100,50],[51.30,20,0]) 
     43;       7551369.3       5600334.8 
     44;       12864354.       10921254. 
     45;       14919237.       5455558.8 
    7846; 
    79 ;       IDL> lon0 = [-10, 20, 100] 
    80 ;       IDL> lat0 = [0, -10, 45] 
    81 ;       IDL> lon1 = [10, 60, 280] 
    82 ;       IDL> lat1 = [0, 10, 45] 
    83 ;       IDL> mid = map_npoints(lon0, lat0, lon1, lat1, /middle, /two_by_two) 
    84 ;       IDL> print, reform(mid[0,*]), reform(mid[1,*]) 
    85 ;              0.0000000       40.000000       190.00000 
    86 ;              0.0000000  -1.5902773e-15       90.000000 
    87 ;       IDL> print, (map_2points(lon0[0], lat0[0], lon1[0], lat1[0], npath = 3))[*, 1] 
    88 ;              0.0000000       0.0000000 
    89 ;       IDL> print, (map_2points(lon0[1], lat0[1], lon1[1], lat1[1], npath = 3))[*, 1] 
    90 ;              40.000000  -1.5902773e-15 
    91 ;       IDL> print, (map_2points(lon0[2], lat0[2], lon1[2], lat1[2], npath = 3))[*, 1] 
    92 ;              190.00000       90.000000 
    93 ;        
    94 ; MODIFICATION HISTORY: 
     47;IDL> lon0 = [-10, 20, 100] 
     48;IDL> lat0 = [0, -10, 45] 
     49;IDL> lon1 = [10, 60, 280] 
     50;IDL> lat1 = [0, 10, 45] 
     51;IDL> dist = map_npoints(lon0, lat0, lon1, lat1, azimuth = azi) 
     52;IDL> help, dist, azi 
     53;DIST            DOUBLE    = Array[3, 3] 
     54;AZI             DOUBLE    = Array[3, 3] 
     55;IDL> print, dist[4*lindgen(3)], azi[4*lindgen(3)] 
     56;       2226414.0       4957944.5       10018863. 
     57;       90.000000       64.494450   4.9615627e-15 
     58;IDL> dist = map_npoints(lon0, lat0, lon1, lat1, azimuth = azi, /two_by_two) 
     59;IDL> help, dist, azi 
     60;DIST            DOUBLE    = Array[3] 
     61;AZI             DOUBLE    = Array[3] 
     62;IDL> print, dist, azi 
     63;       2226414.0       4957944.5       10018863. 
     64;       90.000000       64.494450   4.9615627e-15 
     65;IDL> print, map_2points(lon0[0], lat0[0], lon1[0], lat1[0]) 
     66;       20.000000       90.000000 
     67;IDL> print, map_npoints(lon0[0], lat0[0], lon1[0], lat1[0], azi=azi)/6378206.4d0 / !dtor, azi 
     68;       20.000000 
     69;       90.000000 
     70; 
     71;IDL> lon0 = [-10, 20, 100] 
     72;IDL> lat0 = [0, -10, 45] 
     73;IDL> lon1 = [10, 60, 280] 
     74;IDL> lat1 = [0, 10, 45] 
     75;IDL> mid = map_npoints(lon0, lat0, lon1, lat1, /middle, /two_by_two) 
     76;IDL> print, reform(mid[0,*]), reform(mid[1,*]) 
     77;       0.0000000       40.000000       190.00000 
     78;       0.0000000  -1.5902773e-15       90.000000 
     79;IDL> print, (map_2points(lon0[0], lat0[0], lon1[0], lat1[0], npath = 3))[*, 1] 
     80;       0.0000000       0.0000000 
     81;IDL> print, (map_2points(lon0[1], lat0[1], lon1[1], lat1[1], npath = 3))[*, 1] 
     82;       40.000000  -1.5902773e-15 
     83;IDL> print, (map_2points(lon0[2], lat0[2], lon1[2], lat1[2], npath = 3))[*, 1] 
     84;       190.00000       90.000000 
     85; 
     86; @history 
    9587;       Based on the IDL function map_2points.pro,v 1.6 2001/01/15 
    96 ;       Sebastien Masson (smasson@lodyc.jussieu.fr) 
     88; Sebastien Masson (smasson\@lodyc.jussieu.fr) 
    9789;                  October 2003 
    9890;- 
  • trunk/SRC/Interpolation/neighbor.pro

    r74 r101  
    11;+ 
    2 ; NAME: 
    3 ;       neighbor 
    42; 
    5 ; PURPOSE: 
    6 ;       find the closetest point of (P0) within a list of np1 points 
    7 ;       P1 Which can be on a sphere  
     3; @file_comments 
     4;find the closetest point of (P0) within a list of np1 points 
     5;P1 Which can be on a sphere  
    86; 
    9 ; CATEGORY: 
    10 ;       Maps. 
     7; @categories Maps 
    118; 
    12 ; CALLING SEQUENCE: 
    13 ;       Result = neighbor(lon0, lat0, lon1, lat1) 
     9; @examples  
     10; IDL> Result = neighbor(lon0, lat0, lon1, lat1) 
    1411; 
    15 ; INPUTS: 
    16 ;       Lon0, Lat0 = scalar. longitudes and latitudes of point P0.  
    17 ;       Lon1, Lat1 = np1 elements vector. longitude and latitude of 
    18 ;       np1 points P1  
     12;@param p0lon {in}{required}  scalar. longitudes of point P0.  
     13;@param p0lat  {in}{required}  scalar. latitudes of point P0.  
    1914; 
    20 ; KEYWORD PARAMETERS: 
    21 ;   RADIANS = if set, inputs and angular outputs are in radians, otherwise 
    22 ;       degrees. 
    23 ;   DISTANCE = dis, to get back the distances between P0 and the np1 
     15; @keyword   RADIANS if set, inputs and angular outputs are in radians, otherwise 
     16;degrees. 
     17; @keyword   DISTANCE dis, to get back the distances between P0 and the np1 
    2418;   points P1 in the variable dis. 
    25 ;   /SPHERE to activate if points are located on a sphere. 
     19; @keyword   /SPHERE to activate if points are located on a sphere. 
    2620; 
    27 ; OUTPUTS: 
     21; @returns 
    2822;       index giving the P1[index] point that is the closetest point 
    2923;       of (P0) 
    3024; 
    31 ; EXAMPLES: 
     25; @examples 
    3226;       IDL> print, neighbor(-105.15,40.02,[-0.07,100,50],[51.30,20,0], $ 
    3327;            distance=dis) 
     
    3630;             105.684      206.125      160.228 
    3731; 
    38 ; MODIFICATION HISTORY: 
    39 ;       Sebastien Masson (smasson@lodyc.jussieu.fr) 
     32; @history 
     33; Sebastien Masson (smasson\@lodyc.jussieu.fr) 
    4034;                  October 2003 
    4135;- 
  • trunk/SRC/Interpolation/quadrilateral2square.pro

    r59 r101  
    11;+ 
    2 ; NAME:quadrilateral2square 
    32; 
    4 ; PURPOSE:warm (or map) an arbitrary quadrilateral onto a unit square  
     3; @file_comments warm (or map) an arbitrary quadrilateral onto a unit square  
    54; according to the 4-point correspondences: 
    65;       (x0,y0) -> (0,0) 
     
    1312; mappings. see ref. bellow. 
    1413; 
    15 ; CATEGORY:image/grid manipulation 
     14; @categories image, grid manipulation 
    1615; 
    17 ; CALLING SEQUENCE: 
     16; @examples  
    1817; 
    1918;     res = square2quadrilateral(x0,y0,x1,y1,x2,y2,x3,y3,xin,yin) 
    2019;  
    21 ; INPUTS: 
    22 ; 
    23 ;     x0,y0,x1,y1,x2,y2,x3,y3 the coordinates of the quadrilateral 
     20;     @param x0in {in}{required}  the coordinates of the quadrilateral 
     21;     @param y0in {in}{required}  the coordinates of the quadrilateral 
     22;     @param x1in {in}{required}  the coordinates of the quadrilateral 
     23;     @param y1in {in}{required}  the coordinates of the quadrilateral 
     24;     @param x2in {in}{required}  the coordinates of the quadrilateral 
     25;     @param y2in {in}{required}  the coordinates of the quadrilateral 
     26;     @param x3in {in}{required}  the coordinates of the quadrilateral 
     27;     @param y3in  {in}{required}  the coordinates of the quadrilateral 
    2428;     (see above for correspondance with the unit square). Can be 
    2529;     scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 
    2630;     given in the anticlockwise order. 
    2731; 
    28 ;     xin,yin:the coordinates of the point(s) for which we want to do the 
     32;     @param xxin {in}{required} the coordinates of the point(s) for which we want to do the 
     33;     mapping. Can be scalar or array. 
     34;     @param yyin {in}{required} the coordinates of the point(s) for which we want to do the 
    2935;     mapping. Can be scalar or array. 
    3036; 
    31 ; KEYWORD PARAMETERS: 
    32 ; 
    33 ;    /DOUBLE: use double precision to perform the computation  
    34 ; 
    35 ; OUTPUTS: 
     37; @returns 
    3638; 
    3739;     (2,n) array: the new coodinates (xout, yout) of the (xin,yin) 
     
    4143;     elements of xin. 
    4244; 
    43 ; COMMON BLOCKS:none 
    44 ; 
    45 ; SIDE EFFECTS: 
    46 ; 
    47 ; RESTRICTIONS: I think degenerated quadrilateral (e.g. flat of 
     45; @restrictions I think degenerated quadrilateral (e.g. flat of 
    4846; twisted) is not work. This has to be tested. 
    4947; 
    50 ; EXAMPLE: 
     48; @examples  
    5149; 
    5250; IDL> splot,[0,5],[0,3],/nodata,xstyle=1,ystyle=1 
     
    6058; IDL> tracegrille, reform(inorg[0,*],11,11), reform(inorg[1,*],11,11),color=indgen(12)*20 
    6159; 
    62 ; MODIFICATION HISTORY: 
    63 ;      Sebastien Masson (smasson@lodyc.jussieu.fr) 
     60; @history 
     61;      Sebastien Masson (smasson\@lodyc.jussieu.fr) 
    6462;      August 2003 
    6563;      Based on "Digital Image Warping" by G. Wolberg 
  • trunk/SRC/Interpolation/spl_fstdrv.pro

    r69 r101  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:spl_fstdrv 
    65; 
    7 ; PURPOSE: SPL_FSTDRV returns the values of the first derivative of 
     6; @file_comments SPL_FSTDRV returns the values of the first derivative of 
    87; the interpolating function at the points X2i. it is a double 
    98; precision array. 
     
    1514; in a way that interpolated value are also in ascending order 
    1615; 
    17 ; CATEGORY: 
     16; @examples  y2 =  spl_fstdrv(x, y, yscd, x2) 
    1817; 
    19 ; CALLING SEQUENCE: y2 =  spl_fstdrv(x, y, yscd, x2) 
    20 ; 
    21 ; INPUTS: 
    22 ; 
    23 ;    x: An n-element (at least 2) input vector that specifies the 
     18;    @param x {in}{required}  An n-element (at least 2) input vector that specifies the 
    2419;    tabulate points in ascending order. 
    2520; 
    26 ;    y: f(x) = y. An n-element input vector that specifies the values 
     21;    @param y {in}{required} f(x) = y. An n-element input vector that specifies the values 
    2722;    of the tabulated function F(Xi) corresponding to Xi. 
    2823; 
    29 ;    yscd: The output from SPL_INIT for the specified X and Y. 
     24;    @param yscd {in}{required} The output from SPL_INIT for the specified X and Y. 
    3025; 
    31 ;    x2: The input values for which the first derivative values are 
     26;    @param x2 {in}{required} The input values for which the first derivative values are 
    3227;    desired. X can be scalar or an array of values. 
    3328 
    34 ; KEYWORD PARAMETERS: none 
    35 ; 
    36 ; OUTPUTS:  
     29; @returns  
    3730; 
    3831;    y2: f'(x2) = y2.  
    3932; 
    40 ; COMMON BLOCKS: none 
    4133; 
    42 ; SIDE EFFECTS: ? 
    43 ; 
    44 ; RESTRICTIONS: ? 
    45 ; 
    46 ; EXAMPLE: 
    47 ; 
    48 ; MODIFICATION HISTORY: 
    49 ;  Sebastien Masson (smasson@lodyc.jussieu.fr): May 2005 
     34; @history 
     35;  Sebastien Masson (smasson\@lodyc.jussieu.fr): May 2005 
    5036;- 
    5137;------------------------------------------------------------ 
  • trunk/SRC/Interpolation/spl_incr.pro

    r69 r101  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:spl_incr 
    6 ; 
    7 ; PURPOSE: 
     5; 
     6; @file_comments 
    87; 
    98; Given the arrays X and Y, which tabulate a function (with the X[i] 
     
    1312; in a way that interpolated values are also monotonically increasing. 
    1413; 
    15 ; CATEGORY: 
    16 ; 
    17 ; CALLING SEQUENCE: y2 =  spl_incr(x, y, x2) 
    18 ; 
    19 ; INPUTS: 
    20 ; 
    21 ;    x: An n-element (at least 2) input vector that specifies the 
     14; @examples  y2 =  spl_incr(x, y, x2) 
     15; 
     16; @param x1 {in}{required}  An n-element (at least 2) input vector that specifies the 
    2217;    tabulate points in a strict ascending order. 
    2318; 
    24 ;    y: f(x) = y. An n-element input vector that specifies the values 
     19;    @param y1 {in}{required} f(x) = y. An n-element input vector that specifies the values 
    2520;    of the tabulated function F(Xi) corresponding to Xi. As f is 
    2621;    supposed to be monotonically increasing, y values must be 
    2722;    monotonically increasing. y can have equal consecutive values. 
    2823; 
    29 ;    x2: The input values for which the interpolated values are 
     24;    @param x2 {in}{required} The input values for which the interpolated values are 
    3025;    desired. Its values must be strictly monotonically increasing.  
    3126; 
    32 ; KEYWORD PARAMETERS: 
    33 ; 
    34 ;    YP0: The first derivative of the interpolating function at the 
    35 ;    point X0. If YP0 is omitted, the second derivative at the 
    36 ;    boundary is set to zero, resulting in a "natural spline." 
    37 ; 
    38 ;    YPN_1: The first derivative of the interpolating function at the 
    39 ;    point Xn-1. If YPN_1 is omitted, the second derivative at the 
    40 ;    boundary is set to zero, resulting in a "natural spline."  
    41 ; 
    42 ; OUTPUTS:  
     27; 
     28; 
     29; 
     30; @returns  
    4331; 
    4432;    y2: f(x2) = y2. Double precision array 
    4533; 
    46 ; COMMON BLOCKS: none 
    47 ; 
    48 ; SIDE EFFECTS: ? 
    49 ; 
    50 ; RESTRICTIONS: 
     34; @restrictions 
    5135;   It might be possible that y2[i+1]-y2[i] has very small negative 
    5236;   values (amplitude smaller than 1.e-6)... 
    5337; 
    54 ; EXAMPLE: 
     38; @examples  
    5539; 
    5640;     n = 100L 
     
    7357;     oplot,[0, n_elements(c)], [0, 0], linestyle = 1 
    7458; 
    75 ; MODIFICATION HISTORY: 
    76 ;  Sebastien Masson (smasson@lodyc.jussieu.fr): May-Dec 2005 
     59; @history 
     60;  Sebastien Masson (smasson\@lodyc.jussieu.fr): May-Dec 2005 
    7761;- 
    7862;------------------------------------------------------------ 
     
    11296END 
    11397 
     98;+ 
     99; @keyword    YP0 The first derivative of the interpolating function at the 
     100;    point X0. If YP0 is omitted, the second derivative at the 
     101;    boundary is set to zero, resulting in a "natural spline." 
     102; @keyword    YPN_1 The first derivative of the interpolating function at the 
     103;    point Xn-1. If YPN_1 is omitted, the second derivative at the 
     104;    boundary is set to zero, resulting in a "natural spline."  
     105;- 
    114106FUNCTION spl_incr, x, y, x2, YP0 = yp0, YPN_1 = ypn_1 
    115107; 
  • trunk/SRC/Interpolation/spl_keep_mean.pro

    r69 r101  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:spl_keep_mean 
    6 ; 
    7 ; PURPOSE: 
     5; @file_comments 
    86; 
    97; Given the arrays X and Y, which tabulate a function (with the X[i] 
     
    1614; data equa to the original values) 
    1715; 
    18 ; CATEGORY: 
     16; @examples  y2 =  spl_keep_mean(x, y, x2) 
    1917; 
    20 ; CALLING SEQUENCE: y2 =  spl_keep_mean(x, y, x2) 
    21 ; 
    22 ; INPUTS: 
    23 ; 
    24 ;    x: An n-element (at least 2) input vector that specifies the 
     18;    @param x {in}{required}  An n-element (at least 2) input vector that specifies the 
    2519;    tabulate points in a strict ascending order. 
    2620; 
    27 ;    y: an array with one element less than x. y[i] represents the 
     21;    @param yin {in}{required} an array with one element less than x. y[i] represents the 
    2822;    mean value between x[i] and x[i+1]. if /GE0 is activated, y must 
    2923;    have positive values. 
    3024; 
    31 ;    x2: The input values for which the interpolated values are 
     25;    @param x2 {in}{required} The input values for which the interpolated values are 
    3226;    desired. Its values must be strictly monotonically increasing.  
    3327; 
    34 ; KEYWORD PARAMETERS: 
    3528; 
    36 ;    /GE0: to force that y2 is always GE than 0. In that case, y must 
     29; @keyword    /GE0 to force that y2 is always GE than 0. In that case, y must 
    3730;    also be GE than 0. 
    3831; 
    39 ;    YP0: The first derivative of the interpolating function at the 
     32; @keyword    YP0 The first derivative of the interpolating function at the 
    4033;    point X0. If YP0 is omitted, the second derivative at the 
    4134;    boundary is set to zero, resulting in a "natural spline." 
    4235; 
    43 ;    YPN_1: The first derivative of the interpolating function at the 
     36; @keyword    YPN_1 The first derivative of the interpolating function at the 
    4437;    point Xn-1. If YPN_1 is omitted, the second derivative at the 
    4538;    boundary is set to zero, resulting in a "natural spline."  
    4639; 
    47 ; OUTPUTS:  
     40; @returns  
    4841; 
    4942;    y2: the meean value between two consecutive values of x2. This 
    5043;    array has one element less than y2. y2 has double precision. 
    5144; 
    52 ; COMMON BLOCKS: none 
    53 ; 
    54 ; SIDE EFFECTS: ? 
    55 ; 
    56 ; RESTRICTIONS: 
     45; @restrictions 
    5746;   It might be possible that y2 has very small negative values 
    5847;   (amplitude smaller than 1.e-6)...  
    5948; 
    6049; 
    61 ; EXAMPLE: 
     50; @examples  
    6251; 
    6352;    12 monthly values of precipitations into daily values: 
     
    8170;    print, total(y2*(x2[1:n2-1]-x2[0:n2-2])) 
    8271; 
    83 ; MODIFICATION HISTORY: 
    84 ;  Sebastien Masson (smasson@lodyc.jussieu.fr): May 2005 
     72; @history 
     73;  Sebastien Masson (smasson\@lodyc.jussieu.fr): May 2005 
    8574;- 
    8675;------------------------------------------------------------ 
  • trunk/SRC/Interpolation/square2quadrilateral.pro

    r59 r101  
    11;+ 
    2 ; NAME:square2quadrilateral 
    3 ; 
    4 ; PURPOSE:warm (or map) a unit square onto an arbitrary quadrilateral 
     2; 
     3; @file_comments warm (or map) a unit square onto an arbitrary quadrilateral 
    54; according to the 4-point correspondences: 
    65;       (0,0) -> (x0,y0) 
     
    1211; mappings. see ref. bellow. 
    1312; 
    14 ; CATEGORY:image/grid manipulation 
    15 ; 
    16 ; CALLING SEQUENCE: 
     13; @categories image, grid manipulation 
     14; 
     15; @examples  
    1716; 
    1817;     res = square2quadrilateral(x0,y0,x1,y1,x2,y2,x3,y3[,xin,yin]) 
    1918;  
    20 ; INPUTS: 
    21 ; 
    22 ;     x0,y0,x1,y1,x2,y2,x3,y3 the coordinates of the quadrilateral 
    23 ;     (see above for correspondance with the unit square). Can be 
    24 ;     scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 
    25 ;     given in the anticlockwise order. 
    26 ; 
    27 ;     xin,yin:the coordinates of the point(s) for which we want to do the 
     19FUNCTION square2quadrilateral, x0in, y0in, x1in, y1in, x2in, y2in, x3in, y3in, xxin, yyin 
     20;     @param x0in {in}{required}  the coordinates of the quadrilateral 
     21;     (see above for correspondance with the unit square). Can be 
     22;     scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 
     23;     given in the anticlockwise order. 
     24;     @param y0in {in}{required}  the coordinates of the quadrilateral 
     25;     (see above for correspondance with the unit square). Can be 
     26;     scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 
     27;     given in the anticlockwise order. 
     28;     @param x1in {in}{required}  the coordinates of the quadrilateral 
     29;     (see above for correspondance with the unit square). Can be 
     30;     scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 
     31;     given in the anticlockwise order. 
     32;     @param y1in {in}{required}  the coordinates of the quadrilateral 
     33;     (see above for correspondance with the unit square). Can be 
     34;     scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 
     35;     given in the anticlockwise order. 
     36;     @param x2in {in}{required}  the coordinates of the quadrilateral 
     37;     (see above for correspondance with the unit square). Can be 
     38;     scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 
     39;     given in the anticlockwise order. 
     40;     @param y2in {in}{required}  the coordinates of the quadrilateral 
     41;     (see above for correspondance with the unit square). Can be 
     42;     scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 
     43;     given in the anticlockwise order. 
     44;     @param x3in {in}{required}  the coordinates of the quadrilateral 
     45;     (see above for correspondance with the unit square). Can be 
     46;     scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 
     47;     given in the anticlockwise order. 
     48;     @param y3in {in}{required}  the coordinates of the quadrilateral 
     49;     (see above for correspondance with the unit square). Can be 
     50;     scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 
     51;     given in the anticlockwise order. 
     52; 
     53;     @param xxin {in}{required} the coordinates of the point(s) for which we want to do the 
    2854;     mapping. Can be scalar or array. 
    29 ; 
    30 ; KEYWORD PARAMETERS: 
    31 ; 
    32 ;    /DOUBLE: use double precision to perform the computation  
    33 ; 
    34 ; OUTPUTS: 
     55;     @param yyin {in}{required} the coordinates of the point(s) for which we want to do the 
     56;     mapping. Can be scalar or array. 
     57; 
     58; @returns 
    3559; 
    3660;     (2,n) array: the new coodinates (xout, yout) of the (xin,yin) 
     
    4266;     matrix A which is used for the inverse transformation.  
    4367; 
    44 ; COMMON BLOCKS:none 
    45 ; 
    46 ; SIDE EFFECTS: 
    47 ; 
    48 ; RESTRICTIONS: I think degenerated quadrilateral (e.g. flat of 
     68; 
     69; @restrictions I think degenerated quadrilateral (e.g. flat of 
    4970; twisted) is not work. This has to be tested. 
    5071; 
    51 ; EXAMPLE: 
     72; @examples  
    5273; 
    5374; IDL> splot,[0,5],[0,3],/nodata,xstyle=1,ystyle=1 
     
    5879; IDL> tracegrille, reform(out[0,*],11,11), reform(out[1,*],11,11),color=indgen(12)*20 
    5980; 
    60 ; MODIFICATION HISTORY: 
    61 ;      Sebastien Masson (smasson@lodyc.jussieu.fr) 
     81; @history 
     82;      Sebastien Masson (smasson\@lodyc.jussieu.fr) 
    6283;      August 2003 
    6384;      Based on "Digital Image Warping" by G. Wolberg 
  • trunk/SRC/Interpolation/testinterp.pro

    r59 r101  
     1;+ 
     2;- 
    13PRO testinterp 
    24 
Note: See TracChangeset for help on using the changeset viewer.