Commit 696b882b authored by Pierre Cazenave's avatar Pierre Cazenave

Update the documentation to include all the new utilities I created

parent 3707bb5c
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -59,6 +59,6 @@ This function is called by:
0007 <span class="comment">% Revision history</span>
0008 <span class="comment">%</span>
0009 <span class="comment">%==============================================================================</span></pre></div>
<hr><address>Generated on Wed 02-Nov-2011 21:58:00 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Tue 18-Dec-2012 12:37:31 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
......@@ -19,11 +19,13 @@
<h2>Matlab files in this directory:</h2>
<table>
<tr><td><img src="../matlabicon.gif" alt="" border="">&nbsp;<a href="README.html">README</a></td><td>README for FVCOM_postproc </td></tr></table>
<tr><td><img src="../matlabicon.gif" alt="" border="">&nbsp;<a href="README.html">README</a></td><td>README for FVCOM_postproc </td></tr><tr><td><img src="../matlabicon.gif" alt="" border="">&nbsp;<a href="example_surface_plot.html">example_surface_plot</a></td><td>Sample script to extract and generate m_map contours of tracer variables </td></tr></table>
<h2>Subsequent directories:</h2>
<ul style="list-style-image:url(../matlabicon.gif)">
<li>mat</li><li>plots</li><li>surface_plots</li><li>timeseries</li><li>transect_plots</li></ul>
<hr><address>Generated on Wed 02-Nov-2011 21:57:59 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Tue 18-Dec-2012 12:37:29 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -29,17 +29,19 @@
<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> README for the FVCOM preprocessing toolbox
This directory contains matlab scripts for preprocessing input files
for FVCOM 3.x. These include files which read a mesh in from SMS,
This directory contains matlab scripts for preprocessing input files
for FVCOM 3.x. These include files which read a mesh in from SMS,
files that allow you to select open boundary and river nodes and generate
river, tidal, and wind forcing. Template files for generating wind forcing
are also included.
are also included.
Author(s):
Author(s):
Geoff Cowles (University of Massachusetts Dartmouth)
Ricardo Torres (Plymouth Marine Laboratory)
Pierre Cazenave (Plymouth Marine Laboratory)
Revision history
==============================================================================</pre></div>
<!-- crossreference -->
......@@ -65,10 +67,12 @@ This function is called by:
0008 <span class="comment">%</span>
0009 <span class="comment">% Author(s):</span>
0010 <span class="comment">% Geoff Cowles (University of Massachusetts Dartmouth)</span>
0011 <span class="comment">%</span>
0012 <span class="comment">% Revision history</span>
0011 <span class="comment">% Ricardo Torres (Plymouth Marine Laboratory)</span>
0012 <span class="comment">% Pierre Cazenave (Plymouth Marine Laboratory)</span>
0013 <span class="comment">%</span>
0014 <span class="comment">%==============================================================================</span></pre></div>
<hr><address>Generated on Wed 02-Nov-2011 21:58:00 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
0014 <span class="comment">% Revision history</span>
0015 <span class="comment">%</span>
0016 <span class="comment">%==============================================================================</span></pre></div>
<hr><address>Generated on Tue 18-Dec-2012 12:37:31 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -144,6 +144,6 @@ This function is called by:
0074
0075
0076</pre></div>
<hr><address>Generated on Wed 02-Nov-2011 21:58:00 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Tue 18-Dec-2012 12:37:31 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -24,7 +24,7 @@
<div class="box"><strong>Add a set of obc nodes comprising a single obc boundary to Mesh structure</strong></div>
<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function [Mobj] = add_obc_nodes_screen(Mobj,ObcName,ObcType) </strong></div>
<div class="box"><strong>function [Mobj] = add_obc_nodes_graphic(Mobj,ObcName,ObcType) </strong></div>
<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Add a set of obc nodes comprising a single obc boundary to Mesh structure
......@@ -70,7 +70,7 @@ This function is called by:
<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [Mobj] = add_obc_nodes_screen(Mobj,ObcName,ObcType)</a>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [Mobj] = add_obc_nodes_graphic(Mobj,ObcName,ObcType)</a>
0002
0003 <span class="comment">% Add a set of obc nodes comprising a single obc boundary to Mesh structure</span>
0004 <span class="comment">% By clicking on points on the screen</span>
......@@ -160,6 +160,6 @@ This function is called by:
0088 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0089 <span class="keyword">end</span>;
0090</pre></div>
<hr><address>Generated on Wed 02-Nov-2011 21:58:00 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Tue 18-Dec-2012 12:37:31 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
......@@ -161,6 +161,6 @@ This function is called by:
0091 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0092 <span class="keyword">end</span>;
0093</pre></div>
<hr><address>Generated on Wed 02-Nov-2011 21:58:00 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Tue 18-Dec-2012 12:37:31 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -149,6 +149,6 @@ This function is called by:
0078 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0079 <span class="keyword">end</span>;
0080</pre></div>
<hr><address>Generated on Wed 02-Nov-2011 21:58:00 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Tue 18-Dec-2012 12:37:31 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -91,6 +91,6 @@ This function is called by:
0045 nc = close(nc);
0046
0047</pre></div>
<hr><address>Generated on Wed 02-Nov-2011 21:58:00 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Tue 18-Dec-2012 12:37:31 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -121,41 +121,42 @@ This function is called by:
0049 figure
0050 patch(<span class="string">'Vertices'</span>,[x,y],<span class="string">'Faces'</span>,Mobj.tri,<span class="keyword">...</span>
0051 <span class="string">'Cdata'</span>,Mobj.h,<span class="string">'edgecolor'</span>,<span class="string">'k'</span>,<span class="string">'facecolor'</span>,<span class="string">'interp'</span>);
0052 hold on;
0053
0054 <span class="comment">% use ginput2 (which allows zooming and plots points as they are clicked) to let</span>
0055 <span class="comment">% user select the boundary points</span>
0056 [xselect] = ginput2(true,<span class="string">'k+'</span>)
0057
0052 axis(<span class="string">'equal'</span>,<span class="string">'tight'</span>)
0053 hold on;
0054
0055 <span class="comment">% use ginput2 (which allows zooming and plots points as they are clicked) to let</span>
0056 <span class="comment">% user select the boundary points</span>
0057 [xselect] = ginput2(true,<span class="string">'k+'</span>)
0058
0059 [npts,jnk] = size(xselect);
0060
0061 <span class="keyword">if</span>(npts == 0)
0062 fprintf(<span class="string">'you didn''t select any points'</span>)
0063 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0064 <span class="keyword">return</span>
0065 <span class="keyword">end</span>;
0066 fprintf(<span class="string">'you selected %d points\n'</span>,npts)
0067
0068 <span class="comment">% snap to the closest vertices</span>
0069 <span class="keyword">for</span> i=1:npts
0070 [ipt(i),dist] = <a href="find_nearest_pt.html" class="code" title="function [Point,Distance] = find_nearest_pt(xloc,yloc,Mobj)">find_nearest_pt</a>(xselect(i,1),xselect(i,2),Mobj);
0071 <span class="keyword">end</span>;
0072
0073 <span class="comment">% replot domain with snapped vertices</span>
0074 plot(x(ipt),y(ipt),<span class="string">'ro'</span>);
0075
0076 <span class="comment">% add to mesh object</span>
0077 Mobj.nSponge = Mobj.nSponge + 1;
0078 Mobj.nSpongeNodes(Mobj.nSponge) = npts;
0079 Mobj.sponge_nodes(Mobj.nSponge,1:npts) = ipt;
0080 Mobj.sponge_name{Mobj.nSponge} = SpongeName;
0081 Mobj.sponge_rad(Mobj.nSponge) = SpongeRadius;
0082 Mobj.sponge_fac(Mobj.nSponge) = SpongeCoeff;
0083
0059
0060 npts = size(xselect,1);
0061
0062 <span class="keyword">if</span>(npts == 0)
0063 fprintf(<span class="string">'you didn''t select any points'</span>)
0064 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0065 <span class="keyword">return</span>
0066 <span class="keyword">end</span>;
0067 fprintf(<span class="string">'you selected %d points\n'</span>,npts)
0068
0069 <span class="comment">% snap to the closest vertices</span>
0070 <span class="keyword">for</span> i=1:npts
0071 [ipt(i),dist] = <a href="find_nearest_pt.html" class="code" title="function [Point,Distance] = find_nearest_pt(xloc,yloc,Mobj)">find_nearest_pt</a>(xselect(i,1),xselect(i,2),Mobj);
0072 <span class="keyword">end</span>;
0073
0074 <span class="comment">% replot domain with snapped vertices</span>
0075 plot(x(ipt),y(ipt),<span class="string">'ro'</span>);
0076
0077 <span class="comment">% add to mesh object</span>
0078 Mobj.nSponge = Mobj.nSponge + 1;
0079 Mobj.nSpongeNodes(Mobj.nSponge) = npts;
0080 Mobj.sponge_nodes(Mobj.nSponge,1:npts) = ipt;
0081 Mobj.sponge_name{Mobj.nSponge} = SpongeName;
0082 Mobj.sponge_rad(Mobj.nSponge) = SpongeRadius;
0083 Mobj.sponge_fac(Mobj.nSponge) = SpongeCoeff;
0084
0085 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0086</pre></div>
<hr><address>Generated on Wed 02-Nov-2011 21:58:00 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
0085
0086 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0087</pre></div>
<hr><address>Generated on Tue 18-Dec-2012 12:37:31 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>Description of add_sponge_nodes_list</title>
<meta name="keywords" content="add_sponge_nodes_list">
<meta name="description" content="Add a set of sponge nodes comprising a single sponge layer to Mesh structure">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="generator" content="m2html v1.5 &copy; 2003-2005 Guillaume Flandin">
<meta name="robots" content="index, follow">
<link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../index.html">Home</a> &gt; <a href="index.html">fvcom_prepro</a> &gt; add_sponge_nodes_list.m</div>
<!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for fvcom_prepro&nbsp;<img alt=">" border="0" src="../right.png"></a></td></tr></table>-->
<h1>add_sponge_nodes_list
</h1>
<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Add a set of sponge nodes comprising a single sponge layer to Mesh structure</strong></div>
<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function [Mobj] = add_sponge_nodes_list(Mobj,SpongeList,SpongeName,SpongeRadius,SpongeCoeff,plotFig) </strong></div>
<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Add a set of sponge nodes comprising a single sponge layer to Mesh structure
[Mobj] = add_sponge_nodes(Mobj)
DESCRIPTION:
Select using ginput the set of nodes comprising a sponge layer
INPUT
Mobj = Matlab mesh object
SpongeList = List of nodes to which to create a Sponge Layer
SpongeName = Name of the Sponge Layer
SpongeRadius = Radius of influence of the Sponge Layer
SpongeCoeff = Sponge damping coefficient
plotFig = [optional] show a figure of the mesh (1 = yes)
OUTPUT:
Mobj = Matlab mesh object with an additional sponge nodelist
EXAMPLE USAGE
Mobj = add_sponge_nodes(Mobj,'Sponge1',10000,.0001)
Author(s):
Geoff Cowles (University of Massachusetts Dartmouth)
Pierre Cazenave (Plymouth Marine Laboratory)
Revision history
Modifed from add_sponge_nodes to read in nodes from a supplied list.
2012-11-26 Add ability to turn off the figures.
==============================================================================</pre></div>
<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
<!-- crossreference -->
<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [Mobj] = add_sponge_nodes_list(Mobj,SpongeList,SpongeName,SpongeRadius,SpongeCoeff,plotFig)</a>
0002
0003 <span class="comment">% Add a set of sponge nodes comprising a single sponge layer to Mesh structure</span>
0004 <span class="comment">%</span>
0005 <span class="comment">% [Mobj] = add_sponge_nodes(Mobj)</span>
0006 <span class="comment">%</span>
0007 <span class="comment">% DESCRIPTION:</span>
0008 <span class="comment">% Select using ginput the set of nodes comprising a sponge layer</span>
0009 <span class="comment">%</span>
0010 <span class="comment">% INPUT</span>
0011 <span class="comment">% Mobj = Matlab mesh object</span>
0012 <span class="comment">% SpongeList = List of nodes to which to create a Sponge Layer</span>
0013 <span class="comment">% SpongeName = Name of the Sponge Layer</span>
0014 <span class="comment">% SpongeRadius = Radius of influence of the Sponge Layer</span>
0015 <span class="comment">% SpongeCoeff = Sponge damping coefficient</span>
0016 <span class="comment">% plotFig = [optional] show a figure of the mesh (1 = yes)</span>
0017 <span class="comment">%</span>
0018 <span class="comment">% OUTPUT:</span>
0019 <span class="comment">% Mobj = Matlab mesh object with an additional sponge nodelist</span>
0020 <span class="comment">%</span>
0021 <span class="comment">% EXAMPLE USAGE</span>
0022 <span class="comment">% Mobj = add_sponge_nodes(Mobj,'Sponge1',10000,.0001)</span>
0023 <span class="comment">%</span>
0024 <span class="comment">% Author(s):</span>
0025 <span class="comment">% Geoff Cowles (University of Massachusetts Dartmouth)</span>
0026 <span class="comment">% Pierre Cazenave (Plymouth Marine Laboratory)</span>
0027 <span class="comment">%</span>
0028 <span class="comment">% Revision history</span>
0029 <span class="comment">% Modifed from add_sponge_nodes to read in nodes from a supplied list.</span>
0030 <span class="comment">% 2012-11-26 Add ability to turn off the figures.</span>
0031 <span class="comment">%</span>
0032 <span class="comment">%==============================================================================</span>
0033 subname = <span class="string">'add_sponge_nodes'</span>;
0034
0035 <span class="keyword">global</span> ftbverbose
0036 <span class="keyword">if</span>(ftbverbose)
0037 fprintf(<span class="string">'\n'</span>)
0038 fprintf([<span class="string">'begin : '</span> subname <span class="string">'\n'</span>])
0039 <span class="keyword">end</span>
0040
0041 <span class="comment">% Do we want a figure showing how we're getting along?</span>
0042 <span class="keyword">if</span> nargin == 5
0043 plotFig = 0;
0044 <span class="keyword">end</span>
0045
0046 <span class="comment">%------------------------------------------------------------------------------</span>
0047 <span class="comment">% Plot the mesh</span>
0048 <span class="comment">%------------------------------------------------------------------------------</span>
0049 <span class="keyword">if</span> plotFig == 1
0050 <span class="keyword">if</span>(lower(Mobj.nativeCoords(1:3)) == <span class="string">'car'</span>)
0051 x = Mobj.x;
0052 y = Mobj.y;
0053 <span class="keyword">else</span>
0054 x = Mobj.lon;
0055 y = Mobj.lat;
0056 <span class="keyword">end</span>
0057
0058 figure
0059 patch(<span class="string">'Vertices'</span>,[x,y],<span class="string">'Faces'</span>,Mobj.tri,<span class="keyword">...</span>
0060 <span class="string">'Cdata'</span>,Mobj.h,<span class="string">'edgecolor'</span>,<span class="string">'k'</span>,<span class="string">'facecolor'</span>,<span class="string">'interp'</span>);
0061 hold on;
0062 plot(x(SpongeList),y(SpongeList),<span class="string">'wx'</span>)
0063 axis(<span class="string">'equal'</span>,<span class="string">'tight'</span>)
0064 <span class="keyword">end</span>
0065
0066 npts = size(SpongeList,2);
0067
0068 <span class="keyword">if</span>(npts == 0)
0069 fprintf(<span class="string">'No points in given list'</span>)
0070 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0071 <span class="keyword">return</span>
0072 <span class="keyword">end</span>
0073 <span class="keyword">if</span>(ftbverbose)
0074 fprintf(<span class="string">'%d points provided\n'</span>,npts)
0075 <span class="keyword">end</span>
0076
0077 <span class="comment">% add to mesh object</span>
0078 Mobj.nSponge = Mobj.nSponge + 1;
0079 Mobj.nSpongeNodes(Mobj.nSponge) = npts;
0080 Mobj.sponge_nodes(Mobj.nSponge,1:npts) = SpongeList;
0081 Mobj.sponge_name{Mobj.nSponge} = SpongeName;
0082 Mobj.sponge_rad(Mobj.nSponge) = SpongeRadius;
0083 Mobj.sponge_fac(Mobj.nSponge) = SpongeCoeff;
0084
0085 <span class="keyword">if</span>(ftbverbose)
0086 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0087 <span class="keyword">end</span>
0088
0089</pre></div>
<hr><address>Generated on Tue 18-Dec-2012 12:37:31 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>Description of add_stations_list</title>
<meta name="keywords" content="add_stations_list">
<meta name="description" content="Add a set of stations at which FVCOM will output time series.">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="generator" content="m2html v1.5 &copy; 2003-2005 Guillaume Flandin">
<meta name="robots" content="index, follow">
<link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../index.html">Home</a> &gt; <a href="index.html">fvcom_prepro</a> &gt; add_stations_list.m</div>
<!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for fvcom_prepro&nbsp;<img alt=">" border="0" src="../right.png"></a></td></tr></table>-->
<h1>add_stations_list
</h1>
<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Add a set of stations at which FVCOM will output time series.</strong></div>
<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function [Mobj] = add_stations_list(Mobj,Positions,Names,Dist) </strong></div>
<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Add a set of stations at which FVCOM will output time series.
[Mobj] = add_stations_list(Mobj,Positions,Names,Dist)
DESCRIPTION:
Supply a list of positions (in the same coordinate system as the
native coordinates of the grid) and a cell array of names. Nearest
grid node to those supplied will be used in the output file.
INPUT
Mobj = Matlab mesh object
Positions = 2xn array of the XY positions of the stations
Names = Cell array of the names of the stations defined in Positions
Dist = Maximum distance from a station for a node to be included
Optionally supply positions as a 4xn array with spherical x and y and
cartesian x and y in columns 1, 2, 3 and 4, respectively. The
values in Mobj.nativecoords will be used for the distance check, so
ensure Dist is in those units.
OUTPUT:
Mobj = Matlab mesh object with an additional cell array containing id,
x, y, nodelist, depth and station name.
EXAMPLE USAGE
Mobj = add_stations_list(Mobj, [-5.54, 50.103; -3.0865, 58.441], ...
{'Newlyn', 'Wick'}, 0.25)
Author(s):
Pierre Cazenave (Plymouth Marine Laboratory)
Revision history
2012-11-30 First version.
==========================================================================</pre></div>
<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="find_nearest_pt.html" class="code" title="function [Point,Distance] = find_nearest_pt(xloc,yloc,Mobj)">find_nearest_pt</a> Find nearest point in Mesh structure to (x,y)</li></ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
<!-- crossreference -->
<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [Mobj] = add_stations_list(Mobj,Positions,Names,Dist)</a>
0002
0003 <span class="comment">% Add a set of stations at which FVCOM will output time series.</span>
0004 <span class="comment">%</span>
0005 <span class="comment">% [Mobj] = add_stations_list(Mobj,Positions,Names,Dist)</span>
0006 <span class="comment">%</span>
0007 <span class="comment">% DESCRIPTION:</span>
0008 <span class="comment">% Supply a list of positions (in the same coordinate system as the</span>
0009 <span class="comment">% native coordinates of the grid) and a cell array of names. Nearest</span>
0010 <span class="comment">% grid node to those supplied will be used in the output file.</span>
0011 <span class="comment">%</span>
0012 <span class="comment">% INPUT</span>
0013 <span class="comment">% Mobj = Matlab mesh object</span>
0014 <span class="comment">% Positions = 2xn array of the XY positions of the stations</span>
0015 <span class="comment">% Names = Cell array of the names of the stations defined in Positions</span>
0016 <span class="comment">% Dist = Maximum distance from a station for a node to be included</span>
0017 <span class="comment">%</span>
0018 <span class="comment">% Optionally supply positions as a 4xn array with spherical x and y and</span>
0019 <span class="comment">% cartesian x and y in columns 1, 2, 3 and 4, respectively. The</span>
0020 <span class="comment">% values in Mobj.nativecoords will be used for the distance check, so</span>
0021 <span class="comment">% ensure Dist is in those units.</span>
0022 <span class="comment">%</span>
0023 <span class="comment">% OUTPUT:</span>
0024 <span class="comment">% Mobj = Matlab mesh object with an additional cell array containing id,</span>
0025 <span class="comment">% x, y, nodelist, depth and station name.</span>
0026 <span class="comment">%</span>
0027 <span class="comment">% EXAMPLE USAGE</span>
0028 <span class="comment">% Mobj = add_stations_list(Mobj, [-5.54, 50.103; -3.0865, 58.441], ...</span>
0029 <span class="comment">% {'Newlyn', 'Wick'}, 0.25)</span>
0030 <span class="comment">%</span>
0031 <span class="comment">% Author(s):</span>
0032 <span class="comment">% Pierre Cazenave (Plymouth Marine Laboratory)</span>
0033 <span class="comment">%</span>
0034 <span class="comment">%</span>
0035 <span class="comment">% Revision history</span>
0036 <span class="comment">% 2012-11-30 First version.</span>
0037 <span class="comment">%</span>
0038 <span class="comment">%==========================================================================</span>
0039 subname = <span class="string">'add_stations_list'</span>;
0040 <span class="keyword">global</span> ftbverbose
0041 <span class="keyword">if</span>(ftbverbose)
0042 fprintf(<span class="string">'\n'</span>)
0043 fprintf([<span class="string">'begin : '</span> subname <span class="string">'\n'</span>])
0044 <span class="keyword">end</span>;
0045
0046 <span class="comment">%--------------------------------------------------------------------------</span>
0047 <span class="comment">% Check the inputs</span>
0048 <span class="comment">%--------------------------------------------------------------------------</span>
0049 nPos = size(Positions, 1);
0050 nNames = size(Names, 1);
0051 <span class="keyword">if</span> nPos ~= nNames
0052 error(<span class="string">'The number of the supplied station positions and names do not match (%i and %i respectively)'</span>, nPos, nNames)
0053 <span class="keyword">end</span>
0054
0055 <span class="comment">%--------------------------------------------------------------------------</span>
0056 <span class="comment">% For each site in the supplied positions, find the nearest node ID</span>
0057 <span class="comment">%--------------------------------------------------------------------------</span>
0058
0059 <span class="comment">% Check for whether the input has both spherical and cartesian.</span>
0060 <span class="keyword">if</span> size(Positions, 2) &gt; 2
0061 <span class="comment">% Now check for which is the native coordinate system, and output the</span>
0062 <span class="comment">% station positions in that coordinate system.</span>
0063 <span class="keyword">if</span> strcmpi(Mobj.nativeCoords, <span class="string">'cartesian'</span>)
0064 cols = [3, 4];
0065 <span class="keyword">elseif</span> strcmpi(Mobj.nativeCoords, <span class="string">'spherical'</span>)
0066 cols = [1, 2];
0067 <span class="keyword">else</span>
0068 error(<span class="string">'Unknown native coordinate system string: %s'</span>, Mobj.nativeCoords)
0069 <span class="keyword">end</span>
0070 <span class="keyword">else</span>
0071 <span class="comment">% We have to assume the positions are in the grid's native coordinate</span>
0072 <span class="comment">% system.</span>
0073 cols = [1, 2];
0074 <span class="keyword">end</span>
0075
0076 inc = 1;
0077 <span class="comment">% out = cell(nPos, 1);</span>
0078
0079 <span class="keyword">for</span> s=1:nPos
0080 [node, dist] = <a href="find_nearest_pt.html" class="code" title="function [Point,Distance] = find_nearest_pt(xloc,yloc,Mobj)">find_nearest_pt</a>(Positions(s, cols(1)), Positions(s, cols(2)), Mobj);
0081
0082 <span class="keyword">if</span> dist &gt;= Dist
0083 <span class="comment">% Skip out for this station</span>
0084 <span class="keyword">if</span>(ftbverbose)
0085 fprintf(<span class="string">'Skipping station %s (%g, %g). Nodal distance from station position = %f\n'</span>, Names{s}, Positions(s, 1), Positions(s, 2), dist)
0086 <span class="keyword">end</span>
0087 <span class="keyword">continue</span>
0088 <span class="keyword">end</span>
0089 out{inc} = {inc, Positions(s, cols(1)), Positions(s, cols(2)), node, Mobj.h(node), Names{s}};
0090 inc = inc + 1;
0091 <span class="keyword">end</span>
0092
0093 Mobj.stations = out;</pre></div>
<hr><address>Generated on Tue 18-Dec-2012 12:37:31 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -172,6 +172,6 @@ This function is called by:
0098 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0099 <span class="keyword">end</span>;
0100</pre></div>
<hr><address>Generated on Wed 02-Nov-2011 21:58:00 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Tue 18-Dec-2012 12:37:31 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -123,6 +123,6 @@ This function is called by:
0057
0058 <span class="comment">%fprintf(['end : ' subname '\n'])</span>
0059</pre></div>
<hr><address>Generated on Wed 02-Nov-2011 21:58:00 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Tue 18-Dec-2012 12:37:31 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -24,15 +24,15 @@
<div class="box"><strong>Estimate time step at each node</strong></div>
<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function [Mobj] = estimate_ts(Mobj) </strong></div>
<div class="box"><strong>function [Mobj] = estimate_ts(Mobj,u,zeta) </strong></div>
<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Estimate time step at each node
<div class="fragment"><pre class="comment"> Estimate time step at each node