Changeset 2303


Ignore:
Timestamp:
09/23/09 16:16:42 (15 years ago)
Author:
Mathieu Morlighem
Message:

simplified overlay

Location:
issm/trunk/src/m/classes
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/@model/model.m

    r2276 r2303  
    236236        %mesh2grid
    237237        md.mesh2grid_parameters={};
    238         md.mesh2grid_interpolation={};
    239         md.mesh2grid_filter={};
    240         md.mesh2grid_cornereast=0;
    241         md.mesh2grid_cornernorth=0;
    242         md.mesh2grid_xposting=0;
    243         md.mesh2grid_yposting=0;
    244         md.mesh2grid_nlines=0;
    245         md.mesh2grid_ncolumns=0;
    246         md.mesh2grid_windowsize=0;
    247         md.mesh2grid_results=NaN;
     238        md.mesh2grid_data=NaN;
     239        md.mesh2grid_xm=NaN;
     240        md.mesh2grid_ym=NaN;
     241
     242        %dummy
    248243        md.dummy=NaN;
    249244
  • issm/trunk/src/m/classes/@model/setdefaultparameters.m

    r2267 r2303  
    237237md.alloc_cleanup=1;
    238238
    239 %mesh2grid parameter
    240 md.mesh2grid_parameters={'vel'};
    241 
    242 %interpolation type
    243 md.mesh2grid_interpolation={'node'};
    244 
    245 %filter
    246 md.mesh2grid_filter={'average'};
    247 
    248 %coordinate of the corner east (actually WEST...)
    249 md.mesh2grid_cornereast=0;
    250 
    251 %coordinate of the corner north
    252 md.mesh2grid_cornernorth=0;
    253 
    254 %x posting
    255 md.mesh2grid_xposting=1000;
    256 
    257 %y posting
    258 md.mesh2grid_yposting=1000;
    259 
    260 %number of lines
    261 md.mesh2grid_nlines=1000;
    262 
    263 %number of columns
    264 md.mesh2grid_ncolumns=1000;
    265 
    266 %window size
    267 md.mesh2grid_windowsize=1;
    268 
    269239%the string of solverstring is used directly by PETSc to solve finite element
    270240%systems KU=F. By default, we use MUMPS solver
  • issm/trunk/src/m/classes/public/plot/plot_overlay.m

    r2298 r2303  
    5454        end
    5555
    56         %use mesh2grid solution to get an gridded data to display using imagesc
    57         [x_m y_m data_mesh2grid]=InterpFromMeshToGrid(elements,x,y,data,min(xlim),max(ylim),...
    58                 (max(xlim)-min(xlim))/length(md.sarxm),(max(ylim)-min(ylim))/length(md.sarym),length(md.sarym),length(md.sarxm),NaN);
     56        %use InterpFromMeshToGrid to get an gridded data to display using imagesc
     57        cornereast =min(xlim);
     58        cornernorth=max(ylim);
     59        xspacing=(max(xlim)-min(xlim))/(length(md.sarxm));
     60        yspacing=(max(ylim)-min(ylim))/(length(md.sarym));
     61        nlines=length(md.sarym);
     62        ncols =length(md.sarxm);
     63        [x_m y_m data_grid]=InterpFromMeshToGrid(elements,x,y,data,cornereast,cornernorth,xspacing,yspacing,nlines,ncols,0);
    5964else
    6065        %process mesh and data
    6166        [x y z elements is2d]=processmesh(md,options_structure);
    6267        [data isongrid isquiver]=processdata(md,data,options_structure);
    63 
    64         %get previous result
    65         data_mesh2grid=mesh2grid_results(find(ismember(data,mesh2grid_parameters)));
    6668end
    6769
    6870%Ok, we have two images, double format:
    6971radar=md.sarpwr;
    70 
    71 %nullify NaN in results
    72 data_mesh2grid(find(isnan(data_mesh2grid)))=0;
    7372
    7473%Build hsv color image from radar and results
     
    8180%hue
    8281%cut results under 1.5, and log
    83 data_mesh2grid(find(data_mesh2grid<1.5))=1.5;
    84 h=bytscl(log(data_mesh2grid))/(255+1); %1 offset on colormap
     82data_grid(find(data_grid<1.5))=1.5;
     83h=bytscl(log(data_grid))/(255+1); %1 offset on colormap
    8584
    8685%saturation
    87 s=(0.5+data_mesh2grid/125)/transparency;s(find(s>1))=1;s(find(s<0))=0;
    88 s(find(data_mesh2grid==1.5))=0;
     86s=(0.5+data_grid/125)/transparency;s(find(s>1))=1;s(find(s<0))=0;
     87s(find(data_grid==1.5))=0;
    8988
    9089%Include border
     
    9291
    9392%Transform hsv to rgb
    94 image_hsv=zeros(size(data_mesh2grid,1),size(data_mesh2grid,2),3);
     93image_hsv=zeros(size(data_grid,1),size(data_grid,2),3);
    9594image_hsv(:,:,1)=h;
    9695image_hsv(:,:,2)=s;
  • issm/trunk/src/m/classes/public/plot/plotdoc.m

    r2256 r2303  
    7979disp('       ''ylabel'': same as standard matlab option');
    8080disp('       ''overlay'': yes or no. This will overlay a radar amplitude image behind');
    81 disp('       ''windowsize'': default is 1. size of filter window when using overlay.');
    8281disp('       ''highres'': resolution of overlayed radar amplitude image (default is 0, high resolution is 1).');
    8382disp('       ''alpha'': transparency coefficient (the higher, the more transparent). Default is 1.5');
Note: See TracChangeset for help on using the changeset viewer.