Changeset 9242


Ignore:
Timestamp:
08/10/11 08:24:22 (14 years ago)
Author:
Mathieu Morlighem
Message:

replaced cornereast by xmin and cornernorth by ymax (too confusing otherwise)

Location:
issm/trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp

    r9074 r9242  
    77#include "../../include/include.h"
    88
    9 void InterpFromMeshToGridx(double** px_m,double** py_m,double** pgriddata,double* index_mesh, double* x_mesh, double* y_mesh, int nods,int nels, double* data_mesh, int data_length, double cornereast,double cornernorth,double xposting,double yposting,int nlines,int ncols,double default_value) {
     9void InterpFromMeshToGridx(double** px_m,double** py_m,double** pgriddata,double* index_mesh, double* x_mesh, double* y_mesh, int nods,int nels, double* data_mesh, int data_length, double xmin,double ymax,double xposting,double yposting,int nlines,int ncols,double default_value) {
    1010
    1111        /*Output*/
     
    2020        bool   debug;
    2121        int    xflip,yflip;
    22         double area;
     22        double area,ymin;
    2323        double area_1,area_2,area_3;
    2424        double x_tria_min,y_tria_min;
     
    2727        double x_grid_max,y_grid_max;
    2828        double data_value;
    29         double cornersouth;
    3029
    3130        /*some checks*/
     
    6059
    6160        /*Compute coordinates lists*/
    62         // EAST = ACTUAL WEST !!!!!!!!!!!!!!!
    63         cornersouth=cornernorth-(nlines-1)*yposting;
    64         for(i=0;i<nlines;i++)   y_grid[i]= cornersouth + yposting*i;
    65         for(i=0;i<ncols; i++)   x_grid[i]= cornereast  + xposting*i;
     61        ymin=ymax-(nlines-1)*yposting;
     62        for(i=0;i<nlines;i++)   y_grid[i]= ymin + yposting*i;
     63        for(i=0;i<ncols; i++)   x_grid[i]= xmin + xposting*i;
    6664
    6765        /*Initialize coordintes and griddata*/
  • issm/trunk/src/c/modules/InterpFromMeshToGridx/InterpFromMeshToGridx.h

    r3913 r9242  
    88#include "../../toolkits/toolkits.h"
    99
    10 void InterpFromMeshToGridx(double** px_m,double** py_m,double** pgriddata,double* index_mesh, double* x_mesh, double* y_mesh, int nods,int nels, double* data_mesh, int data_length, double cornereast,double cornernorth,double xposting,double yposting,int nlines,int ncols,double default_value);
     10void InterpFromMeshToGridx(double** px_m,double** py_m,double** pgriddata,double* index_mesh, double* x_mesh, double* y_mesh, int nods,int nels, double* data_mesh, int data_length, double xmin,double ymax,double xposting,double yposting,int nlines,int ncols,double default_value);
    1111
    1212#endif /* _INTERPFROMMESHTOGRIDX_H */
  • issm/trunk/src/m/model/plot/plot_overlay.m

    r9241 r9242  
    4343
    4444%InterpFromMeshToGrid
    45 cornereast=min(md.sarxm); cornernorth=max(md.sarym);
     45xmin=min(md.sarxm);
     46ymax=max(md.sarym);
    4647xspacing=(max(md.sarxm)-min(md.sarxm))/(length(md.sarxm));
    4748yspacing=(max(md.sarym)-min(md.sarym))/(length(md.sarym));
     
    4950ncols =length(md.sarxm);
    5051disp('Interpolating data on grid...');
    51 [x_m y_m data_grid]=InterpFromMeshToGrid(elements,x,y,data,cornereast,cornernorth,xspacing,yspacing,nlines,ncols,NaN);
     52[x_m y_m data_grid]=InterpFromMeshToGrid(elements,x,y,data,xmin,ymax,xspacing,yspacing,nlines,ncols,NaN);
    5253
    5354%Process data_grid
  • issm/trunk/src/mex/InterpFromMeshToGrid/InterpFromMeshToGrid.cpp

    r9074 r9242  
    1515        double* meshdata=NULL;
    1616        int     meshdata_length;
    17         double  cornereast;
    18         double  cornernorth;
     17        double  xmin;
     18        double  ymax;
    1919        double  xposting;
    2020        double  yposting;
     
    3939        FetchMatlabData(&y,NULL,NULL,Y);
    4040        FetchMatlabData(&meshdata,&meshdata_length,NULL,MESHDATA);
    41         FetchMatlabData(&cornereast,CORNEREAST);
    42         FetchMatlabData(&cornernorth,CORNERNORTH);
     41        FetchMatlabData(&xmin,XMIN);
     42        FetchMatlabData(&ymax,YMAX);
    4343        FetchMatlabData(&xposting,XPOSTING);
    4444        FetchMatlabData(&yposting,YPOSTING);
     
    4848
    4949        /*Call core of computation: */
    50         InterpFromMeshToGridx(&x_m,&y_m,&griddata,index,x,y,nods,nel,meshdata,meshdata_length,cornereast,cornernorth,xposting,yposting,nlines,ncols,default_value);
     50        InterpFromMeshToGridx(&x_m,&y_m,&griddata,index,x,y,nods,nel,meshdata,meshdata_length,xmin,ymax,xposting,yposting,nlines,ncols,default_value);
    5151
    5252        /*Write results: */
     
    7070        _printf_(true,"\n");
    7171        _printf_(true,"   Usage:\n");
    72         _printf_(true,"      [x_m,y_m,griddata]=InterpFromMeshToGrid(index,x,y,data,cornereast,cornernorth,xposting,yposting,nlines,ncols,default_value)\n");
     72        _printf_(true,"      [x_m,y_m,griddata]=InterpFromMeshToGrid(index,x,y,data,xmin,ymax,xposting,yposting,nlines,ncols,default_value)\n");
    7373        _printf_(true,"\n");
    7474        _printf_(true,"      index,x,y: delaunay triangulation defining the mesh.\n");
    7575        _printf_(true,"      meshdata: vertex values of data to be interpolated.\n");
    76         _printf_(true,"      cornereast,cornernorth,posting,nlines,ncols: parameters that define the grid\n");
     76        _printf_(true,"      xmin,ymax,posting,nlines,ncols: parameters that define the grid\n");
    7777        _printf_(true,"      default_value: value of points located out of the mesh.\n");
    7878        _printf_(true,"\n");
  • issm/trunk/src/mex/InterpFromMeshToGrid/InterpFromMeshToGrid.h

    r4236 r9242  
    2323#define Y (mxArray*)prhs[2]
    2424#define MESHDATA (mxArray*)prhs[3]
    25 #define CORNEREAST (mxArray*)prhs[4]
    26 #define CORNERNORTH (mxArray*)prhs[5]
     25#define XMIN (mxArray*)prhs[4]
     26#define YMAX (mxArray*)prhs[5]
    2727#define XPOSTING (mxArray*)prhs[6]
    2828#define YPOSTING (mxArray*)prhs[7]
Note: See TracChangeset for help on using the changeset viewer.