Changeset 12399


Ignore:
Timestamp:
06/11/12 13:50:02 (13 years ago)
Author:
Mathieu Morlighem
Message:

minor

Location:
issm/trunk-jpl/src/m/model/plot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/model/plot/plot_overlay.m

    r12394 r12399  
    4141        md=radarpower(md,options);
    4242end
     43contrast = getfieldvalue(options,'contrast',1); 
     44radar = (md.radaroverlay.pwr).^(contrast);
     45radar = radar/max(radar(:));
     46%radar(find(radar==0))=1; %Change background from black to white
    4347
    4448%InterpFromMeshToGrid
     
    5357        data,xmin,ymax,xspacing,yspacing,nlines,ncols,NaN);
    5458
    55 %Process data_grid
     59%Process data_grid (For processing, it is better not to have nan)
    5660pos=find(isinf(data_grid));
    5761if ~isempty(pos),
     
    7074end
    7175data_nan=find(isnan(data_grid));
    72 
    73 %Generate HSV image
    74 contrast=getfieldvalue(options,'contrast',1); 
    75 transparency=getfieldvalue(options,'alpha',1);
    7676data_grid(data_nan)=data_min;
    7777
     78%Special colormaps that require hsv treatment
    7879colorm=getfieldvalue(options,'colormap','Rignot');
    79 
    80 %Special colormaps that require hsv treatment
    8180if strcmpi(colorm,'Rignot') | strcmpi(colorm,'Seroussi') | strcmpi(colorm,'redblue')
    8281        if strcmpi(colorm,'Rignot'),
     82                transparency=getfieldvalue(options,'alpha',1);
    8383                h=(data_grid-data_min)/(data_max-data_min+eps);
    8484                if radaronly, h(:)=0; end
    8585                s=max(min((0.1+h).^(1/transparency),1),0);
    8686        elseif strcmpi(colorm,'Seroussi'),
     87                transparency=getfieldvalue(options,'alpha',1);
    8788                h=1-(data_grid-data_min)/(data_max-data_min+eps)*0.7;
    8889                if radaronly, h(:)=0; end
     
    9697                error('colormap not supported yet. (''Rignot'' and ''redblue'' are the only cupported colormaps)');
    9798        end
    98 
    9999        %(S) Saturation is 0 in NaNs
    100100        s(data_nan)=0;
    101 
    102101        %(V) intensity is based on radar image
    103         radar=(md.radaroverlay.pwr).^(contrast);
    104         v=radar/max(radar(:)); %use radar power as intensity
    105         %pos=find(v==0);v(pos)=1; %Change background from black to white
     102        v=radar; %use radar power as intensity
    106103
    107104        %Transform HSV to RGB
     
    125122        radar = (md.radaroverlay.pwr).^(contrast);
    126123        radar = radar/max(radar(:));
    127         %pos=find(radar==0); %Change background from black to white
    128124        r = image_rgb(:,:,1).*radar;  r(data_nan) = radar(data_nan);  r(pos) = 1;  image_rgb(:,:,1) = r;  clear r;
    129125        g = image_rgb(:,:,2).*radar;  g(data_nan) = radar(data_nan);  g(pos) = 1;  image_rgb(:,:,2) = g;  clear g;
     
    146142
    147143%Apply options, without colorbar and without grid
    148 options=changefieldvalue(options,'colormap',colorm);           %We used an HSV colorbar
     144options=changefieldvalue(options,'colormap',colorm);              % We used an HSV colorbar
    149145if ~isnan(data_min),
    150         options=changefieldvalue(options,'caxis',[data_min data_max]); %force caxis so that the colorbar is ready
     146        options=changefieldvalue(options,'caxis',[data_min data_max]); % force caxis so that the colorbar is ready
    151147end
    152 options=addfielddefault(options,'axis','equal off');           %default axis
     148options=addfielddefault(options,'axis','equal off');              % default axis
    153149applyoptions(md,data,options);
    154150drawnow
  • issm/trunk-jpl/src/m/model/plot/subplotmodel.m

    r12309 r12399  
    1414hmargin = getfieldvalue(options,'hmargin',[.01 .01]);
    1515vmargin = getfieldvalue(options,'vmargin',[.01 .01]);
    16 
    1716
    1817height = (1-sum(vmargin)-(nlines-1)*gap(1))/nlines;
Note: See TracChangeset for help on using the changeset viewer.