Changeset 9074
- Timestamp:
- 07/19/11 16:28:29 (14 years ago)
- Location:
- issm/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp
r8159 r9074 11 11 /*Output*/ 12 12 double* griddata=NULL; 13 double* x_ m=NULL;14 double* y_ m=NULL;13 double* x_grid=NULL; 14 double* y_grid=NULL; 15 15 16 16 /*Intermediary*/ … … 28 28 double data_value; 29 29 double cornersouth; 30 double* x_grid=NULL;31 double* y_grid=NULL;32 30 33 31 /*some checks*/ … … 49 47 /*First, allocate pointers: */ 50 48 griddata=(double*)xcalloc(nlines*ncols,sizeof(double)); 51 x_m=(double*)xcalloc(ncols+1,sizeof(double));52 y_m=(double*)xcalloc(nlines+1,sizeof(double));53 49 x_grid=(double*)xcalloc(ncols,sizeof(double)); 54 50 y_grid=(double*)xcalloc(nlines,sizeof(double)); … … 65 61 /*Compute coordinates lists*/ 66 62 // EAST = ACTUAL WEST !!!!!!!!!!!!!!! 67 cornersouth=cornernorth-nlines*yposting; 68 for(i=0;i<nlines;i++) y_grid[i]= cornersouth + yposting/2 + yposting*i; 69 for(i=0;i<ncols; i++) x_grid[i]= cornereast + xposting/2 + xposting*i; 70 for(i=0;i<=nlines;i++) y_m[i]= cornersouth + yposting*i; 71 for(i=0;i<=ncols; i++) x_m[i]= cornereast + xposting*i; 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; 72 66 73 67 /*Initialize coordintes and griddata*/ … … 180 174 /*Assign output pointers:*/ 181 175 *pgriddata=griddata; 182 *px_m=x_ m;183 *py_m=y_ m;176 *px_m=x_grid; 177 *py_m=y_grid; 184 178 } -
issm/trunk/src/m/model/kmlimagesc.m
r7467 r9074 51 51 [x_m,y_m,field]=InterpFromMeshToGrid(md.elements,md.long,md.lat,field,minlong,maxlat,posting,posting,nlines,ncols,NaN); 52 52 field=flipud(field); 53 x_m=(x_m(1:end-1)+x_m(2:end))/2;54 y_m=(y_m(1:end-1)+y_m(2:end))/2;55 53 56 54 %massage and log: -
issm/trunk/src/mex/InterpFromMeshToGrid/InterpFromMeshToGrid.cpp
r8910 r9074 51 51 52 52 /*Write results: */ 53 WriteMatlabData(XM,x_m,ncols +1);54 WriteMatlabData(YM,y_m,nlines +1);53 WriteMatlabData(XM,x_m,ncols); 54 WriteMatlabData(YM,y_m,nlines); 55 55 WriteMatlabData(GRIDDATA,griddata,nlines,ncols); 56 56
Note:
See TracChangeset
for help on using the changeset viewer.