Changeset 12399
- Timestamp:
- 06/11/12 13:50:02 (13 years ago)
- 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 41 41 md=radarpower(md,options); 42 42 end 43 contrast = getfieldvalue(options,'contrast',1); 44 radar = (md.radaroverlay.pwr).^(contrast); 45 radar = radar/max(radar(:)); 46 %radar(find(radar==0))=1; %Change background from black to white 43 47 44 48 %InterpFromMeshToGrid … … 53 57 data,xmin,ymax,xspacing,yspacing,nlines,ncols,NaN); 54 58 55 %Process data_grid 59 %Process data_grid (For processing, it is better not to have nan) 56 60 pos=find(isinf(data_grid)); 57 61 if ~isempty(pos), … … 70 74 end 71 75 data_nan=find(isnan(data_grid)); 72 73 %Generate HSV image74 contrast=getfieldvalue(options,'contrast',1);75 transparency=getfieldvalue(options,'alpha',1);76 76 data_grid(data_nan)=data_min; 77 77 78 %Special colormaps that require hsv treatment 78 79 colorm=getfieldvalue(options,'colormap','Rignot'); 79 80 %Special colormaps that require hsv treatment81 80 if strcmpi(colorm,'Rignot') | strcmpi(colorm,'Seroussi') | strcmpi(colorm,'redblue') 82 81 if strcmpi(colorm,'Rignot'), 82 transparency=getfieldvalue(options,'alpha',1); 83 83 h=(data_grid-data_min)/(data_max-data_min+eps); 84 84 if radaronly, h(:)=0; end 85 85 s=max(min((0.1+h).^(1/transparency),1),0); 86 86 elseif strcmpi(colorm,'Seroussi'), 87 transparency=getfieldvalue(options,'alpha',1); 87 88 h=1-(data_grid-data_min)/(data_max-data_min+eps)*0.7; 88 89 if radaronly, h(:)=0; end … … 96 97 error('colormap not supported yet. (''Rignot'' and ''redblue'' are the only cupported colormaps)'); 97 98 end 98 99 99 %(S) Saturation is 0 in NaNs 100 100 s(data_nan)=0; 101 102 101 %(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 106 103 107 104 %Transform HSV to RGB … … 125 122 radar = (md.radaroverlay.pwr).^(contrast); 126 123 radar = radar/max(radar(:)); 127 %pos=find(radar==0); %Change background from black to white128 124 r = image_rgb(:,:,1).*radar; r(data_nan) = radar(data_nan); r(pos) = 1; image_rgb(:,:,1) = r; clear r; 129 125 g = image_rgb(:,:,2).*radar; g(data_nan) = radar(data_nan); g(pos) = 1; image_rgb(:,:,2) = g; clear g; … … 146 142 147 143 %Apply options, without colorbar and without grid 148 options=changefieldvalue(options,'colormap',colorm); %We used an HSV colorbar144 options=changefieldvalue(options,'colormap',colorm); % We used an HSV colorbar 149 145 if ~isnan(data_min), 150 options=changefieldvalue(options,'caxis',[data_min data_max]); % force caxis so that the colorbar is ready146 options=changefieldvalue(options,'caxis',[data_min data_max]); % force caxis so that the colorbar is ready 151 147 end 152 options=addfielddefault(options,'axis','equal off'); %default axis148 options=addfielddefault(options,'axis','equal off'); % default axis 153 149 applyoptions(md,data,options); 154 150 drawnow -
issm/trunk-jpl/src/m/model/plot/subplotmodel.m
r12309 r12399 14 14 hmargin = getfieldvalue(options,'hmargin',[.01 .01]); 15 15 vmargin = getfieldvalue(options,'vmargin',[.01 .01]); 16 17 16 18 17 height = (1-sum(vmargin)-(nlines-1)*gap(1))/nlines;
Note:
See TracChangeset
for help on using the changeset viewer.