Typically the node factor from the middle of the time series is used for tidal analysis. This is fine for relatively short time series. TAPPy actually calculates the node factor for each point in the time series and is therefore suited to long time series. TAPPy will also only report the tidal constituents that can be resolved based on the length of the input time series. [TOC] Input Data ---------- The input data can be in almost any text form as long as each line has either (‘year’, ‘month’, ‘day’, ‘hour’, optional[‘minute’, ‘second’]) OR a single real or integer number representing time since an origin, and ‘water elevation’. Time can be to any standard, though UTC is preferred. TAPPy will maintain the input time throughout the analysis, but the only way to calculate phases to compare against other tidal constituents is to use UTC. The units for the water elevation can be anything and the output amplitude will be in the input units. Definition File --------------- The glue that binds the input format to TAPPy is a definition file. It is easy to understand and implement. Basically it tells TAPPy how to parse the input data file. Delimiters and white space are ignored, actually anything in the way of TAPPy finding the next value is ignored. The definition file is a Python file (though with a .def extension) that specifies the order that values can be found on each line. Two variables are set within the definition file, ‘decimal_sep’ and ‘parse’. The ‘decimal_sep’ is set to the separator that marks the decimal part of a real number. In most of Europe this would be a “,” whereas for the United States it is a “.”. The ‘parse’ variable is where the magic happens. It is an ordered list of Python functions that retrieve and name values from each line in the order specified. TAPPy requires the following named values; ‘water_level’, and either ‘datetime’ or the group of (‘year’, ‘month’, ‘day’, ‘hour’, ‘minute’, ‘second’). If the later selection to define the time stamp is used and ‘minute’ and ‘second’ are not specified they are both set to zero. All other names (like ‘state’ and ‘station’ in the example below) are parsed, but ignored by TAPPy. Example Definition File ~~~~~~~~~~~~~~~~~~~~~~~ .. raw:: html
Definition File .. raw:: html | .. raw:: htmlMatching Data File .. raw:: html | .. raw:: html
---|---|
You need to specify the separator between ========================================= the integer part and the decimal ================================ part of real numbers, even if you only ====================================== have integers in your data file. ================================ decimal_sep = “.” # TAPPy needs the variables ‘year’, ‘month’, # ‘day’, ‘hour’, ‘minute’, ‘water_level’. # Any other variable name can be used as a # placeholder. parse = [ integer(‘state’, exact=3), integer_as_string(‘station’, exact=4), positive_integer(‘year’, exact=4), positive_integer(‘month’, exact=2), positive_integer(‘day’, exact=2), positive_integer(‘hour’), positive_integer(‘minute’), positive_integer(‘toss’), real(‘water_level’), ] .. raw:: html | .. raw:: htmlStation Date Time Pred 6 Vrfy 6 DCP#: 1 Units: Feet Feet Data%: MLLW GMT 100.00 100.00 Maximum: 5.00 Minimum: -0.91 "“——- ——– —– ——- ——-”" 8721604 20061109 00:00 2.03 2.23 8721604 20061109 00:06 2.11 2.32 8721604 20061109 00:12 2.19 2.38 8721604 20061109 00:18 2.28 2.41 8721604 20061109 00:24 2.36 2.55 … .. raw:: html | .. raw:: html