diff --git a/africa.m b/africa.m deleted file mode 100644 index 5892da2..0000000 --- a/africa.m +++ /dev/null @@ -1,41 +0,0 @@ -function varargout=africa(res,buf) -% XY=AFRICA(res,buf) -% AFRICA(...) % Only makes a plot -% -% Finds the coordinates of Africa, potentially buffered by some amount. -% -% INPUT: -% -% res 0 The standard, default values -% N Splined values at N times the resolution -% buf Distance in degrees that the region outline will be enlarged -% by BUFFERM, not necessarily integer, possibly negative -% [default: 0] -% -% OUTPUT: -% -% XY Closed-curved coordinates of the continent -% -% Last modified by charig-at-princeton.edu, 11/23/2011 -% Last modified by fjsimons-at-alum.mit.edu, 11/23/2011 - -defval('res',0) -defval('buf',0) - -% Parameters that make this the region in question -regn='africa'; -c11=[0 37.5 ; 342.5 36.5]; -cmn=[52 -35 ; 360 3.5]; -xunt=[261:307 110:260 339:399]; -ofs=[360 0]; - -% Do it! Make it, load it, save it -XY=regselect(regn,c11,cmn,xunt,res,buf,ofs); - -if nargout==0 - plot(XY(:,1),XY(:,2),'k-'); axis image; grid on -end - -% Prepare optional output -varns={XY}; -varargout=varns(1:nargout); diff --git a/alloceans.m b/alloceans.m deleted file mode 100644 index adee32b..0000000 --- a/alloceans.m +++ /dev/null @@ -1,115 +0,0 @@ -function varargout=alloceans(res) -% XY=ALLOCEANS(res) -% ALLOCEANS(...) % Only makes a plot -% -% Finds the coordinates of some of the worlds' oceans so we can combine -% its localization kernel with those for the missing continents to turn -% into Slepian eigenfunctions for all of the world's oceans. Also, there -% is a polar gap taken out. -% -% INPUT: -% -% res 0 The standard, default values -% N Splined values at N times the resolution -% inclang Inclination angle, determines size of polar caps -% -% OUTPUT: -% -% XY Closed-curved coordinates of the world's ocean -% -% SEE ALSO: EQBAND -% -% Written by D.C. Slobbe, 21/10/2010 -% Last modified by fjsimons-at-alum.mit.edu, 10/08/2011 - -defval('res',0) -defval('inclang',66.15); - -if res==0 - fnpl=fullfile(getenv('IFILES'),'COASTS','alloceans.mat'); -else - fnpl=fullfile(getenv('IFILES'),'COASTS',sprintf('alloceans-%i.mat',res)); -end - -if exist(fnpl,'file')==2 - load(fnpl) - if nargout==0 - plot(XY(:,1),XY(:,2),'k-'); axis equal; grid on - else - varns={XY}; - varargout=varns(1:nargout); - end -else - if res==0 - ShftAngl = 180; - XYbos = eqband(0,inclang); - XYbos(:,1) = XYbos(:,1)-360-ShftAngl; - - XY_NA = namerica(0); - XY_NA(:,1) = XY_NA(:,1)-360; - - XY_GR = greenland(0); - XY_GR(:,1) = XY_GR(:,1)-360; - - XY_EA = eurasia(0); - XY_EA(:,1) = XY_EA(:,1)-360; - - % Antarctica receives special treatment - clf - [~,handl,XYant]=plotcont([0 -62],[360 -83],[],0); - delete(handl) - - % Get rid of common NaNs - XYant = XYant(~isnan(XYant(:,1)) & ~isnan(XYant(:,2)),:); - - % Form closed contour - XYant = XYant(~isnan(XYant(:,1)) & ~isnan(XYant(:,2)),:); - XYant = [[0,-90];[0,XYant(227,2)];... - XYant([231:end,1:227],:);[360,-90];[0,-90]]; - [XY_NA(:,1),XY_NA(:,2)] = poly2cw(XY_NA(:,1), XY_NA(:,2)); - [XY_GR(:,1),XY_GR(:,2)] = poly2cw(XY_GR(:,1), XY_GR(:,2)); - [XY_EA(:,1),XY_EA(:,2)] = poly2cw(XY_EA(:,1), XY_EA(:,2)); - [XYant(:,1),XYant(:,2)] = poly2cw(XYant(:,1), XYant(:,2)); - - % Now combine these into an overall interior coastline - warning off map:vectorsToGPC:noExternalContours - [Xu,Yu]=polybool('subtraction',XYbos(:,1),XYbos(:,2),... - XY_NA(:,1),XY_NA(:,2)); ... - [Xu,Yu]=polybool('subtraction',Xu,Yu,XY_GR(:,1),XY_GR(:,2)); - [Xu,Yu]=polybool('subtraction',Xu,Yu,XYant(:,1),XYant(:,2)); - [Xu,Yu]=polybool('subtraction',Xu,Yu,XY_EA(:,1),XY_EA(:,2)); - % Make sure you get both pieces - XY_EA(:,1)=XY_EA(:,1)-360; - [Xu,Yu]= polybool('subtraction',Xu,Yu,XY_EA(:,1),XY_EA(:,2)); - XYant(:,1)=XYant(:,1)-360; - [Xu,Yu]=polybool('subtraction',Xu,Yu,XYant(:,1),XYant(:,2)); - XY=[Xu,Yu]; - warning on map:vectorsToGPC:noExternalContours - - % This should be done manually - StrtIndpol = [0;find(isnan(XY(:,1)));length(XY(:,1))+1]; - [~,maxdi] = max(diff(StrtIndpol)); - XY = [XY(StrtIndpol(maxdi)+1:StrtIndpol(maxdi+1)-1,:)]; - [LATo,LONo] = interpm(XY(:,2),XY(:,1),0.25); - XY = [LONo,LATo]; - - XY(:,1) = XY(:,1)+360; - - % Eyeball - plot(XY(:,1),XY(:,2),'LineW',2,'Color','k'); - axis equal - - % Check this out %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - curvecheck(XY(:,1),XY(:,2)) - - % Check this out %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - save(fnpl,'XY') - else - XY=alloceans(0); - XYb=bezier(XY,res); - XY=XYb; - save(fnpl,'XY') - end - varns={XY}; - varargout=varns(1:nargout); -end diff --git a/amazon.m b/amazon.m deleted file mode 100644 index 5e511e3..0000000 --- a/amazon.m +++ /dev/null @@ -1,44 +0,0 @@ -function varargout=amazon(res,buf) -% XY=AMAZON(res,buf) -% AMAZON(...) % Only makes a plot -% -% Finds the coordinates of Amazon, potentially buffered by some amount. -% -% INPUT: -% -% res 0 The standard, default values -% N Splined values at N times the resolution -% buf Distance in degrees that the region outline will be enlarged -% by BUFFERM, not necessarily integer, possibly negative -% [default: 0] -% -% OUTPUT: -% -% XY Closed-curved coordinates of the continent -% -% Last modified by charig-at-princeton.edu, 11/23/2011 -% Last modified by fjsimons-at-alum.mit.edu, 11/23/2011 - -defval('res',0) -defval('buf',0) - -% Parameters that make this the region in question -regn='amazon'; -c11=[280 5]; -cmn=[310 -25]; -xunt=[]; - -% This admittedly is a special case -XY=load(fullfile(getenv('IFILES'),'COASTS','amazon')); - -% Do it! Make it, load it, save it -XY=regselect(regn,XY(:,1),XY(:,2),xunt,res,buf); - -if nargout==0 - plot(XY(:,1),XY(:,2),'k-'); axis image; grid on -end - -% Prepare optional output -varns={XY}; -varargout=varns(1:nargout); - diff --git a/antarctica.m b/antarctica.m deleted file mode 100644 index 20fa2cd..0000000 --- a/antarctica.m +++ /dev/null @@ -1,86 +0,0 @@ -function varargout=antarctica(res,buf,rotb) -% [XY,lonc,latc]=antarctica(res,buf,rotb) -% ANTARCTICA(...) % Only makes a plot -% -% Finds the coordinates of Antarctica, but rotates them to an equatorial -% location so KERNELC doesn't choke on the calculation. -% -% INPUT: -% -% res 0 The standard, default values -% N Splined values at N times the resolution -% 'rotated' to determine if this region is rotated (it is). We -% use this in e.g. GLMALPHA to determine whether to rotate the -% eigenfunctions after finding them. You get a logical as output. -% buf Distance in degrees by which the region outline will be enlarged -% by BUFFERM, not necessarily integer, possibly negative -% [default: 0] -% rotb 0 You want the coordinates on the equator for mathematical -% operations (e.g. you need to make a kernel) [default] -% 1 You want the coordinates rotated back to their original -% location (e.g. for plotting) -% -% OUTPUT: -% -% XY Closed-curved coordinates of the continent -% lonc The amount by which you need to rotate it back over z -% latc The amount by which you need to rotate it back over y -% -% See also PLM2ROT, GEOBOXCAP, KLMLMP2ROT, GLMALPHA -% -% Last modified by charig@princeton.edu, 06/24/2016 -% Last modified by fjsimons@princeton.edu, 07/01/2016 - -defval('res',0) -defval('buf',0) -defval('rotb',0) - -if ~isstr(res) - - % Some setup - c11=[0 -62]; - cmn=[360 -83]; - - % Do it! Make it, load it, save it - XY=regselect('antarctica',c11,cmn,[],res,buf); - - % Do some extra here to get the lonc latc - [~,~,XY2]=plotcont(c11(:),cmn(:),[],0); - close - % Get rid of common NaNs - XY2=XY2(~isnan(XY2(:,1)) & ~isnan(XY2(:,2)),:); - % Get rid of common NaNs - XY2=XY2(~isnan(XY2(:,1)) & ~isnan(XY2(:,2)),:); - % Find the geographical center and the area to use for rotation - % Note: this is based on the unbuffered region and does not change - [lonc,latc,A]=rcenter([XY2(:,1) XY2(:,2)]); - lonc=-45; - - % Do we return rotated coordinates? - if rotb==1 - [thetap,phip,rotmats]=rottp((90-XY(:,2))*pi/180,XY(:,1)/180*pi,... - -lonc*pi/180,latc*pi/180,0); - XY = [phip*180/pi 90-thetap*180/pi]; - end - - % Make sure the coordinates make sense - XY(:,1)=XY(:,1)-360*[XY(:,1)>360]; - XY(:,1)=XY(:,1)+360*[XY(:,1)<0]; - - % Prepare Output - varns={XY,lonc,latc}; - varargout=varns(1:nargout); - -elseif strcmp(res,'rotated') - % Return a 1 flag as output, indicating the region is a rotated region - varargout={1}; -elseif strcmp(res,'demo1') - % Make a simple plot - XY=antarctica(); - plot(XY(:,1),XY(:,2),'k-'); axis equal; grid on - axis([-30-lonc 30-lonc -30 20]) -end - - - - diff --git a/australia.m b/australia.m deleted file mode 100644 index 21d4bb6..0000000 --- a/australia.m +++ /dev/null @@ -1,40 +0,0 @@ -function varargout=australia(res,buf) -% XY=AUSTRALIA(res,buf) -% AUSTRALIA(...) % Only makes a plot -% -% Finds the coordinates of Australia, potentially buffered by some amount. -% -% INPUT: -% -% res 0 The standard, default values -% N Splined values at N times the resolution -% buf Distance in degrees that the region outline will be enlarged -% by BUFFERM, not necessarily integer, possibly negative -% [default: 0] -% -% OUTPUT: -% -% XY Closed-curved coordinates of the continent -% -% Last modified by charig-at-princeton.edu, 11/23/2011 -% Last modified by fjsimons-at-alum.mit.edu, 11/23/2011 - -defval('res',0) -defval('buf',0) - -% Parameters that make this the region in question -regn='australia'; -c11=[112 -10.5]; -cmn=[154 -39]; -xunt=2:166; - -% Do it! Make it, load it, save it -XY=regselect(regn,c11,cmn,xunt,res,buf); - -if nargout==0 - plot(XY(:,1),XY(:,2),'k-'); axis image; grid on -end - -% Prepare optional output -varns={XY}; -varargout=varns(1:nargout); diff --git a/baffin.m b/baffin.m deleted file mode 100644 index 57720ad..0000000 --- a/baffin.m +++ /dev/null @@ -1,39 +0,0 @@ -function varargout=baffin(res,buf) -% XY=baffin(res,buf) -% baffin(...) % Only makes a plot -% -% Finds the coordinates of Baffin Island, potentially buffered by some amount. -% -% INPUT: -% -% res 0 The standard, default values -% N Splined values at N times the resolution -% buf Distance in degrees that the region outline will be enlarged -% by BUFFERM, not necessarily integer, possibly negative -% [default: 0] -% -% OUTPUT: -% -% XY Closed-curved coordinates of the continent -% -% Last modified by fjsimons-at-alum.mit.edu, 09/23/2014 - -defval('res',0) -defval('buf',0) - -% Parameters that make this the region in question -regn='baffin'; -c11=[270 77]; -cmn=[300 58]; -xunt=[14:107]; - -% Do it! Make it, load it, save it -XY=regselect(regn,c11,cmn,xunt,res,buf); - -if nargout==0 - plot(XY(:,1),XY(:,2),'k-'); axis equal; grid on -end - -% Prepare optional output -varns={XY}; -varargout=varns(1:nargout); diff --git a/borneo.m b/borneo.m deleted file mode 100644 index 782b67f..0000000 --- a/borneo.m +++ /dev/null @@ -1,42 +0,0 @@ -function varargout=borneo(res,buf) -% XY=BORNEO(res,buf) -% BORNEO(...) % Only makes a plot -% -% Finds the coordinates of Borneo, potentially buffered by -% some amount. -% -% INPUT: -% -% res 0 The standard, default values -% N Splined values at N times the resolution -% buf Distance in degrees that the region outline will be enlarged -% by BUFFERM, not necessarily integer, possibly negative -% [default: 0] -% -% OUTPUT: -% -% XY Closed-curved coordinates of the island -% -% Last modified by fjsimons-at-alum.mit.edu, 09/24/2014 - -defval('res',0) -defval('buf',0) - -% Parameters that make this the region in question -regn='borneo'; -c11=[108 9]; -cmn=[120 -5]; -xunt=[12:57]; -ofs=0; - -% Do it! Make it, load it, save it -XY=regselect(regn,c11,cmn,xunt,res,buf,ofs); - -if nargout==0 - plot(XY(:,1),XY(:,2),'k-'); axis image; grid on -end - -% Prepare optional output -varns={XY}; -varargout=varns(1:nargout); - diff --git a/contshelves.m b/contshelves.m deleted file mode 100644 index 1c00cbc..0000000 --- a/contshelves.m +++ /dev/null @@ -1,122 +0,0 @@ -function varargout=contshelves(res,rotb) -% [XY,lonc,latc]=CONTSHELVES(res,rotb) -% CONTSHELVES(...) % Only makes a plot -% -% Finds the coordinates of the continental lithosphere and rotates those -% away from the poles so KERNELC doesn't choke on the calculation. -% -% INPUT: -% -% res 0 The standard, default values, -% N Splined values at N times the resolution, -% 'rotated' to determine if this region is rotated (it is). We -% use this in e.g. GLMALPHA to determine whether to rotate the -% eigenfunctions after finding them. You get a logical as output. -% rotb 0 The rotated version [default] needed by e.g. KERNELCP -% 1 The unrotated version suitable for geographic plots -% -% OUTPUT: -% -% XY Closed-curved coordinates of the continental shelves, two -% closed curves separated by a row of NaNs. -% lonc The amount by which you need to rotate it back over z -% latc The amount by which you need to rotate it back over y -% -% Written by Jarno Saarimaki and Ciaran Beggan, 2011 -% Last modified by fjsimons-at-alum.mit.edu, 07/12/2012 -% Last modified by charig-at-princeton.edu, 06/27/2016 - -defval('res',0) -defval('rotb',0) - -if ~isstr(res) - - % The directory where you keep the coordinates - whereitsat=fullfile(getenv('IFILES'),'COASTS'); - - if res==0 - fnpl=fullfile(whereitsat,'ContShelves.mat'); - else - fnpl=fullfile(whereitsat,sprintf('ContShelves-%i.mat',res)); - end - - if rotb==1 - XY=load(fullfile(whereitsat,'ContShelves.txt')); - XY(:,1)=XY(:,1)+[XY(:,1)<0]*360; - [X,Y]=penlift(XY(:,1),XY(:,2)); - XY=[X Y]; - end - - if exist(fnpl,'file')==2 - if rotb==0; load(fnpl); end - if nargout==0 - plot(XY(:,1),XY(:,2),'k-'); axis equal; axis tight; - else - varns={XY,lonc,latc}; - varargout= varns(1:nargout); - end - else - if res == 0 - % There are two continuous regions in the data separated by a row - % of NaNs. The other region is defined in two (by NaNs) so that the - % original XY could be plotted as continuous lines. - XY=load(fullfile(whereitsat,'ContShelves.txt')); - - % Get rid of NaN between North America and asia and leave the one - % between North America and Antarctica - h = find(isnan(XY(:,1))); - XY(h(1),:) = []; - XY = [ XY(1:h(2)-2,:) ; XY(1,:) ; XY(h(2)-1:end,:)]; - XY(end+1,:) = XY(h(2)+1,:); - - % Convert to Cartesian coordinates - [X,Y,Z]=sph2cart(XY(:,1)*pi/180,XY(:,2)*pi/180,1); - - % The rotation angles - lonc = -220; latc = -130; - - % Apply the rotation - xyzp=[rotz(lonc*pi/180)*roty(-latc*pi/180)*[X(:) Y(:) Z(:)]']'; - - % Transform back to spherical coordinates - [phi,piminth,r]=cart2sph(xyzp(:,1),xyzp(:,2),xyzp(:,3)); - lon=phi*180/pi; lat=piminth*180/pi; - - % Output in the usual format - XY=[lon lat]; - - % Eyeball - plot(XY(:,1),XY(:,2),'LineW',2,'Color','k'); - - axis equal - axis tight - - save(fnpl,'XY','lonc','latc') - else - [XY,lonc,latc]=contshelves(0); - % Interpolate separately each region that is separated by NaNs - h = find(isnan(XY(:,1))); - XYb = [ bezier( XY(1:h(1)-1,:) , res ) ; [NaN NaN] ]; - if length(h) > 1 - for i = 2:length(h) - XYb = [ XYb ; bezier( XY(h(i-1)+1:h(i)-1,:) , res ) ; ... - [NaN NaN] ]; - end - end - XY = [ XYb ; bezier( XY(h(end)+1:end,:) , res ) ]; - save(fnpl,'XY','lonc','latc') - end - varns={XY,lonc,latc}; - varargout= varns(1:nargout); - end - -elseif strcmp(res,'rotated') - % Return a 1 flag as output, indicating the region is a rotated region - varargout={1}; - -elseif strcmp(res,'demo1') - % Make a simple plot - XY=contshelves(); - plot(XY(:,1),XY(:,2),'k-'); axis equal; grid on - -end diff --git a/ellesmere.m b/ellesmere.m deleted file mode 100644 index 68cdfcf..0000000 --- a/ellesmere.m +++ /dev/null @@ -1,42 +0,0 @@ -function varargout=ellesmere(res,buf) -% XY=ELLESMERE(res,buf) -% ELLESMERE(...) % Only makes a plot -% -% Finds the coordinates of Ellesmere, potentially buffered by some amount. -% -% INPUT: -% -% res 0 The standard, default values -% N Splined values at N times the resolution -% buf Distance in degrees that the region outline will be enlarged -% by BUFFERM, not necessarily integer, possibly negative -% [default: 0] -% -% OUTPUT: -% -% XY Closed-curved coordinates of the continent -% -% Last modified by fjsimons-at-alum.mit.edu, 09/23/2014 -% Last modified by charig-at-princeton.edu, 04/28/2015 - -defval('res',10) -defval('buf',0) - -% Parameters that make this the region in question -regn='ellesmere'; -c11=[267 85]; -%cmn=[300 76]; -cmn=[300 74]; -xunt=[61:245]; - - -% Do it! Make it, load it, save it -XY=regselect(regn,c11,cmn,xunt,res,buf); - -if nargout==0 - plot(XY(:,1),XY(:,2),'k-'); axis equal; grid on -end - -% Prepare optional output -varns={XY}; -varargout=varns(1:nargout); diff --git a/england.m b/england.m deleted file mode 100644 index 68a0671..0000000 --- a/england.m +++ /dev/null @@ -1,43 +0,0 @@ -function varargout=england(res,buf) -% XY=ENGLAND(res,buf) -% ENGLAND(...) % Only makes a plot -% -% Finds the coordinates of England, potentially buffered by some amount. -% -% INPUT: -% -% res 0 The standard, default values -% N Splined values at N times the resolution -% buf Distance in degrees that the region outline will be enlarged -% by BUFFERM, not necessarily integer, possibly negative -% [default: 0] -% -% OUTPUT: -% -% XY Closed-curved coordinates of the continent -% -% Last modified by charig-at-princeton.edu, 11/23/2011 -% Last modified by fjsimons-at-alum.mit.edu, 11/23/2011 - -defval('res',0) -defval('buf',0) - -% Parameters that make this the region in question -regn='england'; -c11=[353 59 ; 0 59]; -cmn=[360 49.75 ; 2 49.75]; -xunt=[61:68 9:60 72:80]; -ofs=[0 360]; - -% Do it! Make it, load it, save it -XY=regselect(regn,c11,cmn,xunt,res,buf,ofs); - -if nargout==0 - plot(XY(:,1),XY(:,2),'k-'); axis image; grid on -end - -% Prepare optional output -varns={XY}; -varargout=varns(1:nargout); - - diff --git a/eurasia.m b/eurasia.m deleted file mode 100644 index 9c311c3..0000000 --- a/eurasia.m +++ /dev/null @@ -1,42 +0,0 @@ -function varargout=eurasia(res,buf) -% XY=EURASIA(res,buf) -% EURASIA(...) % Only makes a plot -% -% Finds the coordinates of Eurasia, potentially buffered by some amount. -% -% INPUT: -% -% res 0 The standard, default values -% N Splined values at N times the resolution -% buf Distance in degrees that the region outline will be enlarged -% by BUFFERM, not necessarily integer, possibly negative -% [default: 0] -% -% OUTPUT: -% -% XY Closed-curved coordinates of the continent -% -% Last modified by charig-at-princeton.edu, 11/23/2011 -% Last modified by fjsimons-at-alum.mit.edu, 11/23/2011 - -defval('res',0) -defval('buf',0) - -% Parameters that make this the region in question -regn='eurasia'; -c11=[0 77.5 ; 350 50 ; 180 69]; -cmn=[180 8; 360 36 ; 190 64]; -xunt=[420:827 914:1023 1556:1605 1030:1548 1607:1639]; -ofs=[360 0 360]; - -% Do it! Make it, load it, save it -XY=regselect(regn,c11,cmn,xunt,res,buf,ofs); - -if nargout==0 - plot(XY(:,1),XY(:,2),'k-'); axis equal; grid on -end - -% Prepare optional output -varns={XY}; -varargout=varns(1:nargout); - diff --git a/greenland.m b/greenland.m deleted file mode 100644 index bb4f8ed..0000000 --- a/greenland.m +++ /dev/null @@ -1,61 +0,0 @@ -function varargout=greenland(res,buf,nearby) -% XY=GREENLAND(res,buf,nearby) -% GREENLAND(...) % Only makes a plot -% -% Finds the coordinates of Greenland, potentially buffered by some amount. -% -% INPUT: -% -% res 0 The standard, default values -% N Splined values at N times the resolution -% buf Distance in degrees that the region outline will be enlarged -% by BUFFERM, not necessarily integer, possibly negative -% [default: 0] -% nearby Subtract the nearby islands of Ellesmere and Baffin -% from your coordinates [default: 1] or 0 -% -% OUTPUT: -% -% XY Closed-curved coordinates of the continent -% -% Last modified by charig-at-princeton.edu, 07/10/2014 -% Last modified by fjsimons-at-alum.mit.edu, 11/23/2011 - -defval('res',0) -defval('buf',0) -defval('nearby',1) - -% Parameters that make this the region in question -regn='greenland'; -c11=[286.7 83.75]; -cmn=[349 59.75]; -xunt=1:352; - -% Do it! Make it, load it, save it -XY=regselect(regn,c11,cmn,xunt,res,buf); - -if nargout==0 - plot(XY(:,1),XY(:,2),'k-'); axis image; grid on -end - -% Subtract the nearby island of Ellsemere -if nearby - % NOTE: if you don't have the nearby stuff made at the desired buffer - % then this will just end in a recursive error. i.e. You should make - % Ellesmere first before trying to subtract it. - XY2 = ellesmereg(10,buf); - [x,y] = polybool('subtraction',XY(:,1),XY(:,2),XY2(:,1),XY2(:,2)); - XY = [x y]; - if buf>=2 - XY2 = baffing(10,1.5); - [x,y] = polybool('subtraction',XY(:,1),XY(:,2),XY2(:,1),XY2(:,2)); - XY = [x y]; - end -end - - - -% Prepare optional output -varns={XY}; -varargout=varns(1:nargout); - diff --git a/honshu.m b/honshu.m deleted file mode 100644 index 34a3850..0000000 --- a/honshu.m +++ /dev/null @@ -1,42 +0,0 @@ -function varargout=honshu(res,buf) -% XY=HONSHU(res,buf) -% HONSHU(...) % Only makes a plot -% -% Finds the coordinates of Honshu and Kyushu, potentially buffered by -% some amount. -% -% INPUT: -% -% res 0 The standard, default values -% N Splined values at N times the resolution -% buf Distance in degrees that the region outline will be enlarged -% by BUFFERM, not necessarily integer, possibly negative -% [default: 0] -% -% OUTPUT: -% -% XY Closed-curved coordinates of the island -% -% Last modified by fjsimons-at-alum.mit.edu, 09/24/2014 - -defval('res',0) -defval('buf',0) - -% Parameters that make this the region in question -regn='honshu'; -c11=[129 42]; -cmn=[146 30]; -xunt=[3:56]; -ofs=0; - -% Do it! Make it, load it, save it -XY=regselect(regn,c11,cmn,xunt,res,buf,ofs); - -if nargout==0 - plot(XY(:,1),XY(:,2),'k-'); axis image; grid on -end - -% Prepare optional output -varns={XY}; -varargout=varns(1:nargout); - diff --git a/madagascar.m b/madagascar.m deleted file mode 100644 index 2987e8d..0000000 --- a/madagascar.m +++ /dev/null @@ -1,42 +0,0 @@ -function varargout=madagascar(res,scal) -% XY=MADAGASCAR(res,scal) -% MADAGASCAR(...) % Only makes a plot -% -% Finds the coordinates of Madagascar, potentially buffered by -% some amount. -% -% INPUT: -% -% res 0 The standard, default values -% N Splined values at N times the resolution -% buf Distance in degrees that the region outline will be enlarged -% by BUFFERM, not necessarily integer, possibly negative -% [default: 0] -% -% OUTPUT: -% -% XY Closed-curved coordinates of the island -% -% Last modified by fjsimons-at-alum.mit.edu, September 28, 2014 - -defval('res',0) -defval('buf',0) - -% Parameters that make this the region in question -regn='madagascar'; -c11=[41 -11]; -cmn=[52 -27]; -xunt=[1:35]; -ofs=0; - -% Do it! Make it, load it, save it -XY=regselect(regn,c11,cmn,xunt,res,buf,ofs); - -if nargout==0 - plot(XY(:,1),XY(:,2),'k-'); axis image; grid on -end - -% Prepare optional output -varns={XY}; -varargout=varns(1:nargout); - diff --git a/namerica.m b/namerica.m deleted file mode 100644 index a4b6d2c..0000000 --- a/namerica.m +++ /dev/null @@ -1,40 +0,0 @@ -function varargout=namerica(res,buf) -% XY=NAMERICA(res,buf) -% NAMERICA(...) % Only makes a plot -% -% Finds the coordinates of Namerica, potentially buffered by some amount. -% -% INPUT: -% -% res 0 The standard, default values -% N Splined values at N times the resolution -% buf Distance in degrees that the region outline will be enlarged -% by BUFFERM, not necessarily integer, possibly negative -% [default: 0] -% -% OUTPUT: -% -% XY Closed-curved coordinates of the continent -% -% Last modified by charig-at-princeton.edu, 11/23/2011 -% Last modified by fjsimons-at-alum.mit.edu, 11/23/2011 - -defval('res',0) -defval('buf',0) - -% Parameters that make this the region in question -regn='namerica'; -c11=[191 74.5]; -cmn=[304.5 12]; -xunt=[385:717 721:1004]; - -% Do it! Make it, load it, save it -XY=regselect(regn,c11,cmn,xunt,res,buf); - -if nargout==0 - plot(XY(:,1),XY(:,2),'k-'); axis equal; grid on -end - -% Prepare optional output -varns={XY}; -varargout=varns(1:nargout); diff --git a/newguinea.m b/newguinea.m deleted file mode 100644 index 8c109aa..0000000 --- a/newguinea.m +++ /dev/null @@ -1,42 +0,0 @@ -function varargout=newguinea(res,scal) -% XY=NEWGUINEA(res,scal) -% NEWGUINEA(...) % Only makes a plot -% -% Finds the coordinates of New Guinea, potentially buffered by -% some amount. -% -% INPUT: -% -% res 0 The standard, default values -% N Splined values at N times the resolution -% buf Distance in degrees that the region outline will be enlarged -% by BUFFERM, not necessarily integer, possibly negative -% [default: 0] -% -% OUTPUT: -% -% XY Closed-curved coordinates of the island -% -% Last modified by fjsimons-at-alum.mit.edu, 09/28/2014 - -defval('res',0) -defval('buf',0) - -% Parameters that make this the region in question -regn='newguinea'; -c11=[130 0]; -cmn=[151 -13]; -xunt=[1:70]; -ofs=0; - -% Do it! Make it, load it, save it -XY=regselect(regn,c11,cmn,xunt,res,buf,ofs); - -if nargout==0 - plot(XY(:,1),XY(:,2),'k-'); axis image; grid on -end - -% Prepare optional output -varns={XY}; -varargout=varns(1:nargout); - diff --git a/orinoco.m b/orinoco.m deleted file mode 100644 index 097d8c5..0000000 --- a/orinoco.m +++ /dev/null @@ -1,44 +0,0 @@ -function varargout=orinoco(res,buf) -% XY=ORINOCO(res,buf) -% ORINOCO(...) % Only makes a plot -% -% Finds the coordinates of Orinoco, potentially buffered by some amount. -% -% INPUT: -% -% res 0 The standard, default values -% N Splined values at N times the resolution -% buf Distance in degrees that the region outline will be enlarged -% by BUFFERM, not necessarily integer, possibly negative -% [default: 0] -% -% OUTPUT: -% -% XY Closed-curved coordinates of the continent -% -% Last modified by charig-at-princeton.edu, 11/23/2011 -% Last modified by fjsimons-at-alum.mit.edu, 11/23/2011 - -defval('res',0) -defval('buf',0) - -% Parameters that make this the region in question -regn='orinoco'; -c11=[260 15]; -cmn=[345 -60]; -xunt=[]; - -% This admittedly is a special case -XY=load(fullfile(getenv('IFILES'),'COASTS','orinoco')); - -% Do it! Make it, load it, save it -XY=regselect(regn,XY(:,1),XY(:,2),xunt,res,buf); - -if nargout==0 - plot(XY(:,1),XY(:,2),'k-'); axis image; grid on -end - -% Prepare optional output -varns={XY}; -varargout=varns(1:nargout); - diff --git a/samerica.m b/samerica.m deleted file mode 100644 index b612a29..0000000 --- a/samerica.m +++ /dev/null @@ -1,40 +0,0 @@ -function varargout=samerica(res,buf) -% XY=SAMERICA(res,buf) -% SAMERICA(...) % Only makes a plot -% -% Finds the coordinates of Samerica, potentially buffered by some amount. -% -% INPUT: -% -% res 0 The standard, default values -% N Splined values at N times the resolution -% buf Distance in degrees that the region outline will be enlarged -% by BUFFERM, not necessarily integer, possibly negative -% [default: 0] -% -% OUTPUT: -% -% XY Closed-curved coordinates of the continent -% -% Last modified by charig-at-princeton.edu, 11/23/2011 -% Last modified by fjsimons-at-alum.mit.edu, 11/23/2011 - -defval('res',0) -defval('buf',0) - -% Parameters that make this the region in question -regn='samerica'; -c11=[278.5 13]; -cmn=[326 -55.5]; -xunt=16:271; - -% Do it! Make it, load it, save it -XY=regselect(regn,c11,cmn,xunt,res,buf); - -if nargout==0 - plot(XY(:,1),XY(:,2),'k-'); axis equal; grid on -end - -% Prepare optional output -varns={XY}; -varargout=varns(1:nargout); diff --git a/sumatra.m b/sumatra.m deleted file mode 100644 index d851425..0000000 --- a/sumatra.m +++ /dev/null @@ -1,41 +0,0 @@ -function varargout=sumatra(res,scal) -% XY=SUMATRA(res,scal) -% SUMATRA(...) % Only makes a plot -% -% Finds the coordinates of Sumatra, potentially buffered by -% some amount. -% -% INPUT: -% -% res 0 The standard, default values -% N Splined values at N times the resolution -% buf Distance in degrees that the region outline will be enlarged -% by BUFFERM, not necessarily integer, possibly negative -% [default: 0] -% -% OUTPUT: -% -% XY Closed-curved coordinates of the island -% -% Last modified by fjsimons-at-alum.mit.edu, September 28th, 2014 - -defval('res',0) -defval('buf',0) - -% Parameters that make this the region in question -regn='sumatra'; -c11=[94 6]; -cmn=[108 -6]; -xunt=[4:42]; -ofs=0; - -% Do it! Make it, load it, save it -XY=regselect(regn,c11,cmn,xunt,res,buf,ofs); - -if nargout==0 - plot(XY(:,1),XY(:,2),'k-'); axis image; grid on -end - -% Prepare optional output -varns={XY}; -varargout=varns(1:nargout);