Changeset 13010
- Timestamp:
- 08/13/12 11:44:01 (13 years ago)
- Location:
- issm/trunk-jpl/src/m
- Files:
-
- 2 added
- 15 deleted
- 10 edited
- 17 copied
- 6 moved
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/exp/expbox.m
r6661 r13010 1 1 function expbox(filename) 2 %EXPBOX - Create a ARGUS file using to clicks2 %EXPBOX - Create an ARGUS file using two clicks 3 3 % 4 4 % Two clicks on a plot are used to generate a rectangular box -
issm/trunk-jpl/src/m/exp/expcircle.m
r12997 r13010 1 function expc reatecircle(filename,x0,y0,radius,numberofnodes)2 %EXPC REATECIRCLE - create a circular contour corresponding to given parameters1 function expcircle(filename,x0,y0,radius,numberofnodes) 2 %EXPCIRCLE - create a circular contour corresponding to given parameters 3 3 % 4 4 % Creates a closed argus contour centered on x,y of radius size. … … 6 6 % 7 7 % Usage: 8 % expc reatecircle(filename,x0,y0,radius,numberofnodes)8 % expcircle(filename,x0,y0,radius,numberofnodes) 9 9 % 10 10 % See also EXPMASTER, EXPDOC -
issm/trunk-jpl/src/m/exp/expcreatecontour.m
r1 r13010 16 16 %Get contour 17 17 disp('Click on contour points you desire. Type RETURN to end input of points'); 18 [x,y]=ginput quick;18 [x,y]=ginput(); 19 19 20 20 %close contour -
issm/trunk-jpl/src/m/exp/expcreateprofile.m
r1 r13010 16 16 %Get profile 17 17 disp('Click on profile points you desire. Type RETURN to end input of points'); 18 [x,y]=ginput quick;18 [x,y]=ginput(); 19 19 20 20 %plot contour -
issm/trunk-jpl/src/m/exp/expexcludeoutliers.m
r7636 r13010 1 1 function excludeoutliers(newcontourname,contourname,domainname) 2 %EXCLUDEOUTLIERS exclude points of contour that are not within the domain contour. return new contours in a different file. 2 %EXCLUDEOUTLIERS - exclude points of contour that are not within the domain 3 %contour. return new contours in a different file. 3 4 % 4 5 % Usage: excludeoutliers('NewContour.exp','Contour.exp','DomainOutline.exp'); -
issm/trunk-jpl/src/m/exp/explink.m
r1 r13010 27 27 end 28 28 end 29 -
issm/trunk-jpl/src/m/exp/expsquare.m
r6661 r13010 1 function exp box(filename)1 function expsquare(filename) 2 2 %EXPBOX - Create a ARGUS file using to clicks 3 3 % 4 % Two clicks on a plot are used to generate a rectangularbox4 % Two clicks on a plot are used to generate a square box 5 5 % This box is written in EXP format on filename 6 6 % … … 18 18 19 19 %Get points 20 disp('Click twice to define a rectangulardomain. First click for upper left corner, second for lower right corner');20 disp('Click twice to define a square domain. First click for upper left corner, second for lower right corner'); 21 21 [x,y]=ginput(2); 22 22 -
issm/trunk-jpl/src/m/exp/expwrite.m
r12997 r13010 17 17 fid=fopen(filename,'w'); 18 18 for n=1:length(a), 19 if(length(contours(n).x)~=length(contours(n).y)), 20 error('contours x and y coordinates must be of identical size'); 21 end 19 22 20 23 if isfield(a,'name'), -
issm/trunk-jpl/src/m/geometry/SegIntersect.m
r4785 r13010 77 77 bool=0; 78 78 return; 79 80 79 end 81 -
issm/trunk-jpl/src/m/interp/InterpFromFile.m
r9734 r13010 43 43 data_out=InterpFromMeshToMesh2d(Data.(Names.indexname),Data.(Names.xname),Data.(Names.yname),Data.(Names.dataname),x,y); 44 44 end 45 46 end 47 function Names=FieldFindVarNames(filename) 48 %FIELDFINDVARNAMES - find names of variables in a data set file 49 % 50 % This routines looks at the variables contained in a file and finds out 51 % the names of the variables that are needed for an interpolation (x,y,data) 52 % or (index,x,y,data) 53 % 54 % Usage: 55 % Names=FieldFindVarNames(filename) 56 % 57 % Example: 58 % Names=FieldFindVarNames('thickness.mat') 59 % 60 % See also: INTERPFROMFILE, GRIDDATA 61 62 %some checks 63 if nargin~=1 | nargout~=1 64 help FieldFindVarNames 65 error('FieldFindVarNames error message: bad usage'); 66 end 67 if ~exist(filename) 68 error(['FieldFindVarNames error message: file ' filename ' does not exist']); 69 end 70 71 %Get variables 72 A=whos('-file',filename); 73 74 %find x,y,vx and vy 75 xenum=NaN; yenum=NaN; dataenum=NaN; indexenum=NaN; 76 if length(A)==3, 77 isnode=1; 78 for i=1:3 79 if strcmpi(A(i).name(1),'x'); 80 xenum=i; 81 elseif strcmpi(A(i).name(1),'y'); 82 yenum=i; 83 elseif (strncmpi(A(i).name,filename,3) | strncmpi(A(i).name,'data',4)), 84 dataenum=i; 85 else 86 %nothing 87 end 88 end 89 elseif length(A)==4, 90 isnode=0; 91 for i=1:4 92 if strcmpi(A(i).name(1),'x'); 93 xenum=i; 94 elseif strcmpi(A(i).name(1),'y'); 95 yenum=i; 96 elseif (strncmpi(A(i).name,'index',5) | strncmpi(A(i).name,'elements',7)); 97 indexenum=i; 98 elseif (strncmpi(A(i).name,filename,3) | strncmpi(A(i).name,'data',4)), 99 dataenum=i; 100 else 101 %nothing 102 end 103 end 104 else 105 error(['FieldFindVarNames error message: file ' filename ' not supported yet (it should hold 3 variables x,y and data (for nodes) OR 4 variables x,y,index and data (for mesh))']); 106 end 107 108 %2: if only one item is missing, find it by elimination 109 if ~isnode, 110 pos=find(isnan([xenum yenum indexenum dataenum])); 111 if length(pos)==1, 112 list=[xenum yenum indexenum dataenum]; list(pos)=[]; 113 if pos==1, 114 xenum=setdiff(1:4,list); 115 elseif pos==2, 116 yenum=setdiff(1:4,list); 117 elseif pos==3, 118 indexenum=setdiff(1:4,list); 119 elseif pos==4, 120 dataenum=setdiff(1:4,list); 121 end 122 end 123 else 124 pos=find(isnan([xenum yenum dataenum])); 125 if length(pos)==1, 126 list=[xenum yenum indexenum dataenum]; list(pos)=[]; 127 if pos==1, 128 xenum=setdiff(1:3,list); 129 elseif pos==2, 130 yenum=setdiff(1:3,list); 131 elseif pos==3, 132 dataenum=setdiff(1:3,list); 133 end 134 end 135 end 136 137 %assum that we have found at least xenum and yenum 138 if ( isnan(xenum) | isnan(yenum)) 139 error(['FieldFindVarNames error message: file ' filename ' not supported yet (the coordinates vectors should be named x and y)']); 140 end 141 142 %find index 143 if (~isnode & isnan(indexenum)), 144 for i=1:4 145 lengthi=min(A(i).size); 146 if (lengthi==3), 147 indexenum=i; 148 end 149 end 150 if isnan(indexenum), 151 error(['FieldFindVarNames error message: file ' filename ' not supported yet (index not found)']); 152 end 153 end 154 155 %4: last chance 156 if ~isnode, 157 pos=find(isnan([xenum yenum indexenum dataenum])); 158 if length(pos)==1, 159 list=[xenum yenum indexenum dataenum]; list(pos)=[]; 160 if pos==1, 161 xenum=setdiff(1:4,list); 162 elseif pos==2, 163 yenum=setdiff(1:4,list); 164 elseif pos==3, 165 indexenum=setdiff(1:4,list); 166 elseif pos==4, 167 dataenum=setdiff(1:4,list); 168 end 169 end 170 else 171 pos=find(isnan([xenum yenum dataenum])); 172 if length(pos)==1, 173 list=[xenum yenum indexenum dataenum]; list(pos)=[]; 174 if pos==1, 175 xenum=setdiff(1:3,list); 176 elseif pos==2, 177 yenum=setdiff(1:3,list); 178 elseif pos==3, 179 dataenum=setdiff(1:3,list); 180 end 181 end 182 end 183 184 %last check 185 if isnan(dataenum) 186 error(['FieldFindVarNames error message: file ' filename ' not supported yet (data not found)']); 187 end 188 189 %create output 190 Names=struct(); 191 Names.xname=A(xenum).name; 192 Names.yname=A(yenum).name; 193 Names.dataname=A(dataenum).name; 194 if ~isnode, 195 Names.indexname=A(indexenum).name; 196 Names.interp='mesh'; 197 else 198 Names.interp='node'; 199 end 200 end -
issm/trunk-jpl/src/m/interp/plugvelocities.m
r10165 r13010 14 14 % See also: INTERPFROMFILE, GRIDDATA 15 15 16 disp('WARNING: deprecated functions (plugvelocities)'); 16 17 %some checks 17 18 if nargin~=3 | nargout~=1 … … 40 41 md.initialization.vy=md.inversion.vy_obs; 41 42 md.initialization.vel=md.inversion.vel_obs; 43 end 44 45 function Names=VelFindVarNames(filename) 46 %VELFINDVARNAMES - find names of variables in a velocity data set file 47 % 48 % This routines looks at the variables contained in a file and finds out 49 % the names of the variables that are needed for an interpolation (x,y,vx,vy) 50 % or (index,x,y,vx,vy) 51 % 52 % Usage: 53 % Names=VelFindVarNames(filename) 54 % 55 % Example: 56 % Names=VelFindVarNames('velocities.mat') 57 % 58 % See also: INTERPFROMFILE, GRIDDATA 59 60 %some checks 61 if nargin~=1 | nargout~=1 62 help VelFindVarNames 63 error('VelFindVarNames error message: bad usage'); 64 end 65 if ~exist(filename) 66 error(['VelFindVarNames error message: file ' filename ' does not exist']); 67 end 68 69 %Get variables 70 A=whos('-file',filename); 71 72 %find x,y,vx and vy 73 xenum=NaN; yenum=NaN; vxenum=NaN; vyenum=NaN; indexenum=NaN; 74 if length(A)==4, 75 isnode=1; 76 for i=1:4 77 if strcmpi(A(i).name(1),'x'); 78 xenum=i; 79 elseif strcmpi(A(i).name(1),'y'); 80 yenum=i; 81 else 82 if (strcmpi(A(i).name(end),'x') | strncmpi(A(i).name,'vx',2)); 83 vxenum=i; 84 elseif (strcmpi(A(i).name(end),'y') | strncmpi(A(i).name,'vy',2)); 85 vyenum=i; 86 end 87 end 88 end 89 elseif length(A)==5, 90 isnode=0; 91 for i=1:5 92 if strcmpi(A(i).name(1),'x'); 93 xenum=i; 94 elseif strcmpi(A(i).name(1),'y'); 95 yenum=i; 96 elseif (strcmpi(A(i).name(1),'index') | strcmpi(A(i).name(1),'elements')); 97 indexenum=i; 98 else 99 if (strcmpi(A(i).name(end),'x') | strncmpi(A(i).name,'vx',2)); 100 vxenum=i; 101 elseif (strcmpi(A(i).name(end),'y') | strncmpi(A(i).name,'vy',2)); 102 vyenum=i; 103 end 104 end 105 end 106 else 107 error(['VelFindVarNames error message: file ' filename ' not supported yet (it should hold 4 variables x,y,vx and vy (for nodes) OR 5 variables x,y,index,vx and vy (for mesh))']); 108 end 109 110 %assum that we have found at least vxenum and vyenum 111 if ( isnan(vxenum) | isnan(vyenum)) 112 error(['VelFindVarNames error message: file ' filename ' not supported yet (the velocities should be named vx and vy)']); 113 end 114 115 %find index 116 if (~isnode & isnan(indexenum)), 117 for i=1:5 118 lengthi=min(A(i).size); 119 if (lengthi==3), 120 indexenum=i; 121 end 122 end 123 if isnan(indexenum), 124 error(['VelFindVarNames error message: file ' filename ' not supported yet (index not found)']); 125 end 126 end 127 128 %find x y 129 if (isnan(xenum) | isnan(yenum)) 130 131 %check the size 132 if A(vxenum).size(1)==A(vxenum).size(2), 133 error(['VelFindVarNames error message: file ' filename ' not supported (velocities is a square matrix, save x and y with another name)']); 134 end 135 if ~(A(vxenum).size(1)==A(vyenum).size(1) & A(vxenum).size(2)==A(vyenum).size(2)), 136 error(['VelFindVarNames error message: file ' filename ' not supported (vx and vy matrices do not have the same size)']); 137 end 138 139 %find xenum and yenum 140 for i=1:4 141 lengthi=max(A(i).size); 142 if ((i~=vxenum) & (lengthi==A(vxenum).size(1) | lengthi==A(vxenum).size(1)+1)), 143 yenum=i; 144 elseif ((i~=vxenum) & (lengthi==A(vxenum).size(2) | lengthi==A(vxenum).size(2)+1)), 145 xenum=i; 146 end 147 end 148 149 %last check 150 if (isnan(xenum) | isnan(yenum)) 151 error(['plugdata error message: file ' filename ' not supported yet']); 152 end 153 end 154 155 %create output 156 Names=struct(); 157 Names.xname=A(xenum).name; 158 Names.yname=A(yenum).name; 159 Names.vxname=A(vxenum).name; 160 Names.vyname=A(vyenum).name; 161 if ~isnode, 162 Names.indexname=A(indexenum).name; 163 Names.interp='mesh'; 164 else 165 Names.interp='node'; 166 end -
issm/trunk-jpl/src/m/mesh/roundmesh.m
r11011 r13010 20 20 y_list=radius*y_list.*sin(theta); 21 21 A=struct('x',x_list,'y',y_list,'density',1); 22 exp gen('RoundDomainOutline.exp',A,1);22 expwrite('RoundDomainOutline.exp',A); 23 23 24 24 %Call Bamg -
issm/trunk-jpl/src/m/regional/isbasin.m
r12997 r13010 7 7 % 8 8 9 10 9 %First, load basin names: 11 10 load([jplsvn '/projects/ModelData/Names/Names.mat']); 12 13 11 14 12 %go through names:
Note:
See TracChangeset
for help on using the changeset viewer.