source:
issm/oecreview/Archive/12321-12677/ISSM-12373-12374.diff
Last change on this file was 12679, checked in by , 13 years ago | |
---|---|
File size: 4.9 KB |
-
u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_manager.m
167 167 return; 168 168 end 169 169 170 %Figure out if this is a Profile plot 171 if exist(options,'profile') 172 plot_profile(md,data,options,nlines,ncols,i); 173 return; 174 end 175 170 176 %process data and model 171 177 [x y z elements is2d isplanet]=processmesh(md,data,options); 172 178 [data2 datatype]=processdata(md,data,options); -
u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plot_profile.m
1 function plot_profile(md,data,options,nlines,ncols,i) 2 %PLOT_SECTION - plot a given field on a profile 3 % 4 % Usage: 5 % plot_profile(md,data,options,nlines,ncols,i) 6 % 7 % See also: PLOTMODEL 8 9 %process model 10 [x_m y_m z_m elements_m is2d isplanet]=processmesh(md,[],options); 11 if ~is2d, error('only 3d model supported'); end 12 13 %Get number of curves and generate random colors 14 numcurves=size(data,2); 15 colorm=getfieldvalue(options,'colormap','lines'); 16 color=eval([ colorm '(numcurves);']); 17 options=removefield(options,'colormap',0); %back to default colormap 18 19 %Loop over number of curves 20 for i=1:numcurves, 21 22 %Process data 23 [datai datatype]=processdata(md,data(:,i),options); 24 25 %resolution 26 if exist(options,'resolution'), 27 resolution=getfieldvalue(options,'resolution'); 28 else %Default resolution 29 resolution=[100]; 30 disp(['plot_profile warning: no resolution specified, use default resolution: [horizontal_resolution vertical_resolution]=[' num2str(resolution) ']']); 31 end 32 33 %Compute profile value 34 [z,data_interp]=ProfileValues(md,data,xprof,yprof,resolution) 35 36 %plot profile 37 subplot(nlines,ncols,i) 38 A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); 39 plot(data_interp,z,'color',color(i,:),'LineWidth',getfieldvalue(options,'linewidth',1)); 40 hold on; 41 end 42 43 %apply options 44 options=addfielddefault(options,'title','Profile'); 45 options=addfielddefault(options,'colorbar',0); 46 options=addfielddefault(options,'ylabel','z'); 47 applyoptions(md,[],options); -
u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/plot/plotdoc.m
93 93 disp(' horizontal_resolution must be in meter, and vertical_resolution a number of layers'); 94 94 disp(' ''showsection'': show section used by ''sectionvalue'' (string ''on'' or a number of labels)'); 95 95 disp(' ''sectionvalue'': give the value of data on a profile given by an Argus file (string ''Argusfile_name.exp'')'); 96 disp(' ''profile'': give the value of data along a vertical profile ([xlocation ylocation])'); 96 97 disp(' ''smooth'': smooth element data (string ''yes'' or integer)'); 97 98 disp(' ''title'': same as standard matlab option'); 98 99 disp(' ''view'': same as standard matlab option (ex: 2, 3 or [90 180]'); -
u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/model/ProfileValues.m
1 function [Z,data_interp]=ProfileValues(md,data,xprof,yprof,resolution) 2 %PROFILEVALUES - compute the value of a field on a vertical profile 3 % 4 % This routine gets the value of a given field of the model on points 5 % given by filname (Argus type file) 6 % 7 % Usage: 8 % [z,data]=ProfileValues(md,data,filename,resolution) 9 % [z,data]=ProfileValues(md,data,profile_structure,resolution) 10 11 %Get bed and surface for each 2d point, offset to make sure that it is inside the glacier system 12 offset=10^-3; 13 bed=InterpFromMeshToMesh2d(md.mesh.elements2d,md.mesh.x2d,md.mesh.y2d,project2d(md,md.geometry.bed,1),xprof,yprof)+offset; 14 surface=InterpFromMeshToMesh2d(md.mesh.elements2d,md.mesh.x2d,md.mesh.y2d,project2d(md,md.geometry.surface,1),xprof,yprof)-offset; 15 16 %Some useful parameters 17 layers=ceil(mean(md.geometry.thickness)/res_v); 18 Z=bed:resolution:surface; 19 X=xprof*ones(size(Z)); 20 Y=yprof*ones(size(Z)); 21 data_interp=InterpFromMeshToMesh3d(md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.z,data,X,Y,Z,NaN);
Note:
See TracBrowser
for help on using the repository browser.