Changeset 3293
- Timestamp:
- 03/16/10 15:49:01 (15 years ago)
- Location:
- issm/trunk/src/m/classes/public
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/classes/public/bamg.m
r3277 r3293 194 194 if (~exist(options,'domain') & md.numberofgrids~=0 & strcmpi(md.type,'2d')), 195 195 196 if isstruct(md.bamg), %TEST196 if isstruct(md.bamg), 197 197 bamg_mesh=bamgmesh(md.bamg.mesh); 198 198 else -
issm/trunk/src/m/classes/public/plot/checkplotoptions.m
r2828 r3293 61 61 end 62 62 end 63 64 63 65 64 %Colorbar; … … 201 200 end 202 201 end 202 203 %Log scale (LOTS of changes to be performed 204 if exist(options,'log'), 205 if exist(options,'caxis') 206 options=changefieldvalue(options,'caxis',log(getfieldvalueerr(options,'caxis'))/log(getfieldvalueerr(options,'log'))); 207 end 208 options=changefieldvalue(options,'cutoff',log(getfieldvalue(options,'cutoff',1.5))/log(getfieldvalueerr(options,'log'))); 209 end -
issm/trunk/src/m/classes/public/plot/plot_overlay.m
r3174 r3293 19 19 end 20 20 21 %get xlim and ylim 22 xlim=getfieldvalue(options,'xlim',[min(x) max(x)])/getfieldvalue(options,'unit',1); 23 ylim=getfieldvalue(options,'ylim',[min(y) max(y)])/getfieldvalue(options,'unit',1); 24 25 %radar power 21 % radar power {{{1 26 22 if ~any(isnan(md.sarxm)) & ~any(isnan(md.sarym)) & ~any(isnan(md.sarpwr)), 27 23 disp('plot_overlay info: the radar image held by the model is being used'); 28 24 else 29 25 t1=clock; fprintf('%s','Extracting radar image...'); 26 xlim=getfieldvalue(options,'xlim',[min(x) max(x)])/getfieldvalue(options,'unit',1); 27 ylim=getfieldvalue(options,'ylim',[min(y) max(y)])/getfieldvalue(options,'unit',1); 30 28 md=radarpower(md,getfieldvalue(options,'hem','s'),xlim,ylim,getfieldvalue(options,'highres',0)); 31 29 t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']); 32 end 30 end%}}} 33 31 34 35 xlim=getfieldvalue(options,'xlim',[min(x) max(x)]); 36 ylim=getfieldvalue(options,'ylim',[min(y) max(y)]); 37 38 %mesh2grid 32 % InterpFromMeshToGrid -> data_grid {{{1 39 33 redo=1; 40 34 if (ischar(data) & isstruct(md.mesh2grid_parameters) & ismember(data,mesh2grid_parameters)), … … 57 51 58 52 %use InterpFromMeshToGrid to get an gridded data to display using imagesc 53 xlim=getfieldvalue(options,'xlim',[min(x) max(x)]); 54 ylim=getfieldvalue(options,'ylim',[min(y) max(y)]); 59 55 cornereast =min(xlim); 60 56 cornernorth=max(ylim); … … 66 62 [x_m y_m data_grid]=InterpFromMeshToGrid(elements,x,y,data,cornereast,cornernorth,xspacing,yspacing,nlines,ncols,0); 67 63 t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']); 68 end 64 end%}}} 69 65 70 %Ok, we have two images, double format: 71 radar=md.sarpwr; 66 %Generate RGB image{{{1 72 67 73 68 %Build hsv color image from radar and results 69 radar=md.sarpwr; 74 70 transparency=getfieldvalue(options,'alpha',1.5); %Rignot's setting: 1.5 75 border=getfieldvalue(options,'border',0); 71 cutoff=getfieldvalue(options,'cutoff',1.5); %Rignot's setting: 1.5 76 72 77 73 %intensity 78 v=radar/max(radar(:)); 74 v_data=radar/max(radar(:)); %For the principla image, use radar power as intensity 75 v_coba=ones(256,1); %For the colorbar: maximal intensity 79 76 80 77 %hue 81 %cut results under 1.5, and log 82 data_grid(find(data_grid<1.5))=1.5; 83 h=bytscl(log(data_grid))/(255+1); %1 offset on colormap 78 data_coba=linspace(min(data),max(data),256);%prepare colorbar (256 values between min and max) 79 data_grid(find(data_grid<cutoff))=cutoff; %cut all values below cutoff 80 data_coba(find(data_grid<cutoff))=cutoff; %cut all values below cutoff 81 h_data=bytscl(data_grid)/(255+1); %scale between 0 and 1 (log applied in processdata) 82 h_coba=bytscl(data_coba)/(255+1); %scale between 0 and 1 84 83 85 84 %saturation 86 s=(0.5+data_grid/125)/transparency;s(find(s>1))=1;s(find(s<0))=0; 87 s(find(data_grid==1.5))=0; 88 89 %Include border 90 %v((1:border),:)=0; v((end-border+1:end),:)=0; v(:,1:border)=0;v(:,(end-border+1:end))=0; 85 s_data=(0.5+10.^data_grid/125)/transparency;s_data(find(s_data>1))=1;s_data(find(s_data<0))=0; 86 s_coba=(0.5+10.^data_coba/125)/transparency;s_coba(find(s_coba>1))=1;s_coba(find(s_coba<0))=0; 87 s_data(find(data_grid==cutoff))=0; 88 s_coba(find(data_coba==cutoff))=0; 91 89 92 90 %Transform hsv to rgb 93 91 image_hsv=zeros(size(data_grid,1),size(data_grid,2),3); 94 image_hsv(:,:,1)=h ;95 image_hsv(:,:,2)=s ;96 image_hsv(:,:,3)=v ;92 image_hsv(:,:,1)=h_data; 93 image_hsv(:,:,2)=s_data; 94 image_hsv(:,:,3)=v_data; 97 95 image_rgb=hsv2rgb(image_hsv); 96 colorbar_hsv=zeros(size(data_coba,2),size(data_coba,1),3); 97 colorbar_hsv(:,:,1)=h_coba; 98 colorbar_hsv(:,:,2)=s_coba; 99 colorbar_hsv(:,:,3)=v_coba; 100 colorbar_rgb=hsv2rgb(colorbar_hsv); 101 %}}} 98 102 99 103 %Select plot area … … 113 117 end 114 118 119 %Apply options {{{1 115 120 %Apply options, without colorbar and without grid 116 121 iscolorbar=getfieldvalue(options,'colorbar',1); … … 124 129 125 130 %create colorbar with correct colors and position 126 colorbar_rgb=buildoverlaycolorbar(md,data,getfieldvalue(options,'aplha',1.5));131 %colorbar_rgb=buildoverlaycolorbar(md,data,getfieldvalue(options,'aplha',1.5)); 127 132 colorbar_handle=colorbar; 128 133 colorbar_image_handle=get(colorbar_handle,'Children'); … … 136 141 137 142 scalestring=[]; 138 scaleminmax=[max(min(data), 1.5) max(data)];143 scaleminmax=[max(min(data),cutoff) max(data)]; 139 144 for i=1:numvalues, 140 145 fraction=(i-1)/(numvalues-1); 141 146 scalevalues(i)=round_ice(scaleminmax(1)+(scaleminmax(2)-scaleminmax(1))*fraction,2); 142 scalestring=[scalestring; sprintf('%8.4g',scalevalues(i))]; 147 if exist(options,'log'), 148 logvalue=getfieldvalue(options,'log'); 149 scalestring=[scalestring; sprintf('%8.4g',logvalue^scalevalues(i))]; 150 else 151 scalestring=[scalestring; sprintf('%8.4g',scalevalues(i))]; 152 end 143 153 end 144 154 set(colorbar_handle,'YTickLabel',scalestring); 145 155 set(colorbar_handle,'YColor','y'); 146 end 156 end%}}} -
issm/trunk/src/m/classes/public/plot/plotdoc.m
r3163 r3293 92 92 disp(' ''yticklabel'': specifiy yticklabel'); 93 93 disp(' ''overlay'': yes or no. This will overlay a radar amplitude image behind'); 94 disp(' ''cutoff'': all values below cutoff will be taken as cutoff (default is 1.5)'); 94 95 disp(' ''highres'': resolution of overlayed radar amplitude image (default is 0, high resolution is 1).'); 95 96 disp(' ''hem'': specify hemisphere ''n'' or ''s'' (default is ''s'').');
Note:
See TracChangeset
for help on using the changeset viewer.