<?xml version="1.0"?>
<!-- name="generator" content="blosxom/2.0" -->
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">

<rss version="0.91">
  <channel>
    <title>MAPERL:   </title>
    <link>http://www.maperl.com/cgi-local/journal</link>
    <description> Blog of Capt. Ben</description>
    <language>en</language>

  <item>
    <title>SVMOP:Projects: Submitting KML content to Google Earth -- not as easy as Flickr</title>
    <pubDate>Sun, 15 Feb 2009 15:15:00 EDT</pubDate>
    <link>http://www.maperl.com/cgi-local/journal/2009/02/15#GoogleEarth-090215a</link>
    <description>
&lt;p&gt;
There are a few rather esoteric steps to getting your KML
files recognized by the Google Earth search engine. I think
I have it set up, but we will see. -ben
&lt;/p&gt;</description>
  </item>
  <item>
    <title>SVMOP:Projects: New Design Ideas for Tide Tools</title>
    <pubDate>Mon, 09 Feb 2009 19:59:00 EDT</pubDate>
    <link>http://www.maperl.com/cgi-local/journal/2009/02/09#tides-090209-designs</link>
    <description>
&lt;p&gt;
Well, I found my bug in my lowpass filter. I had two variables, with very
similar names, being used for the same thing. But one wasn't recalculated
as it should have been, the result was that I had figured weighting numbers
based on, say a window of 15 points, but only summing 11. That filter looks
pretty good now.
&lt;/p&gt;

&lt;p&gt;
I believe that it was a mistake to put the interpolator inside of the
data convertor program. I need to destroy outliers BEFORE I do any
interpolation.
&lt;/p&gt;

&lt;p&gt;
Also, I'm not convinced that straight-line interpolation will suit our
needs. I'm thinking more in the lines of a circular arc fit.
&lt;/p&gt;

&lt;p&gt;
So now, the path might be:
&lt;/p&gt;

&lt;nl&gt;
&lt;li&gt; convert from pressure to depth&lt;/li&gt;
&lt;li&gt; do data cleaning using a slope corrected standard deviation over a window&lt;/li&gt;
&lt;li&gt; interpolate and resample (I think I can combine these)&lt;/li&gt;
&lt;li&gt; smooth (low pass filter)&lt;/li&gt;
&lt;li&gt; find peaks, MLLW, constituents, etc.&lt;/li&gt;
&lt;li&gt; compare prediction methods with cleaned but unsmoothed data&lt;/li&gt;
&lt;/nl&gt;
</description>
  </item>
  <item>
    <title>SVMOP:Projects: Don't program when you mind isn't clear.</title>
    <pubDate>Sat, 07 Feb 2009 16:05:00 EDT</pubDate>
    <link>http://www.maperl.com/cgi-local/journal/2009/02/07#tides-090207-interpolation</link>
    <description>
&lt;p&gt;
I finally found my last problem with the interpolation. 
There were two. But last one was the most vexing.
It was my calculation of
fp seconds from datetime.timedelta. I had put this off in its only routine
and had written: dt.seconds + dt.microseconds * exp(-6).  Obvious when you
see it: exp is exponent of base e not base 10. The correct expression
is: dt.seconds + dt.microseconds * 10**(-6).
&lt;/p&gt;

&lt;a href=&quot;/Journal/Projects/interpolationComparison-04b.png&quot;&gt;
&lt;img width=&quot;400&quot; src=&quot;/Journal/Projects/interpolationComparison-04b.png&quot;&gt;
&lt;/img&gt;
&lt;/a&gt;
&lt;a href=&quot;/Journal/Projects/interpolationComparison-04c.png&quot;&gt;
&lt;img width=&quot;400&quot; src=&quot;/Journal/Projects/interpolationComparison-04c.png&quot;&gt;
&lt;/img&gt;
&lt;/a&gt;

&lt;p&gt;
I really like the Python matplotlib plotting routines and interface for
viewing, As you can see, I was able to pinpoint my problems thanks to the
ease of this interface and its ability to create images.
&lt;/p&gt;</description>
  </item>
  <item>
    <title>SVMOP:Projects: Still having problems with my interpolation on tideconvert.py</title>
    <pubDate>Sat, 07 Feb 2009 07:13:00 EDT</pubDate>
    <link>http://www.maperl.com/cgi-local/journal/2009/02/07#tides-090206-interpolation</link>
    <description>
&lt;p&gt;
I went ahead and hacked my tidePlot.py which will do comparisons of
time based data (using the timedate class). Using it to visually analyze my
interpolation (added as an option to tideconvert), I see that it still needs
work. The slope isn't right, and it doesn't catch all gaps in the data (right
side of image). 
&lt;a href=&quot;/Journal/Projects/interpolationComparison-04.png&quot;&gt;
&lt;img width=&quot;800&quot; src=&quot;/Journal/Projects/interpolationComparison-04.png&quot;&gt;
&lt;/img&gt;
&lt;/a&gt;</description>
  </item>
  <item>
    <title>SVMOP:Projects: From and To python datetime objects an UNIX time</title>
    <pubDate>Tue, 03 Feb 2009 21:29:00 EDT</pubDate>
    <link>http://www.maperl.com/cgi-local/journal/2009/02/03#tides-090203-time</link>
    <description>
&lt;p&gt;
from &lt;a href=&quot;http://seehuhn.de/pages/pdate&quot;&gt;http://seehuhn.de/pages/pdate&lt;/a&gt;

&lt;h2&gt;Conversion between Unix times and datetime&lt;/h2&gt;

&lt;p&gt;
To convert a Unix time stamp to datetime use the fromtimestamp constructor:
&lt;pre&gt;
 &gt;&gt;&gt; from datetime import datetime
 &gt;&gt;&gt; datetime.fromtimestamp(1172969203.1)
 datetime.datetime(2007, 3, 4, 0, 46, 43, 100000)
&lt;/pre&gt;
To convert a datetime object into a Unix time stamp, one has to first convert it into a struct_time:
&lt;pre&gt;
 &gt;&gt;&gt; from datetime import datetime
 &gt;&gt;&gt; from time import mktime
 &gt;&gt;&gt; t=datetime.now()
 &gt;&gt;&gt; mktime(t.timetuple())+1e-6*t.microsecond
 1172970859.472672
&lt;/pre&gt;

&lt;p&gt;
My example:
&lt;pre&gt;

In [26]: d1 = datetime.datetime.now()

In [27]: d1
Out[27]: datetime.datetime(2009, 2, 3, 21, 25, 4, 588232)

In [28]: time.time()
Out[28]: 1233714322.753165

In [29]: time.mktime(d1.timetuple()) + 1e-6 * d1.microsecond
Out[29]: 1233714304.588232

In [30]: 
&lt;/pre&gt;</description>
  </item>
  <item>
    <title>SVMOP:Projects: First task = Interpolating while converting</title>
    <pubDate>Tue, 03 Feb 2009 13:51:00 EDT</pubDate>
    <link>http://www.maperl.com/cgi-local/journal/2009/02/03#tides-090203-interpolation</link>
    <description>
&lt;p&gt;
My simplistic interpolation scheme was to count the number of 
contiguous bad source data lines and interpolate that many
points over the gap. I got what I planned, but more often than not,
the bad source spans many more sample points than bad lines caught.
&lt;img src=&quot;/Journal/Projects/interp-01.png&quot;&gt;&lt;/img&gt;

&lt;p&gt;
Now it looks as though I need to do a little analysis on the incoming
data to find an average sample rate, and find any spans that are above 
+/- 1 second of that rate. Then interpolate over the gap, and sample
the interpolation at the computed sample interval.
&lt;/p&gt;</description>
  </item>
  <item>
    <title>SVMOP:Projects: The Current Design of the Tides Processing Package</title>
    <pubDate>Fri, 30 Jan 2009 09:31:00 EDT</pubDate>
    <link>http://www.maperl.com/cgi-local/journal/2009/01/30#tides-090130-design</link>
    <description>
&lt;p&gt;
The current process design is:
&lt;img src=&quot;/Journal/Projects/TideProcessing.png&quot;&gt;&lt;/img&gt;
&lt;dl&gt;
&lt;dd&gt;&lt;b&gt;Convert from pressure to depth&lt;/b&gt;&lt;/dd&gt;
&lt;dt&gt;This process shows some gaps in the data, often small due to
hiccups in data transfer or data logging. During this process, the 
time will be converted to epoch time (seconds from January 1, 1970).
The gaps will be filled by interpolation. A byproduct of this stage is
the statitistics of missing data and interpreted data.&lt;/dt&gt;
&lt;dd&gt;Boxcar Filter with Sampling&lt;/dd&gt;
&lt;dt&gt;The filter will smooth the raw data, taking out jitter that might be
introduced by wind, waves, and wakes. This dataset is more dense than
is needed to meet the requirements of NOAA, therefore only a fraction
of the filtered data is output. The output has to align with the
times of NOAA data. The results of this stage will be used in two different
production paths: Offsets and Constituents. 
A byproduct of this stage is the statistical deviation of the raw 
data from the filtered data. &lt;/dt&gt;
&lt;dd&gt;&lt;b&gt;The two product paths&lt;/b&gt;&lt;/dd&gt;
&lt;dt&gt;
&lt;dl&gt;
&lt;dd&gt;&lt;b&gt;Offsets&lt;/b&gt;&lt;/dd&gt;
&lt;dt&gt;The stages off working offsets are:
&lt;ol&gt;
&lt;li&gt;Find peaks&lt;/li&gt;
&lt;li&gt;Find Mean Low Low Water&lt;/li&gt;
&lt;li&gt;Compare peaks to a primary station&lt;/li&gt;
&lt;li&gt;Produce offset and range value for predictions based on the primary station&lt;/li&gt;
&lt;/ol&gt;
&lt;dd&gt;&lt;b&gt;Constituents&lt;/b&gt;&lt;/dd&gt;
&lt;dt&gt;Using least-squares determination of constituents (the &lt;b&gt;tappy.py&lt;/b&gt;
program). Use the constituents to produce a tide predictor&lt;/dt&gt;
&lt;/dl&gt;
&lt;dd&gt;&lt;b&gt;Comparison&lt;/b&gt;&lt;/dd&gt;
&lt;dt&gt;The two prediction methods will be compared to new data as it goes through
the first two stages: Conversion and Filtering.&lt;/dt&gt;
&lt;/dl&gt;

&lt;p&gt;
 
&lt;/p&gt;</description>
  </item>
  <item>
    <title>SVMOP:Projects: The Tides Project - the begining</title>
    <pubDate>Sun, 25 Jan 2009 13:45:00 EDT</pubDate>
    <link>http://www.maperl.com/cgi-local/journal/2009/01/25#tides-090125-begining</link>
    <description>
&lt;p&gt;
CCOM operates several tide stations. The three that are most likely to
be recording data are: 
&lt;UL&gt;
&lt;LI&gt;Jackson Estuarine Lab at Fuber Straights, Great Bay, New Hampsire
&lt;LI&gt;US Coast Guard Station, Fort Point, New Castle, New Hampshire
&lt;LI&gt;Maine Maritime Academy, Castine, Maine
&lt;/UL&gt;

&lt;p&gt;
The last of these is generating the most complete data set, but has
only been in operation since the summer of 2008.
&lt;/p&gt;

&lt;p&gt;
What we want to achieve is the ability to do  predictive tides and
compare to actual tides. 
&lt;/p&gt;

&lt;p&gt;
I have done this before on the Jackson Lab data using the Perl
programming language, but it was for a single evaluation of time
offset and amplitude factor with reference to the NOAA Portland
primary station (used for the Portsmouth area tides, as well).
&lt;/p&gt;

&lt;p&gt;
Since our prefered programming language is Python, I will probably
focus on Python tools, such as &lt;a
href=&quot;http://apps.sourceforge.net/mediawiki/tappy/index.php?title=Main_Page&quot;&gt;tappy.py&lt;/a&gt;
by Tim Cera of &lt;a href=&quot;http://www.sjrwmd.com&quot;&gt;The St. John's River
Water Management District&lt;/a&gt;. Tappy uses the Least Squares method of
finding tidal constituents.
&lt;/p&gt;

&lt;p&gt;
I will probably use Python's &lt;a
href=&quot;http://matplotlib.sourceforge.net/&quot;&gt;matplot&lt;/a&gt; for data
visualization. There also exist some rather serious math modules for
Python, e.g., &lt;a href=&quot;http://numpy.scipy.org/&quot;&gt;numpy&lt;/a&gt; and &lt;a
href=&quot;http://www.scipy.org/&quot;&gt;scipy&lt;/a&gt;. (Both are used by tappy.)
&lt;/p&gt;

&lt;p&gt;
The public result of this work will be web access to data and predictions. I
also hope to have some fairly easy-to-use tools for working with tide data,
particularly for doing bathymetric surveying.
&lt;/p&gt;</description>
  </item>
  <item>
    <title>SVMOP:Projects: VOS Tracking Project Coming to an End</title>
    <pubDate>Sun, 25 Jan 2009 13:42:00 EDT</pubDate>
    <link>http://www.maperl.com/cgi-local/journal/2009/01/25#VSTP-090125</link>
    <description>
&lt;p&gt;
I have been negligent in posting the process of buiding the last
bit, the data visualization bit, on this project. But you will
be able to read all about it in a forthcoming PowerPoint Presentation
that I will post here.
&lt;/p&gt;

&lt;p&gt;
The results are a set of several hundred Google Earth kmz files. You
can access the top of the data at &lt;a
href=&quot;http://nrwais2.schwehr.org&quot;&gt;Kurt's Developement Web Site&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
Now it is time to start the next project: TIDES
&lt;/p&gt;</description>
  </item>
  <item>
    <title>SVMOP:Projects: Wouldn't it be nice to just have a color attribute</title>
    <pubDate>Sun, 21 Dec 2008 21:52:00 EDT</pubDate>
    <link>http://www.maperl.com/cgi-local/journal/2008/12/21#VSTP=081221-color</link>
    <description>
&lt;p&gt;
As pristine an XML implementation as KML is, I feel
that giving an object some attributes rather than having
to only use separate style objects would make use color
so much easier.
&lt;/p&gt;

&lt;p&gt;
I have taken Kurt's first pass on generating KML from the
database and added the time field in a timespan attribute
to linestrings.
&lt;/p&gt;

&lt;p&gt;
I still have a long way to go to know what elements and
attributes fit where in KML.
&lt;/p&gt;</description>
  </item>
  </channel>
</rss>