Changeset 6286


Ignore:
Timestamp:
10/14/10 09:27:49 (14 years ago)
Author:
Eric.Larour
Message:

screwed matlab goddammit

Location:
issm/trunk/src/m/model
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/model/SectionValues.m

    r5900 r6286  
    8282
    8383        %Interpolation of data on specified points
    84         data_interp=InterpFromMeshToMesh2d(md.elements,md.x,md.y,data,X,Y);
     84        %data_interp=InterpFromMeshToMesh2d(md.elements,md.x,md.y,data,X,Y);
     85        data_interp=griddata(md.x,md.y,data,X,Y);
    8586
    8687        %Compute index
  • issm/trunk/src/m/model/mechanicalproperties.m

    r5433 r6286  
    4848%compute viscosity
    4949nu=zeros(numberofelements,1);
    50 B_bar=md.B(index)*summation/3;
    51 power=(md.n-1)./(2*md.n);
     50B_bar=md.rheology_B(index)*summation/3;
     51power=(md.rheology_n-1)./(2*md.rheology_n);
    5252second_inv=(ux.^2+vy.^2+((uy+vx).^2)/4+ux.*vy);
    5353%some corrections
  • issm/trunk/src/m/model/plot/applyoptions.m

    r6187 r6286  
    191191else
    192192        %do nothing
     193       
    193194end
    194195
  • issm/trunk/src/m/model/plot/plot_manager.m

    r6167 r6286  
    105105                        plot_segments(md,options,subplotwidth,i,data)
    106106                        return
     107               
     108                case 'quiver'
     109                        plot_quiver(md,options,nlines,ncols,i);
     110                        return
     111
    107112                case {'strainrate_tensor','strainrate','strainrate_principal','strainrate_principalaxis1','strainrate_principalaxis2','strainrate_principalaxis3',...
    108113                                'stress_tensor','stress','stress_principal','stress_principalaxis1','stress_principalaxis2','stress_principalaxis3',...
  • issm/trunk/src/m/model/plot/plot_quiver.m

    r2754 r6286  
    1 function plot_quiver(x,y,u,v,options),
     1function plot_quiver(md,options,nlines,ncols,index);
    22%PLOT_QUIVER - quiver plot with colors
    33%
     
    1010%      plot_quiver(md.x,md.y,md.vx,md.vy,options);
    1111
     12%prepare plot
     13subplot(nlines,ncols,index);
     14hold on
     15
     16fields=getfieldvalue(options,'quiver_field',{'vx','vy'});
     17
     18%call fields vx and vy, for ease of use
     19if ischar(fields{1}), vx=md.(fields{1}); else vx=fields{1}; end
     20if ischar(fields{2}), vy=md.(fields{2}); else vy=fields{2}; end
     21
    1222%process fields
    13 [quivers,palette]=quiver_process(x,y,u,v,options);
     23[quivers,palette]=quiver_process(md.x,md.y,vx,vy,options);
    1424
    1525%loop over the number of colors
     
    2535%take care of colorbar
    2636quiver_colorbar(quivers,options);
     37
     38
     39%apply options
     40options=addfielddefault(options,'title','Quiver plot.');
     41options=addfielddefault(options,'colorbar',1);
     42applyoptions(md,[],options);
  • issm/trunk/src/m/model/plot/plot_riftpenetration.m

    r4330 r6286  
    5858                plot(x(md.rifts(i).tips(2)),y(md.rifts(i).tips(2)),'g*');
    5959        end
    60         if isp1 & isp2
    61                 legend([h1,h2,p1,p2],'mesh boundaries','rift tips',' rifts closing','rifts opening')
    62         elseif isp1
    63                 legend([h1,h2,p1],'mesh boundaries','rift tips',' rifts closing')
    64         elseif isp2
    65                 legend([h1,h2,p2],'mesh boundaries','rift tips','rifts opening')
    66         else
    67                 legend([h1,h2],'mesh boundaries','rift tips')
     60        if strcmpi(getfieldvalue(options,'legend','on'),'on'),
     61                if isp1 & isp2
     62                        l=legend([h1,h2,p1,p2],'mesh boundaries','crack tips','faults','rifts');
     63                elseif isp1
     64                        l=legend([h1,h2,p1],'mesh boundaries','crack tips','faults');
     65                elseif isp2
     66                        l=legend([h1,h2,p2],'mesh boundaries','crack tips','rifts');
     67                else
     68                        l=legend([h1,h2],'mesh boundaries','crack tips');
     69                end
     70                set(l,'Location',getfieldvalue(options,'legend_location','NorthEast'));
    6871        end
    6972else
     
    7376
    7477%apply options
    75 options=addfielddefault(options,'title','Rift Penetration');
     78options=addfielddefault(options,'title','Rift/Fault location');
    7679options=addfielddefault(options,'colorbar',0);
    7780applyoptions(md,[],options);
  • issm/trunk/src/m/model/plot/plot_riftrelvel.m

    r5163 r6286  
    6565        segments=md.rifts(i).segments;
    6666        for j=1:size(segments,1),
    67                 plot(x(segments(j,1:2)),y(segments(j,1:2)),'b-');
     67                plot(x(segments(j,1:2)),y(segments(j,1:2)),'k-');
    6868        end
    6969
     
    7676                penetration=(vx2-vx1)*normal(1)+(vy2-vy1)*normal(2);
    7777                %if penetration is negative, plot in black, positive, plot in red;: ie: if rift is closing, black, if rift is opening, red.
    78                 if(penetration>0),
    79                         p2=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'*'); set(p2,'Color',[140 140 140]/255);
    80                         isp2=1;
    81                 else
    82                         p1=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'k*');
    83                         isp1=1;
    84                 end
     78                %if(penetration>0),
     79                %       p2=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'*'); set(p2,'Color',[140 140 140]/255);
     80                %       isp2=1;
     81                %else
     82                %       p1=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'k*');
     83                %       isp1=1;
     84                %end
    8585        end
    8686
    8787        %point out the tips
    88         h2=plot(x(md.rifts(i).tips(1)),y(md.rifts(i).tips(1)),'g*');
    89         plot(x(md.rifts(i).tips(2)),y(md.rifts(i).tips(2)),'g*');
    90         segments=md.rifts(i).segments(:,1:2);
     88        %h2=plot(x(md.rifts(i).tips(1)),y(md.rifts(i).tips(1)),'g*');
     89        %plot(x(md.rifts(i).tips(2)),y(md.rifts(i).tips(2)),'g*');
     90        %segments=md.rifts(i).segments(:,1:2);
    9191end
    9292%legend
    93 if isp1 & isp2
    94         legend([h1,h2,p1,p2],'mesh boundaries','rift tips',' rifts closing','rifts opening')
    95 elseif isp1
    96         legend([h1,h2,p1],'mesh boundaries','rift tips',' rifts closing')
    97 elseif isp2
    98         legend([h1,h2,p2],'mesh boundaries','rift tips','rifts opening')
    99 else
    100         legend([h1,h2],'mesh boundaries','rift tips')
     93if strcmpi(getfieldvalue(options,'legend','on'),'on'),
     94        if isp1 & isp2
     95                l=legend([h1,h2,p1,p2],'mesh boundaries','crack tips','faults','rifts');
     96        elseif isp1
     97                l=legend([h1,h2,p1],'mesh boundaries','crack tips','faults');
     98        elseif isp2
     99                l=legend([h1,h2,p2],'mesh boundaries','crack tips','rifts');
     100        else
     101                l=legend([h1,h2],'mesh boundaries','crack tips');
     102        end
     103set(l,'Location',getfieldvalue(options,'legend_location','NorthEast'));
    101104end
    102105hold off
     106
     107
    103108
    104109%apply options
    105110quiver_colorbar(quivers,options);
    106111options=changefieldvalue(options,'colorbar',2);
    107 options=addfielddefault(options,'title','Rift Relative Velocities');
     112options=addfielddefault(options,'title','Rift/Fault Relative Velocity');
    108113applyoptions(md,[],options);
  • issm/trunk/src/m/model/plot/plotdoc.m

    r6187 r6286  
    5050disp('                  - ''qmustddev'': plot of stddev distribution in sampling analysis with scaled response. needs option qmudata for descriptor');
    5151disp('                  - ''part_hist'': partitioning node and area histogram');
     52disp('                  - ''quiver'': quiver plot. specify quiver fields. ''quiver_field'',{''vx'',''vy''} (default) or ''quiver_field'',{field1,field2}');
    5253
    5354disp('       ''alloptions'': apply the options to all subplots if ''on''');
     
    125126disp('       ''wrapping'': repeat ''n'' times the colormap (''n'' must be an integer)');
    126127disp('       ''unit'': by default, in m, otherwise, ''km'' is available');
     128disp('       ''legend_position'': by default, ''NorthEasth''');
    127129disp('       ''qmudata'': data for qmu  plots.');
    128130disp('                  {dresp1   ,dresp2  ,hmin,hmax,hnint} or {samp,desc,mu,sigma,hmin,hmax,hnint}');
  • issm/trunk/src/m/model/plot/quiver_colorbar.m

    r3202 r6286  
    3434        if exist(options,'colorbartitle'),
    3535                backup=gca;
    36                 axes(hcb);lab=ylabel(getfieldvalue(options,'colorbartitle'));
    37                 set(lab,'Rotation',getfieldvalue(options,'colorbartitlerotation',-90));
     36                axes(hcb);lab=title(getfieldvalue(options,'colorbartitle'));
     37                set(lab,'Rotation',getfieldvalue(options,'colorbartitlerotation',0));
    3838                set(lab,'VerticalAlignment','bottom');
    3939                axes(backup);
  • issm/trunk/src/m/model/radarpower.m

    r6088 r6286  
    2121y0=min(ylim);
    2222y1=max(ylim);
    23 
    24 %Get path  to gdal binaries
    25 path_gdal=[ISSM_TIER '/externalpackages/gdal/install/bin/'];
    26 
    27 %Was gdal compiled?
    28 if ~exist([path_gdal 'gdal_translate']),
    29         error(['radarpower error message: GDAL library needs to be compiled to use this routine. Compile GDAL in ' ISSM_TIER '/externalpackages/gdal to use this routine.']);
    30 end
    3123
    3224%the geotiff image is either 200m or 1km accuracy.
     
    6456        %Name of image
    6557        inputname='./temp.tif';
    66         system([path_gdal 'gdal_translate -quiet -projwin ' num2str(x0) ' ' num2str(y1) ' ' num2str(x1) ' ' num2str(y0) ' ' geotiff_name ' ' inputname ]);
     58        eval(['!gdal_translate -quiet -projwin ' num2str(x0) ' ' num2str(y1) ' ' num2str(x1) ' ' num2str(y0) ' ' geotiff_name ' ' inputname ]);
    6759
    6860        %Read in temp.tif:
Note: See TracChangeset for help on using the changeset viewer.