Changeset 2328


Ignore:
Timestamp:
09/25/09 11:21:13 (15 years ago)
Author:
Mathieu Morlighem
Message:

some fixing in plot overlay

Location:
issm/trunk/src/m/classes/public
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/public/modeldefault/modeldefault_process.m

    r2216 r2328  
    77%retrieve some paths
    88global ISSM_DIR
    9 modeldatapath='/u/wilkes-r1b/larour/ModelData';
     9modeldatapath='/u/astrid-r1b/larour/ModelData';
    1010
    1111%initialize output
  • issm/trunk/src/m/classes/public/plot/plot_overlay.m

    r2303 r2328  
    77%   See also: PLOTMODEL
    88
     9%process mesh and data
     10[x y z elements is2d]=processmesh(md,options_structure);
     11[data isongrid isquiver]=processdata(md,data,options_structure);
    912
    10 %check that buildoverlay has not already been called
     13%check is2d
     14if ~is2d,
     15        error('buildoverlay error message: overlay not supported for 3d meshes, project on a layer');
     16end
     17
     18%get xlim and ylim
     19if ~isnan(options_structure.xlim),
     20        xlim=options_structure.xlim;
     21else
     22        xlim=[min(md.x) max(md.x)];
     23end
     24if ~isnan(options_structure.ylim),
     25        ylim=options_structure.ylim;
     26else
     27        ylim=[min(md.y) max(md.y)];
     28end
     29
     30%radar power
     31redo=1;
     32if ~any(isnan(md.sarxm)) & ~any(isnan(md.sarym))
     33        choice=input('This model seems to have a radar power image. Do you want to use it? (y/n)','s');
     34        if strcmp(choice,'y'), redo=0; end
     35end
     36if redo,
     37        t1=clock; fprintf('%s','Extracting radar image...');
     38        md=radarpower(md,xlim,ylim,options_structure.highres);
     39        t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
     40end
     41
     42%mesh2grid
    1143redo=1;
    1244if (ischar(data) & isstruct(md.mesh2grid_parameters) & ismember(data,mesh2grid_parameters)),
     
    1446        if strcmp(choice,'y')
    1547                disp('use previous mesh2grid result');
     48                x_m=md.mesh2grid_x_m;
     49                y_m=md.mesh2grid_y_m;
     50                data_grid=md.mesh2grid_data;
    1651                redo=0;
    1752        end
    1853end
    19 
    20 if redo
    21         %process mesh and data
    22         [x y z elements is2d]=processmesh(md,options_structure);
    23         [data isongrid isquiver]=processdata(md,data,options_structure);
    24 
     54if redo,
    2555        %apply caxis if required
    2656        if ~isnan(options_structure.caxis),
    2757                data(find(data<options_structure.caxis(1)))=options_structure.caxis(1);
    2858                data(find(data>options_structure.caxis(2)))=options_structure.caxis(2);
    29         end
    30 
    31         %check is2d
    32         if ~is2d,
    33                 error('buildoverlay error message: overlay not supported for 3d meshes, project on a layer');
    34         end
    35 
    36         %Ok, first we need to recover the radar map.
    37         if ~isnan(options_structure.xlim),
    38                 xlim=options_structure.xlim;
    39         else
    40                 xlim=[min(md.x) max(md.x)];
    41         end
    42         if ~isnan(options_structure.ylim),
    43                 ylim=options_structure.ylim;
    44         else
    45                 ylim=[min(md.y) max(md.y)];
    46         end
    47         if ~any(isnan(md.sarxm)) & ~any(isnan(md.sarym))
    48                 choice=input('This model seems to have a radar power image. Do you want to use it? (y/n)','s');
    49                 if ~strcmp(choice,'y')
    50                         md=radarpower(md,xlim,ylim,options_structure.highres);
    51                 end
    52         else
    53                 md=radarpower(md,xlim,ylim,options_structure.highres);
    5459        end
    5560
     
    6166        nlines=length(md.sarym);
    6267        ncols =length(md.sarxm);
     68        t1=clock; fprintf('%s','Interpolating data on grid...');
    6369        [x_m y_m data_grid]=InterpFromMeshToGrid(elements,x,y,data,cornereast,cornernorth,xspacing,yspacing,nlines,ncols,0);
    64 else
    65         %process mesh and data
    66         [x y z elements is2d]=processmesh(md,options_structure);
    67         [data isongrid isquiver]=processdata(md,data,options_structure);
     70        t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
    6871end
    6972
  • issm/trunk/src/m/classes/public/radarpower.m

    r2130 r2328  
    1313
    1414%if MODELDATA has not been initialized (ie: empty), use default path.
    15 if isempty(MODELDATA), MODELDATA='/u/wilkes-r1b/larour/ModelData'; end
     15if isempty(MODELDATA), MODELDATA='/u/astrid-r1b/larour/ModelData'; end
    1616
    1717%find gdal coordinates
Note: See TracChangeset for help on using the changeset viewer.