<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.e-ecology.nl/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bart</id>
		<title>ecology - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.e-ecology.nl/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bart"/>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php/Special:Contributions/Bart"/>
		<updated>2026-04-06T10:08:31Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=375</id>
		<title>UvAGPS</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=375"/>
				<updated>2011-01-12T13:48:38Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* UVA_TRACKING_SPEED or UVA_TRACKING_SPEED_LIMITED */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= UvAGPS Data Model =&lt;br /&gt;
&lt;br /&gt;
For different versions of the UvAGPS firmware different tables are used. For firmware version v0.9.3.6 till v1.0.0.X the tables UVA_ENGINEERING_DATA and UVA_TRACKING_DATA are used. But in the new firmware versions 1.0.1.4 till 1.0.2.4 so much information was added  that new tables were introduced. However for the most important tracking tables a view is created so that all similar tracking for all types of firmware can be seen in one view. That is the UVA_TRACKING view. &lt;br /&gt;
&lt;br /&gt;
All tables, views and functions are also in the GPS schema.&lt;br /&gt;
&lt;br /&gt;
Not everybody has access to all data.  For most users access is limited to &amp;quot;limited&amp;quot; views that only give access to selected devices. &lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA or UVA_TRACKING_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float8||||||Horizontal accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float8||||||Vertical accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||float8||||||m&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration||Float8||||||x axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) movement to right is + and to left is -&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration||Float8||||||y axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) forward movement is + and backwards is -&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration||Float8||||||z axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) upwards movement is + downwards is -&lt;br /&gt;
|-&lt;br /&gt;
|speed ||float8||||||m/s&lt;br /&gt;
|-&lt;br /&gt;
|course||float8||||||Degrees&lt;br /&gt;
|-&lt;br /&gt;
|pressure||float8||||||Pressure sensor (pascal)&lt;br /&gt;
|-&lt;br /&gt;
|temperature||Float8||||||Degrees celcius&lt;br /&gt;
|-&lt;br /&gt;
|solar_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|battery_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|userflag||Integer||||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|  “&amp;quot;location”&amp;quot;||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENGINEERING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Engineering data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|t_syncsts||smallint||||||0: not synced, 1: user synced, 2: Gps synced&lt;br /&gt;
|-&lt;br /&gt;
|t_entzt||smallint||||||0: UCT time,1: TZT time (timezone time)&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentrategps||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratecom||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratepwr||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagesolarpanel||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagebattery||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_chargemode||int2||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainrategps||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratecom||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratepwr||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_esavegpsrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_esavecomrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsnavigationmode||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtimeout||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|eh||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_DEVICE or UVA_DEVICE_LIMITED == &lt;br /&gt;
&lt;br /&gt;
To be able to track the different firmware versions and specific properties for the different devices the UVA_DEVICE table was added. This table also includes essential information needed to calibrate the accelerometers. For more information see [[UvAGPS|Accelerometer calibration]]&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL || Serial number of tag&lt;br /&gt;
|- &lt;br /&gt;
| firmware_version || text |||| NOT NULL || Firmware version installed on tag&lt;br /&gt;
|-&lt;br /&gt;
| device_mass || double |||||||Mass of tag (g)&lt;br /&gt;
|-&lt;br /&gt;
| x_s|| double |||||||Calibration sensitivity of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_s|| double |||||||Calibration sensitivity of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_s|| double |||||||Calibration sensitivity of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
| x_o|| double |||||||Calibration offset of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_o|| double |||||||Calibration offset of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_o|| double |||||||Calibration offset of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_COMM101 or UVA_COMM_LIMITED== &lt;br /&gt;
&lt;br /&gt;
Communication table indicates status and result of communications with ground stations. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
| date_time || timestamp || PK || NOT NULL || timestamp of start communication&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end || timestamp |||||| timestamp of end communication           &lt;br /&gt;
|-&lt;br /&gt;
| date_time_utc || timestamp |||||| date_time in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end_utc || timestamp |||||| date_time_end in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| action || text|||||| JOINED / RESCHEDULE  ??&lt;br /&gt;
|-&lt;br /&gt;
| bytes_communicated || integer |||||| Number of bytes communicated (total of all bytes per DATA line)  &lt;br /&gt;
|-&lt;br /&gt;
|status || text |||||| READY, TIMEOUT, LOWPOWER, MISSING&lt;br /&gt;
|-&lt;br /&gt;
| network_join_time || integer||||||milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| number_identical_lines || integer |||||| Number identical lines in data block. Gives indication &lt;br /&gt;
|-&lt;br /&gt;
| non_ascii_char || integer |||||| Number of non ascii characters (indicated by question-mark ?)&lt;br /&gt;
|-&lt;br /&gt;
| sts_time || timestamp |||||| derived from S0 hh,mi&lt;br /&gt;
|-&lt;br /&gt;
| timesynced || smallint|||||| TimeSynced (0=not sy:wnced, 1=user set, 2=Gps Synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode || smallint||||||DeviceMode (0-99)&lt;br /&gt;
|-&lt;br /&gt;
| vbat || float |||||| Battery voltage in V (0-~4.200V) &lt;br /&gt;
|-&lt;br /&gt;
|logb || integer |||||| logged bytes, waiting for download (0-4Mbyte)&lt;br /&gt;
|-&lt;br /&gt;
| logp || smallint |||||| Logged percentage (units 0.1%) of memory waiting to be downloaded (0-1000)&lt;br /&gt;
|-&lt;br /&gt;
| gpsii || integer |||||| GpsIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|comii || integer|||||| ComIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| AcceleroIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| User switches, current (0-65535) &lt;br /&gt;
|-&lt;br /&gt;
|last_gps_fix ||timestamp||||||timestamp of last fix&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||Latitude of last fix. Decimal degrees &lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||Longitude of last fix. Decimal degrees&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_SETTINGS101 or UVA_SETTINGS_LIMITED  == &lt;br /&gt;
&lt;br /&gt;
Settings are either from C0-C1-C9 lines or parsed from uplink communication lines &lt;br /&gt;
If C0-C1 is parsed its values are compared with the previous value and if the settings are the &lt;br /&gt;
same no new records needs to be added &lt;br /&gt;
If uplink settings are parsed wait till the last setting has been seen, (DL command or EOF) &lt;br /&gt;
then store all the new settings in one record. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||Derive timestamp from Hh:mi fields in C0 combined with computer timestamp in JOINED line&lt;br /&gt;
|-&lt;br /&gt;
|timesynced || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|timezone_time || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| SpecialUserSwitches &lt;br /&gt;
|-&lt;br /&gt;
|gpsnavmode || smallint|||||| GpsNavMode 0-7&lt;br /&gt;
|-&lt;br /&gt;
|gpsreceivermode || smallint |||||| GpsReceiverNode 0-3&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtime || smallint|||||| GpsFixTime 0-255&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_h || smallint|||||| hours Gps IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_m || smallint|||||| minutes Gps IvalN on &lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln  || integer|||||| GpsIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_h || smallint|||||| hours Gps IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_m || smallint|||||| minutes GpS IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale  || integer|||||| GpsIvalE &lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_h || smallint|||||| hours Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_m || smallint|||||| minutes Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln || integer|||||| ComIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_h || smallint|||||| hours Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_m || smallint|||||| minutes Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale || integer|||||| ComIvalE&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| Accelero measurement interval         &lt;br /&gt;
|-&lt;br /&gt;
|accbn || integer|||||| Accelero number of blocks &lt;br /&gt;
|-&lt;br /&gt;
|accsn || integer|||||| Accelero number of samples (0-65536)&lt;br /&gt;
|-&lt;br /&gt;
|f || smallint||||||Accelero sample frequency  (0=20Hz, 1=10Hz, 2=5Hz, 3=1Hz)&lt;br /&gt;
|-&lt;br /&gt;
|pdp || smallint|||||| PdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|pac||smallint|||||| PaccMsk (10-100)&lt;br /&gt;
|-&lt;br /&gt;
|tdp ||smallint|||||| TdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|tac ||smallint|||||| TaccMsk (30-300)&lt;br /&gt;
|-&lt;br /&gt;
|ga || smallint|||||| Additional Fixes GpsIval mode (3-25) before interval fix is logged&lt;br /&gt;
|-&lt;br /&gt;
|aol || smallint||||||AccMemOffLev (100 - 950) units 0.1%; if Memfull above  this level all Accelero activity will be overruled and switched off untill MemFull &amp;lt; level - 5&lt;br /&gt;
|-&lt;br /&gt;
|eventnum || text|||||| 12 eventnumbers (0-0xff) only printed if not zero, therfore converted to text&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA101 or UVA_TRACKING_LIMITED==&lt;br /&gt;
&lt;br /&gt;
The tracking dat for newer firmware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||integer||||||heigth above sealevel meters&lt;br /&gt;
|-&lt;br /&gt;
|pressure ||integer||||||in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature ||float||||||in celcius degrees&lt;br /&gt;
|-&lt;br /&gt;
|satellites_used ||smallint||||||satellites used for fix &lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime ||float||||||GpsFixTime in seconds &lt;br /&gt;
|-&lt;br /&gt;
|positiondop ||float||||||Position DOP in units&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy || float||||||Horizontal accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy || float||||||Vertical accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|x_speed ||float||||||Speed in x-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|y_speed ||float||||||Speed in y-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|z_speed ||float||||||Speed in z-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|speed_accuracy || float||||||Speed accuracy (m/s) &lt;br /&gt;
|-&lt;br /&gt;
|userflag||Integer||||||Data flagged as unacceptable by user if not 0&lt;br /&gt;
|-&lt;br /&gt;
|location || geometry |||||| lat/long as PostGIS geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ACC_START102 or UVA_ACC_START_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
General acceleration entry associated with a set of accelerations. Added in Firmware 1.0.2.7 because there line numbers were introduced for acceleration lines so that these lines can be tracked.  &lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|line_counter||integer||||||Number of lines associated with this set of accelerations&lt;br /&gt;
|-&lt;br /&gt;
|timesynced||smallint||||||TimeSynced (0=not synced, 1=user set, 2=Gps Synced)&lt;br /&gt;
|-&lt;br /&gt;
|accii||integer||||||Accelero measurement interval&lt;br /&gt;
|-&lt;br /&gt;
|accsn||integer||||||Number of samples (0-65536)&lt;br /&gt;
|-&lt;br /&gt;
|f||smallint||||||Accelero sample frequency (0=20Hz, 1=10Hz, 2=5Hz, 3=1Hz)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_ACCELERATION101 or UVA_ACCELERATION_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Acceleration entries if accelerometer was turned on. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|index ||smallint||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration ||smallint||||||acceleration in X-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration ||smallint||||||acceleration in Y-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration ||smallint||||||acceleration in Z-axis (-2666 till 2666)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENERGY101 or UVA_ENERGY_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|timesynced ||smallint||||||TimeSynced (0=not synced, 1=user set, 2=Gps synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode ||smallint||||||(0-99)&lt;br /&gt;
|-&lt;br /&gt;
|vsll ||float||||||Solar Voltage during charging in mV (0-~2500)&lt;br /&gt;
|-&lt;br /&gt;
|vbat ||float||||||Battery Voltage in V (0-~4.200)&lt;br /&gt;
|-&lt;br /&gt;
|ssw ||smallint|||||| Solar Cell Switches ... (0-255) fw1022 and up &lt;br /&gt;
|-&lt;br /&gt;
| ||||||||extended fields if special user switch is on &lt;br /&gt;
|-&lt;br /&gt;
|vsoo ||float|||||| Solar voltage open in V (0-~2.500)&lt;br /&gt;
|-&lt;br /&gt;
|vdrf ||float||||||reference voltage Dac in V (0-~2.435)&lt;br /&gt;
|-&lt;br /&gt;
|vchr ||float||||||charge current voltage&lt;br /&gt;
|-&lt;br /&gt;
|g ||smallint|||||| Gps battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|c || smallint||||||Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|m || smallint||||||Charge Mode (0,1,2 Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|pressure || integer|||||| in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature || float|||||| in celcius degrees   &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING  or UVA_TRACKING_LIMITED == &lt;br /&gt;
&lt;br /&gt;
View to show identical fields for older and newer firmware tracking data&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|altitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|pressure||integer|||||&lt;br /&gt;
|-&lt;br /&gt;
|temperature||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|x_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|y_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|z_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|userflag||integer||||||Flagged as inacceptable by user if not 0&lt;br /&gt;
|-&lt;br /&gt;
|satellites_used||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|positiondop||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|speed_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|location||geometry||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_SPEED or UVA_TRACKING_SPEED_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Additional view that computes with the x_speed, y_speed and z_speed components the vnorth, veast and vdown speed components as well as the absolute value speed in meters/second. &lt;br /&gt;
&lt;br /&gt;
In addition to the fields in the UVA_TRACKING view this view adds :&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|vnorth||float||||||- vx * sin(lat) * cos(long) - vy * sin(lat) * sin (long) + vz * cos(lat)&lt;br /&gt;
|-&lt;br /&gt;
|veast||float|||||| - vx * sin(lon) + vy * cos(lon)&lt;br /&gt;
|-&lt;br /&gt;
|vdown||float|||||| - vx * cos(lat) * cos(lon) - vy * cos(lat) * sin(lon) - vz * sin(lat)&lt;br /&gt;
|-&lt;br /&gt;
|speed||float|||||| sqrt(vx^2 + vy^2 + vz^2)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_WARNING102 or UVA_WARNING_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Since firmware version 1.0.2.7 this table was added as catchall for tags that don occur very often (C10, C20) or errors that occur during parsing. &lt;br /&gt;
For example all CRC failures can be selected with : &lt;br /&gt;
&lt;br /&gt;
  select * from gps.uva_warning102 &lt;br /&gt;
  where warning = 'CRC8 failure'&lt;br /&gt;
  order by device_info_serial;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||integer||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|filename||text||PK||NOT NULL||UvAGPS log filename &lt;br /&gt;
|-&lt;br /&gt;
|linenumber||integer||PK||NOT NULL||linenumber in file &lt;br /&gt;
|-&lt;br /&gt;
|warning||text||||||The warming message or tag&lt;br /&gt;
|-&lt;br /&gt;
|line||text||||||The actual line in the file &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= UvAGPS functions =&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_speed ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters), time-interval, speed (meters/second) and heading (degrees) for a series of subsequent tracking entries with specific device_info_serial.&lt;br /&gt;
For the first entry in the sequence these values will always be missing because they are computed  as the difference between subsequent rows.&lt;br /&gt;
&lt;br /&gt;
Usage examples :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119);&lt;br /&gt;
&lt;br /&gt;
select t.*, a.distance, a.interval, a.speed, a.direction from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00') a join gps.uva_tracking t using(device_info_serial, date_time);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and heading are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. &lt;br /&gt;
The heading is the initial heading. PostGIS does not calculate the heading, so therefore we don't use PostGIS.&lt;br /&gt;
&lt;br /&gt;
In these functions the records that have been flagged as invalid by setting the '''userflag''' are not token into account and discarded. &lt;br /&gt;
If it is required get the speed for all records  a additional boolean argument for '''get raw data''' can be given. i.e.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00', true);&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, true);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) for UvAGPS tracks to arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, 52.1897017, 6.1996606); &lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, (select location from gps.uva_tracking where device_info_serial = 119 and date_time = '2009-05-07 19:55:08')); &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the distance is calculated with the PostGIS distance_sphere function which uses spherical correction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance_direction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) and direction (degrees) for UvAGPS tracks from arbitrary point in lat/long or geometry location&lt;br /&gt;
&lt;br /&gt;
Example usage: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and direction are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. The direction is the direction from the given point.&lt;br /&gt;
&lt;br /&gt;
In this function the records where the '''userflag''' has been set are discarded. To see  these records a additional boolean argument for '''show raw data''' should  be added like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606, true); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Accelerometer calibration =&lt;br /&gt;
&lt;br /&gt;
The accelerometer measures the acceleration in 3D (20 times per second). Acceleration is caused by gravity (static component) and by a change in speed (dynamic component). &lt;br /&gt;
When the logger is static in horizontal position (solar cells up), gravity (green arrow) shows a  heave (vertical acceleration, z) of +1 g (1 g = 9.81 m.s&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;) while surge and heave are both 0. When the front of the logger is vertically pointing down (forward acceleration, x), surge is +1g and when it is rolled to the right (sidewards acceleration, y) sway is +1g. Due to gravity, the pitch of a logger is thus translated into the values of heave, surge and sway (or z, x, y).&lt;br /&gt;
&lt;br /&gt;
However, the values are measured in mV instead of g. Before delivering the GPS-loggers, they have been calibrated at UvA. The acceleration (A) expressed in g is calculated from the measured value (M) and the calibration factors offset (''O'') and sensitivity (''S'').&lt;br /&gt;
&lt;br /&gt;
Thus acceleration for heave (z), surge (x) and sway (y) is calculated as:&lt;br /&gt;
A&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; ;      A&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;;      A&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; ; &lt;br /&gt;
&lt;br /&gt;
The values of ''O'' (in general ranging from 0-60, sometimes even 300) and ''S'' (ranging from 1300-1450) are available in the device table of the data base. If not available, use the factory defaults ''O'' = 0 and ''S'' = 1365.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:accelero1.png|300px]]||[[File:accelero2.png|300px]]|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the figure above heave (z) is shown in green, surge(x) in red and sway (y) in blue, all values are expressed in g (on the y-axis).&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=374</id>
		<title>UvAGPS</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=374"/>
				<updated>2011-01-12T13:35:09Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* UVA_ACCELERATION101 or UVA_ACCELERATION_LIMITED */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= UvAGPS Data Model =&lt;br /&gt;
&lt;br /&gt;
For different versions of the UvAGPS firmware different tables are used. For firmware version v0.9.3.6 till v1.0.0.X the tables UVA_ENGINEERING_DATA and UVA_TRACKING_DATA are used. But in the new firmware versions 1.0.1.4 till 1.0.2.4 so much information was added  that new tables were introduced. However for the most important tracking tables a view is created so that all similar tracking for all types of firmware can be seen in one view. That is the UVA_TRACKING view. &lt;br /&gt;
&lt;br /&gt;
All tables, views and functions are also in the GPS schema.&lt;br /&gt;
&lt;br /&gt;
Not everybody has access to all data.  For most users access is limited to &amp;quot;limited&amp;quot; views that only give access to selected devices. &lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA or UVA_TRACKING_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float8||||||Horizontal accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float8||||||Vertical accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||float8||||||m&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration||Float8||||||x axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) movement to right is + and to left is -&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration||Float8||||||y axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) forward movement is + and backwards is -&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration||Float8||||||z axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) upwards movement is + downwards is -&lt;br /&gt;
|-&lt;br /&gt;
|speed ||float8||||||m/s&lt;br /&gt;
|-&lt;br /&gt;
|course||float8||||||Degrees&lt;br /&gt;
|-&lt;br /&gt;
|pressure||float8||||||Pressure sensor (pascal)&lt;br /&gt;
|-&lt;br /&gt;
|temperature||Float8||||||Degrees celcius&lt;br /&gt;
|-&lt;br /&gt;
|solar_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|battery_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|userflag||Integer||||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|  “&amp;quot;location”&amp;quot;||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENGINEERING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Engineering data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|t_syncsts||smallint||||||0: not synced, 1: user synced, 2: Gps synced&lt;br /&gt;
|-&lt;br /&gt;
|t_entzt||smallint||||||0: UCT time,1: TZT time (timezone time)&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentrategps||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratecom||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratepwr||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagesolarpanel||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagebattery||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_chargemode||int2||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainrategps||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratecom||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratepwr||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_esavegpsrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_esavecomrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsnavigationmode||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtimeout||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|eh||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_DEVICE or UVA_DEVICE_LIMITED == &lt;br /&gt;
&lt;br /&gt;
To be able to track the different firmware versions and specific properties for the different devices the UVA_DEVICE table was added. This table also includes essential information needed to calibrate the accelerometers. For more information see [[UvAGPS|Accelerometer calibration]]&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL || Serial number of tag&lt;br /&gt;
|- &lt;br /&gt;
| firmware_version || text |||| NOT NULL || Firmware version installed on tag&lt;br /&gt;
|-&lt;br /&gt;
| device_mass || double |||||||Mass of tag (g)&lt;br /&gt;
|-&lt;br /&gt;
| x_s|| double |||||||Calibration sensitivity of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_s|| double |||||||Calibration sensitivity of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_s|| double |||||||Calibration sensitivity of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
| x_o|| double |||||||Calibration offset of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_o|| double |||||||Calibration offset of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_o|| double |||||||Calibration offset of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_COMM101 or UVA_COMM_LIMITED== &lt;br /&gt;
&lt;br /&gt;
Communication table indicates status and result of communications with ground stations. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
| date_time || timestamp || PK || NOT NULL || timestamp of start communication&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end || timestamp |||||| timestamp of end communication           &lt;br /&gt;
|-&lt;br /&gt;
| date_time_utc || timestamp |||||| date_time in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end_utc || timestamp |||||| date_time_end in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| action || text|||||| JOINED / RESCHEDULE  ??&lt;br /&gt;
|-&lt;br /&gt;
| bytes_communicated || integer |||||| Number of bytes communicated (total of all bytes per DATA line)  &lt;br /&gt;
|-&lt;br /&gt;
|status || text |||||| READY, TIMEOUT, LOWPOWER, MISSING&lt;br /&gt;
|-&lt;br /&gt;
| network_join_time || integer||||||milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| number_identical_lines || integer |||||| Number identical lines in data block. Gives indication &lt;br /&gt;
|-&lt;br /&gt;
| non_ascii_char || integer |||||| Number of non ascii characters (indicated by question-mark ?)&lt;br /&gt;
|-&lt;br /&gt;
| sts_time || timestamp |||||| derived from S0 hh,mi&lt;br /&gt;
|-&lt;br /&gt;
| timesynced || smallint|||||| TimeSynced (0=not sy:wnced, 1=user set, 2=Gps Synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode || smallint||||||DeviceMode (0-99)&lt;br /&gt;
|-&lt;br /&gt;
| vbat || float |||||| Battery voltage in V (0-~4.200V) &lt;br /&gt;
|-&lt;br /&gt;
|logb || integer |||||| logged bytes, waiting for download (0-4Mbyte)&lt;br /&gt;
|-&lt;br /&gt;
| logp || smallint |||||| Logged percentage (units 0.1%) of memory waiting to be downloaded (0-1000)&lt;br /&gt;
|-&lt;br /&gt;
| gpsii || integer |||||| GpsIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|comii || integer|||||| ComIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| AcceleroIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| User switches, current (0-65535) &lt;br /&gt;
|-&lt;br /&gt;
|last_gps_fix ||timestamp||||||timestamp of last fix&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||Latitude of last fix. Decimal degrees &lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||Longitude of last fix. Decimal degrees&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_SETTINGS101 or UVA_SETTINGS_LIMITED  == &lt;br /&gt;
&lt;br /&gt;
Settings are either from C0-C1-C9 lines or parsed from uplink communication lines &lt;br /&gt;
If C0-C1 is parsed its values are compared with the previous value and if the settings are the &lt;br /&gt;
same no new records needs to be added &lt;br /&gt;
If uplink settings are parsed wait till the last setting has been seen, (DL command or EOF) &lt;br /&gt;
then store all the new settings in one record. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||Derive timestamp from Hh:mi fields in C0 combined with computer timestamp in JOINED line&lt;br /&gt;
|-&lt;br /&gt;
|timesynced || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|timezone_time || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| SpecialUserSwitches &lt;br /&gt;
|-&lt;br /&gt;
|gpsnavmode || smallint|||||| GpsNavMode 0-7&lt;br /&gt;
|-&lt;br /&gt;
|gpsreceivermode || smallint |||||| GpsReceiverNode 0-3&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtime || smallint|||||| GpsFixTime 0-255&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_h || smallint|||||| hours Gps IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_m || smallint|||||| minutes Gps IvalN on &lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln  || integer|||||| GpsIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_h || smallint|||||| hours Gps IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_m || smallint|||||| minutes GpS IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale  || integer|||||| GpsIvalE &lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_h || smallint|||||| hours Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_m || smallint|||||| minutes Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln || integer|||||| ComIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_h || smallint|||||| hours Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_m || smallint|||||| minutes Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale || integer|||||| ComIvalE&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| Accelero measurement interval         &lt;br /&gt;
|-&lt;br /&gt;
|accbn || integer|||||| Accelero number of blocks &lt;br /&gt;
|-&lt;br /&gt;
|accsn || integer|||||| Accelero number of samples (0-65536)&lt;br /&gt;
|-&lt;br /&gt;
|f || smallint||||||Accelero sample frequency  (0=20Hz, 1=10Hz, 2=5Hz, 3=1Hz)&lt;br /&gt;
|-&lt;br /&gt;
|pdp || smallint|||||| PdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|pac||smallint|||||| PaccMsk (10-100)&lt;br /&gt;
|-&lt;br /&gt;
|tdp ||smallint|||||| TdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|tac ||smallint|||||| TaccMsk (30-300)&lt;br /&gt;
|-&lt;br /&gt;
|ga || smallint|||||| Additional Fixes GpsIval mode (3-25) before interval fix is logged&lt;br /&gt;
|-&lt;br /&gt;
|aol || smallint||||||AccMemOffLev (100 - 950) units 0.1%; if Memfull above  this level all Accelero activity will be overruled and switched off untill MemFull &amp;lt; level - 5&lt;br /&gt;
|-&lt;br /&gt;
|eventnum || text|||||| 12 eventnumbers (0-0xff) only printed if not zero, therfore converted to text&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA101 or UVA_TRACKING_LIMITED==&lt;br /&gt;
&lt;br /&gt;
The tracking dat for newer firmware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||integer||||||heigth above sealevel meters&lt;br /&gt;
|-&lt;br /&gt;
|pressure ||integer||||||in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature ||float||||||in celcius degrees&lt;br /&gt;
|-&lt;br /&gt;
|satellites_used ||smallint||||||satellites used for fix &lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime ||float||||||GpsFixTime in seconds &lt;br /&gt;
|-&lt;br /&gt;
|positiondop ||float||||||Position DOP in units&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy || float||||||Horizontal accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy || float||||||Vertical accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|x_speed ||float||||||Speed in x-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|y_speed ||float||||||Speed in y-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|z_speed ||float||||||Speed in z-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|speed_accuracy || float||||||Speed accuracy (m/s) &lt;br /&gt;
|-&lt;br /&gt;
|userflag||Integer||||||Data flagged as unacceptable by user if not 0&lt;br /&gt;
|-&lt;br /&gt;
|location || geometry |||||| lat/long as PostGIS geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ACC_START102 or UVA_ACC_START_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
General acceleration entry associated with a set of accelerations. Added in Firmware 1.0.2.7 because there line numbers were introduced for acceleration lines so that these lines can be tracked.  &lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|line_counter||integer||||||Number of lines associated with this set of accelerations&lt;br /&gt;
|-&lt;br /&gt;
|timesynced||smallint||||||TimeSynced (0=not synced, 1=user set, 2=Gps Synced)&lt;br /&gt;
|-&lt;br /&gt;
|accii||integer||||||Accelero measurement interval&lt;br /&gt;
|-&lt;br /&gt;
|accsn||integer||||||Number of samples (0-65536)&lt;br /&gt;
|-&lt;br /&gt;
|f||smallint||||||Accelero sample frequency (0=20Hz, 1=10Hz, 2=5Hz, 3=1Hz)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_ACCELERATION101 or UVA_ACCELERATION_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Acceleration entries if accelerometer was turned on. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|index ||smallint||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration ||smallint||||||acceleration in X-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration ||smallint||||||acceleration in Y-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration ||smallint||||||acceleration in Z-axis (-2666 till 2666)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENERGY101 or UVA_ENERGY_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|timesynced ||smallint||||||TimeSynced (0=not synced, 1=user set, 2=Gps synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode ||smallint||||||(0-99)&lt;br /&gt;
|-&lt;br /&gt;
|vsll ||float||||||Solar Voltage during charging in mV (0-~2500)&lt;br /&gt;
|-&lt;br /&gt;
|vbat ||float||||||Battery Voltage in V (0-~4.200)&lt;br /&gt;
|-&lt;br /&gt;
|ssw ||smallint|||||| Solar Cell Switches ... (0-255) fw1022 and up &lt;br /&gt;
|-&lt;br /&gt;
| ||||||||extended fields if special user switch is on &lt;br /&gt;
|-&lt;br /&gt;
|vsoo ||float|||||| Solar voltage open in V (0-~2.500)&lt;br /&gt;
|-&lt;br /&gt;
|vdrf ||float||||||reference voltage Dac in V (0-~2.435)&lt;br /&gt;
|-&lt;br /&gt;
|vchr ||float||||||charge current voltage&lt;br /&gt;
|-&lt;br /&gt;
|g ||smallint|||||| Gps battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|c || smallint||||||Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|m || smallint||||||Charge Mode (0,1,2 Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|pressure || integer|||||| in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature || float|||||| in celcius degrees   &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING  or UVA_TRACKING_LIMITED == &lt;br /&gt;
&lt;br /&gt;
View to show identical fields for older and newer firmware tracking data&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|altitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|pressure||integer|||||&lt;br /&gt;
|-&lt;br /&gt;
|temperature||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|x_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|y_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|z_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|userflag||integer||||||Flagged as inacceptable by user if not 0&lt;br /&gt;
|-&lt;br /&gt;
|satellites_used||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|positiondop||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|speed_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|location||geometry||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_SPEED or UVA_TRACKING_SPEED_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Additional view that computes with the x_speed, y_speed and z_speed components the vnorth, veast and vdown speed components as well as the absolute value speed in meters/second. &lt;br /&gt;
&lt;br /&gt;
In addition to the fields in the UVA_TRACKING view this view adds :&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|vnorth||float||||||- vx * sin(lat) * cos(long) - vy * sin(lat) * sin (long) + vz * cos(lat)&lt;br /&gt;
|-&lt;br /&gt;
|veast||float|||||| - vx * sin(lon) + vy * cos(lon)&lt;br /&gt;
|-&lt;br /&gt;
|vdown||float|||||| - vx * cos(lat) * cos(lon) - vy * cos(lat) * sin(lon) - vz * sin(lat)&lt;br /&gt;
|-&lt;br /&gt;
|speed||float|||||| sqrt(vx^2 + vy^2 + vz^2)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= UvAGPS functions =&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_speed ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters), time-interval, speed (meters/second) and heading (degrees) for a series of subsequent tracking entries with specific device_info_serial.&lt;br /&gt;
For the first entry in the sequence these values will always be missing because they are computed  as the difference between subsequent rows.&lt;br /&gt;
&lt;br /&gt;
Usage examples :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119);&lt;br /&gt;
&lt;br /&gt;
select t.*, a.distance, a.interval, a.speed, a.direction from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00') a join gps.uva_tracking t using(device_info_serial, date_time);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and heading are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. &lt;br /&gt;
The heading is the initial heading. PostGIS does not calculate the heading, so therefore we don't use PostGIS.&lt;br /&gt;
&lt;br /&gt;
In these functions the records that have been flagged as invalid by setting the '''userflag''' are not token into account and discarded. &lt;br /&gt;
If it is required get the speed for all records  a additional boolean argument for '''get raw data''' can be given. i.e.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00', true);&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, true);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) for UvAGPS tracks to arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, 52.1897017, 6.1996606); &lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, (select location from gps.uva_tracking where device_info_serial = 119 and date_time = '2009-05-07 19:55:08')); &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the distance is calculated with the PostGIS distance_sphere function which uses spherical correction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance_direction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) and direction (degrees) for UvAGPS tracks from arbitrary point in lat/long or geometry location&lt;br /&gt;
&lt;br /&gt;
Example usage: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and direction are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. The direction is the direction from the given point.&lt;br /&gt;
&lt;br /&gt;
In this function the records where the '''userflag''' has been set are discarded. To see  these records a additional boolean argument for '''show raw data''' should  be added like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606, true); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Accelerometer calibration =&lt;br /&gt;
&lt;br /&gt;
The accelerometer measures the acceleration in 3D (20 times per second). Acceleration is caused by gravity (static component) and by a change in speed (dynamic component). &lt;br /&gt;
When the logger is static in horizontal position (solar cells up), gravity (green arrow) shows a  heave (vertical acceleration, z) of +1 g (1 g = 9.81 m.s&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;) while surge and heave are both 0. When the front of the logger is vertically pointing down (forward acceleration, x), surge is +1g and when it is rolled to the right (sidewards acceleration, y) sway is +1g. Due to gravity, the pitch of a logger is thus translated into the values of heave, surge and sway (or z, x, y).&lt;br /&gt;
&lt;br /&gt;
However, the values are measured in mV instead of g. Before delivering the GPS-loggers, they have been calibrated at UvA. The acceleration (A) expressed in g is calculated from the measured value (M) and the calibration factors offset (''O'') and sensitivity (''S'').&lt;br /&gt;
&lt;br /&gt;
Thus acceleration for heave (z), surge (x) and sway (y) is calculated as:&lt;br /&gt;
A&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; ;      A&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;;      A&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; ; &lt;br /&gt;
&lt;br /&gt;
The values of ''O'' (in general ranging from 0-60, sometimes even 300) and ''S'' (ranging from 1300-1450) are available in the device table of the data base. If not available, use the factory defaults ''O'' = 0 and ''S'' = 1365.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:accelero1.png|300px]]||[[File:accelero2.png|300px]]|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the figure above heave (z) is shown in green, surge(x) in red and sway (y) in blue, all values are expressed in g (on the y-axis).&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=373</id>
		<title>UvAGPS</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=373"/>
				<updated>2011-01-12T12:14:36Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* UVA_TRACKING  or UVA_TRACKING_LIMITED */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= UvAGPS Data Model =&lt;br /&gt;
&lt;br /&gt;
For different versions of the UvAGPS firmware different tables are used. For firmware version v0.9.3.6 till v1.0.0.X the tables UVA_ENGINEERING_DATA and UVA_TRACKING_DATA are used. But in the new firmware versions 1.0.1.4 till 1.0.2.4 so much information was added  that new tables were introduced. However for the most important tracking tables a view is created so that all similar tracking for all types of firmware can be seen in one view. That is the UVA_TRACKING view. &lt;br /&gt;
&lt;br /&gt;
All tables, views and functions are also in the GPS schema.&lt;br /&gt;
&lt;br /&gt;
Not everybody has access to all data.  For most users access is limited to &amp;quot;limited&amp;quot; views that only give access to selected devices. &lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA or UVA_TRACKING_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float8||||||Horizontal accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float8||||||Vertical accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||float8||||||m&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration||Float8||||||x axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) movement to right is + and to left is -&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration||Float8||||||y axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) forward movement is + and backwards is -&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration||Float8||||||z axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) upwards movement is + downwards is -&lt;br /&gt;
|-&lt;br /&gt;
|speed ||float8||||||m/s&lt;br /&gt;
|-&lt;br /&gt;
|course||float8||||||Degrees&lt;br /&gt;
|-&lt;br /&gt;
|pressure||float8||||||Pressure sensor (pascal)&lt;br /&gt;
|-&lt;br /&gt;
|temperature||Float8||||||Degrees celcius&lt;br /&gt;
|-&lt;br /&gt;
|solar_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|battery_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|userflag||Integer||||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|  “&amp;quot;location”&amp;quot;||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENGINEERING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Engineering data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|t_syncsts||smallint||||||0: not synced, 1: user synced, 2: Gps synced&lt;br /&gt;
|-&lt;br /&gt;
|t_entzt||smallint||||||0: UCT time,1: TZT time (timezone time)&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentrategps||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratecom||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratepwr||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagesolarpanel||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagebattery||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_chargemode||int2||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainrategps||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratecom||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratepwr||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_esavegpsrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_esavecomrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsnavigationmode||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtimeout||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|eh||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_DEVICE or UVA_DEVICE_LIMITED == &lt;br /&gt;
&lt;br /&gt;
To be able to track the different firmware versions and specific properties for the different devices the UVA_DEVICE table was added. This table also includes essential information needed to calibrate the accelerometers. For more information see [[UvAGPS|Accelerometer calibration]]&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL || Serial number of tag&lt;br /&gt;
|- &lt;br /&gt;
| firmware_version || text |||| NOT NULL || Firmware version installed on tag&lt;br /&gt;
|-&lt;br /&gt;
| device_mass || double |||||||Mass of tag (g)&lt;br /&gt;
|-&lt;br /&gt;
| x_s|| double |||||||Calibration sensitivity of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_s|| double |||||||Calibration sensitivity of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_s|| double |||||||Calibration sensitivity of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
| x_o|| double |||||||Calibration offset of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_o|| double |||||||Calibration offset of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_o|| double |||||||Calibration offset of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_COMM101 or UVA_COMM_LIMITED== &lt;br /&gt;
&lt;br /&gt;
Communication table indicates status and result of communications with ground stations. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
| date_time || timestamp || PK || NOT NULL || timestamp of start communication&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end || timestamp |||||| timestamp of end communication           &lt;br /&gt;
|-&lt;br /&gt;
| date_time_utc || timestamp |||||| date_time in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end_utc || timestamp |||||| date_time_end in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| action || text|||||| JOINED / RESCHEDULE  ??&lt;br /&gt;
|-&lt;br /&gt;
| bytes_communicated || integer |||||| Number of bytes communicated (total of all bytes per DATA line)  &lt;br /&gt;
|-&lt;br /&gt;
|status || text |||||| READY, TIMEOUT, LOWPOWER, MISSING&lt;br /&gt;
|-&lt;br /&gt;
| network_join_time || integer||||||milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| number_identical_lines || integer |||||| Number identical lines in data block. Gives indication &lt;br /&gt;
|-&lt;br /&gt;
| non_ascii_char || integer |||||| Number of non ascii characters (indicated by question-mark ?)&lt;br /&gt;
|-&lt;br /&gt;
| sts_time || timestamp |||||| derived from S0 hh,mi&lt;br /&gt;
|-&lt;br /&gt;
| timesynced || smallint|||||| TimeSynced (0=not sy:wnced, 1=user set, 2=Gps Synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode || smallint||||||DeviceMode (0-99)&lt;br /&gt;
|-&lt;br /&gt;
| vbat || float |||||| Battery voltage in V (0-~4.200V) &lt;br /&gt;
|-&lt;br /&gt;
|logb || integer |||||| logged bytes, waiting for download (0-4Mbyte)&lt;br /&gt;
|-&lt;br /&gt;
| logp || smallint |||||| Logged percentage (units 0.1%) of memory waiting to be downloaded (0-1000)&lt;br /&gt;
|-&lt;br /&gt;
| gpsii || integer |||||| GpsIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|comii || integer|||||| ComIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| AcceleroIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| User switches, current (0-65535) &lt;br /&gt;
|-&lt;br /&gt;
|last_gps_fix ||timestamp||||||timestamp of last fix&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||Latitude of last fix. Decimal degrees &lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||Longitude of last fix. Decimal degrees&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_SETTINGS101 or UVA_SETTINGS_LIMITED  == &lt;br /&gt;
&lt;br /&gt;
Settings are either from C0-C1-C9 lines or parsed from uplink communication lines &lt;br /&gt;
If C0-C1 is parsed its values are compared with the previous value and if the settings are the &lt;br /&gt;
same no new records needs to be added &lt;br /&gt;
If uplink settings are parsed wait till the last setting has been seen, (DL command or EOF) &lt;br /&gt;
then store all the new settings in one record. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||Derive timestamp from Hh:mi fields in C0 combined with computer timestamp in JOINED line&lt;br /&gt;
|-&lt;br /&gt;
|timesynced || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|timezone_time || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| SpecialUserSwitches &lt;br /&gt;
|-&lt;br /&gt;
|gpsnavmode || smallint|||||| GpsNavMode 0-7&lt;br /&gt;
|-&lt;br /&gt;
|gpsreceivermode || smallint |||||| GpsReceiverNode 0-3&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtime || smallint|||||| GpsFixTime 0-255&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_h || smallint|||||| hours Gps IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_m || smallint|||||| minutes Gps IvalN on &lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln  || integer|||||| GpsIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_h || smallint|||||| hours Gps IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_m || smallint|||||| minutes GpS IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale  || integer|||||| GpsIvalE &lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_h || smallint|||||| hours Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_m || smallint|||||| minutes Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln || integer|||||| ComIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_h || smallint|||||| hours Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_m || smallint|||||| minutes Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale || integer|||||| ComIvalE&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| Accelero measurement interval         &lt;br /&gt;
|-&lt;br /&gt;
|accbn || integer|||||| Accelero number of blocks &lt;br /&gt;
|-&lt;br /&gt;
|accsn || integer|||||| Accelero number of samples (0-65536)&lt;br /&gt;
|-&lt;br /&gt;
|f || smallint||||||Accelero sample frequency  (0=20Hz, 1=10Hz, 2=5Hz, 3=1Hz)&lt;br /&gt;
|-&lt;br /&gt;
|pdp || smallint|||||| PdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|pac||smallint|||||| PaccMsk (10-100)&lt;br /&gt;
|-&lt;br /&gt;
|tdp ||smallint|||||| TdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|tac ||smallint|||||| TaccMsk (30-300)&lt;br /&gt;
|-&lt;br /&gt;
|ga || smallint|||||| Additional Fixes GpsIval mode (3-25) before interval fix is logged&lt;br /&gt;
|-&lt;br /&gt;
|aol || smallint||||||AccMemOffLev (100 - 950) units 0.1%; if Memfull above  this level all Accelero activity will be overruled and switched off untill MemFull &amp;lt; level - 5&lt;br /&gt;
|-&lt;br /&gt;
|eventnum || text|||||| 12 eventnumbers (0-0xff) only printed if not zero, therfore converted to text&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA101 or UVA_TRACKING_LIMITED==&lt;br /&gt;
&lt;br /&gt;
The tracking dat for newer firmware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||integer||||||heigth above sealevel meters&lt;br /&gt;
|-&lt;br /&gt;
|pressure ||integer||||||in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature ||float||||||in celcius degrees&lt;br /&gt;
|-&lt;br /&gt;
|satellites_used ||smallint||||||satellites used for fix &lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime ||float||||||GpsFixTime in seconds &lt;br /&gt;
|-&lt;br /&gt;
|positiondop ||float||||||Position DOP in units&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy || float||||||Horizontal accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy || float||||||Vertical accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|x_speed ||float||||||Speed in x-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|y_speed ||float||||||Speed in y-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|z_speed ||float||||||Speed in z-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|speed_accuracy || float||||||Speed accuracy (m/s) &lt;br /&gt;
|-&lt;br /&gt;
|userflag||Integer||||||Data flagged as unacceptable by user if not 0&lt;br /&gt;
|-&lt;br /&gt;
|location || geometry |||||| lat/long as PostGIS geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ACCELERATION101 or UVA_ACCELERATION_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Acceleration entries if accelerometer was turned on. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|index ||smallint||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration ||smallint||||||acceleration in X-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration ||smallint||||||acceleration in Y-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration ||smallint||||||acceleration in Z-axis (-2666 till 2666)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENERGY101 or UVA_ENERGY_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|timesynced ||smallint||||||TimeSynced (0=not synced, 1=user set, 2=Gps synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode ||smallint||||||(0-99)&lt;br /&gt;
|-&lt;br /&gt;
|vsll ||float||||||Solar Voltage during charging in mV (0-~2500)&lt;br /&gt;
|-&lt;br /&gt;
|vbat ||float||||||Battery Voltage in V (0-~4.200)&lt;br /&gt;
|-&lt;br /&gt;
|ssw ||smallint|||||| Solar Cell Switches ... (0-255) fw1022 and up &lt;br /&gt;
|-&lt;br /&gt;
| ||||||||extended fields if special user switch is on &lt;br /&gt;
|-&lt;br /&gt;
|vsoo ||float|||||| Solar voltage open in V (0-~2.500)&lt;br /&gt;
|-&lt;br /&gt;
|vdrf ||float||||||reference voltage Dac in V (0-~2.435)&lt;br /&gt;
|-&lt;br /&gt;
|vchr ||float||||||charge current voltage&lt;br /&gt;
|-&lt;br /&gt;
|g ||smallint|||||| Gps battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|c || smallint||||||Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|m || smallint||||||Charge Mode (0,1,2 Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|pressure || integer|||||| in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature || float|||||| in celcius degrees   &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING  or UVA_TRACKING_LIMITED == &lt;br /&gt;
&lt;br /&gt;
View to show identical fields for older and newer firmware tracking data&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|altitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|pressure||integer|||||&lt;br /&gt;
|-&lt;br /&gt;
|temperature||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|x_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|y_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|z_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|userflag||integer||||||Flagged as inacceptable by user if not 0&lt;br /&gt;
|-&lt;br /&gt;
|satellites_used||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|positiondop||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|speed_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|location||geometry||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_SPEED or UVA_TRACKING_SPEED_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Additional view that computes with the x_speed, y_speed and z_speed components the vnorth, veast and vdown speed components as well as the absolute value speed in meters/second. &lt;br /&gt;
&lt;br /&gt;
In addition to the fields in the UVA_TRACKING view this view adds :&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|vnorth||float||||||- vx * sin(lat) * cos(long) - vy * sin(lat) * sin (long) + vz * cos(lat)&lt;br /&gt;
|-&lt;br /&gt;
|veast||float|||||| - vx * sin(lon) + vy * cos(lon)&lt;br /&gt;
|-&lt;br /&gt;
|vdown||float|||||| - vx * cos(lat) * cos(lon) - vy * cos(lat) * sin(lon) - vz * sin(lat)&lt;br /&gt;
|-&lt;br /&gt;
|speed||float|||||| sqrt(vx^2 + vy^2 + vz^2)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= UvAGPS functions =&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_speed ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters), time-interval, speed (meters/second) and heading (degrees) for a series of subsequent tracking entries with specific device_info_serial.&lt;br /&gt;
For the first entry in the sequence these values will always be missing because they are computed  as the difference between subsequent rows.&lt;br /&gt;
&lt;br /&gt;
Usage examples :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119);&lt;br /&gt;
&lt;br /&gt;
select t.*, a.distance, a.interval, a.speed, a.direction from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00') a join gps.uva_tracking t using(device_info_serial, date_time);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and heading are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. &lt;br /&gt;
The heading is the initial heading. PostGIS does not calculate the heading, so therefore we don't use PostGIS.&lt;br /&gt;
&lt;br /&gt;
In these functions the records that have been flagged as invalid by setting the '''userflag''' are not token into account and discarded. &lt;br /&gt;
If it is required get the speed for all records  a additional boolean argument for '''get raw data''' can be given. i.e.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00', true);&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, true);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) for UvAGPS tracks to arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, 52.1897017, 6.1996606); &lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, (select location from gps.uva_tracking where device_info_serial = 119 and date_time = '2009-05-07 19:55:08')); &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the distance is calculated with the PostGIS distance_sphere function which uses spherical correction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance_direction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) and direction (degrees) for UvAGPS tracks from arbitrary point in lat/long or geometry location&lt;br /&gt;
&lt;br /&gt;
Example usage: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and direction are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. The direction is the direction from the given point.&lt;br /&gt;
&lt;br /&gt;
In this function the records where the '''userflag''' has been set are discarded. To see  these records a additional boolean argument for '''show raw data''' should  be added like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606, true); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Accelerometer calibration =&lt;br /&gt;
&lt;br /&gt;
The accelerometer measures the acceleration in 3D (20 times per second). Acceleration is caused by gravity (static component) and by a change in speed (dynamic component). &lt;br /&gt;
When the logger is static in horizontal position (solar cells up), gravity (green arrow) shows a  heave (vertical acceleration, z) of +1 g (1 g = 9.81 m.s&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;) while surge and heave are both 0. When the front of the logger is vertically pointing down (forward acceleration, x), surge is +1g and when it is rolled to the right (sidewards acceleration, y) sway is +1g. Due to gravity, the pitch of a logger is thus translated into the values of heave, surge and sway (or z, x, y).&lt;br /&gt;
&lt;br /&gt;
However, the values are measured in mV instead of g. Before delivering the GPS-loggers, they have been calibrated at UvA. The acceleration (A) expressed in g is calculated from the measured value (M) and the calibration factors offset (''O'') and sensitivity (''S'').&lt;br /&gt;
&lt;br /&gt;
Thus acceleration for heave (z), surge (x) and sway (y) is calculated as:&lt;br /&gt;
A&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; ;      A&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;;      A&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; ; &lt;br /&gt;
&lt;br /&gt;
The values of ''O'' (in general ranging from 0-60, sometimes even 300) and ''S'' (ranging from 1300-1450) are available in the device table of the data base. If not available, use the factory defaults ''O'' = 0 and ''S'' = 1365.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:accelero1.png|300px]]||[[File:accelero2.png|300px]]|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the figure above heave (z) is shown in green, surge(x) in red and sway (y) in blue, all values are expressed in g (on the y-axis).&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=372</id>
		<title>UvAGPS</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=372"/>
				<updated>2011-01-12T12:14:17Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* UVA_TRACKING_DATA101 or UVA_TRACKING_LIMITED */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= UvAGPS Data Model =&lt;br /&gt;
&lt;br /&gt;
For different versions of the UvAGPS firmware different tables are used. For firmware version v0.9.3.6 till v1.0.0.X the tables UVA_ENGINEERING_DATA and UVA_TRACKING_DATA are used. But in the new firmware versions 1.0.1.4 till 1.0.2.4 so much information was added  that new tables were introduced. However for the most important tracking tables a view is created so that all similar tracking for all types of firmware can be seen in one view. That is the UVA_TRACKING view. &lt;br /&gt;
&lt;br /&gt;
All tables, views and functions are also in the GPS schema.&lt;br /&gt;
&lt;br /&gt;
Not everybody has access to all data.  For most users access is limited to &amp;quot;limited&amp;quot; views that only give access to selected devices. &lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA or UVA_TRACKING_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float8||||||Horizontal accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float8||||||Vertical accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||float8||||||m&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration||Float8||||||x axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) movement to right is + and to left is -&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration||Float8||||||y axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) forward movement is + and backwards is -&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration||Float8||||||z axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) upwards movement is + downwards is -&lt;br /&gt;
|-&lt;br /&gt;
|speed ||float8||||||m/s&lt;br /&gt;
|-&lt;br /&gt;
|course||float8||||||Degrees&lt;br /&gt;
|-&lt;br /&gt;
|pressure||float8||||||Pressure sensor (pascal)&lt;br /&gt;
|-&lt;br /&gt;
|temperature||Float8||||||Degrees celcius&lt;br /&gt;
|-&lt;br /&gt;
|solar_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|battery_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|userflag||Integer||||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|  “&amp;quot;location”&amp;quot;||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENGINEERING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Engineering data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|t_syncsts||smallint||||||0: not synced, 1: user synced, 2: Gps synced&lt;br /&gt;
|-&lt;br /&gt;
|t_entzt||smallint||||||0: UCT time,1: TZT time (timezone time)&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentrategps||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratecom||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratepwr||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagesolarpanel||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagebattery||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_chargemode||int2||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainrategps||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratecom||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratepwr||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_esavegpsrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_esavecomrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsnavigationmode||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtimeout||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|eh||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_DEVICE or UVA_DEVICE_LIMITED == &lt;br /&gt;
&lt;br /&gt;
To be able to track the different firmware versions and specific properties for the different devices the UVA_DEVICE table was added. This table also includes essential information needed to calibrate the accelerometers. For more information see [[UvAGPS|Accelerometer calibration]]&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL || Serial number of tag&lt;br /&gt;
|- &lt;br /&gt;
| firmware_version || text |||| NOT NULL || Firmware version installed on tag&lt;br /&gt;
|-&lt;br /&gt;
| device_mass || double |||||||Mass of tag (g)&lt;br /&gt;
|-&lt;br /&gt;
| x_s|| double |||||||Calibration sensitivity of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_s|| double |||||||Calibration sensitivity of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_s|| double |||||||Calibration sensitivity of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
| x_o|| double |||||||Calibration offset of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_o|| double |||||||Calibration offset of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_o|| double |||||||Calibration offset of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_COMM101 or UVA_COMM_LIMITED== &lt;br /&gt;
&lt;br /&gt;
Communication table indicates status and result of communications with ground stations. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
| date_time || timestamp || PK || NOT NULL || timestamp of start communication&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end || timestamp |||||| timestamp of end communication           &lt;br /&gt;
|-&lt;br /&gt;
| date_time_utc || timestamp |||||| date_time in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end_utc || timestamp |||||| date_time_end in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| action || text|||||| JOINED / RESCHEDULE  ??&lt;br /&gt;
|-&lt;br /&gt;
| bytes_communicated || integer |||||| Number of bytes communicated (total of all bytes per DATA line)  &lt;br /&gt;
|-&lt;br /&gt;
|status || text |||||| READY, TIMEOUT, LOWPOWER, MISSING&lt;br /&gt;
|-&lt;br /&gt;
| network_join_time || integer||||||milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| number_identical_lines || integer |||||| Number identical lines in data block. Gives indication &lt;br /&gt;
|-&lt;br /&gt;
| non_ascii_char || integer |||||| Number of non ascii characters (indicated by question-mark ?)&lt;br /&gt;
|-&lt;br /&gt;
| sts_time || timestamp |||||| derived from S0 hh,mi&lt;br /&gt;
|-&lt;br /&gt;
| timesynced || smallint|||||| TimeSynced (0=not sy:wnced, 1=user set, 2=Gps Synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode || smallint||||||DeviceMode (0-99)&lt;br /&gt;
|-&lt;br /&gt;
| vbat || float |||||| Battery voltage in V (0-~4.200V) &lt;br /&gt;
|-&lt;br /&gt;
|logb || integer |||||| logged bytes, waiting for download (0-4Mbyte)&lt;br /&gt;
|-&lt;br /&gt;
| logp || smallint |||||| Logged percentage (units 0.1%) of memory waiting to be downloaded (0-1000)&lt;br /&gt;
|-&lt;br /&gt;
| gpsii || integer |||||| GpsIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|comii || integer|||||| ComIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| AcceleroIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| User switches, current (0-65535) &lt;br /&gt;
|-&lt;br /&gt;
|last_gps_fix ||timestamp||||||timestamp of last fix&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||Latitude of last fix. Decimal degrees &lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||Longitude of last fix. Decimal degrees&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_SETTINGS101 or UVA_SETTINGS_LIMITED  == &lt;br /&gt;
&lt;br /&gt;
Settings are either from C0-C1-C9 lines or parsed from uplink communication lines &lt;br /&gt;
If C0-C1 is parsed its values are compared with the previous value and if the settings are the &lt;br /&gt;
same no new records needs to be added &lt;br /&gt;
If uplink settings are parsed wait till the last setting has been seen, (DL command or EOF) &lt;br /&gt;
then store all the new settings in one record. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||Derive timestamp from Hh:mi fields in C0 combined with computer timestamp in JOINED line&lt;br /&gt;
|-&lt;br /&gt;
|timesynced || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|timezone_time || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| SpecialUserSwitches &lt;br /&gt;
|-&lt;br /&gt;
|gpsnavmode || smallint|||||| GpsNavMode 0-7&lt;br /&gt;
|-&lt;br /&gt;
|gpsreceivermode || smallint |||||| GpsReceiverNode 0-3&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtime || smallint|||||| GpsFixTime 0-255&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_h || smallint|||||| hours Gps IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_m || smallint|||||| minutes Gps IvalN on &lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln  || integer|||||| GpsIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_h || smallint|||||| hours Gps IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_m || smallint|||||| minutes GpS IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale  || integer|||||| GpsIvalE &lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_h || smallint|||||| hours Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_m || smallint|||||| minutes Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln || integer|||||| ComIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_h || smallint|||||| hours Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_m || smallint|||||| minutes Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale || integer|||||| ComIvalE&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| Accelero measurement interval         &lt;br /&gt;
|-&lt;br /&gt;
|accbn || integer|||||| Accelero number of blocks &lt;br /&gt;
|-&lt;br /&gt;
|accsn || integer|||||| Accelero number of samples (0-65536)&lt;br /&gt;
|-&lt;br /&gt;
|f || smallint||||||Accelero sample frequency  (0=20Hz, 1=10Hz, 2=5Hz, 3=1Hz)&lt;br /&gt;
|-&lt;br /&gt;
|pdp || smallint|||||| PdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|pac||smallint|||||| PaccMsk (10-100)&lt;br /&gt;
|-&lt;br /&gt;
|tdp ||smallint|||||| TdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|tac ||smallint|||||| TaccMsk (30-300)&lt;br /&gt;
|-&lt;br /&gt;
|ga || smallint|||||| Additional Fixes GpsIval mode (3-25) before interval fix is logged&lt;br /&gt;
|-&lt;br /&gt;
|aol || smallint||||||AccMemOffLev (100 - 950) units 0.1%; if Memfull above  this level all Accelero activity will be overruled and switched off untill MemFull &amp;lt; level - 5&lt;br /&gt;
|-&lt;br /&gt;
|eventnum || text|||||| 12 eventnumbers (0-0xff) only printed if not zero, therfore converted to text&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA101 or UVA_TRACKING_LIMITED==&lt;br /&gt;
&lt;br /&gt;
The tracking dat for newer firmware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||integer||||||heigth above sealevel meters&lt;br /&gt;
|-&lt;br /&gt;
|pressure ||integer||||||in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature ||float||||||in celcius degrees&lt;br /&gt;
|-&lt;br /&gt;
|satellites_used ||smallint||||||satellites used for fix &lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime ||float||||||GpsFixTime in seconds &lt;br /&gt;
|-&lt;br /&gt;
|positiondop ||float||||||Position DOP in units&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy || float||||||Horizontal accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy || float||||||Vertical accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|x_speed ||float||||||Speed in x-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|y_speed ||float||||||Speed in y-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|z_speed ||float||||||Speed in z-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|speed_accuracy || float||||||Speed accuracy (m/s) &lt;br /&gt;
|-&lt;br /&gt;
|userflag||Integer||||||Data flagged as unacceptable by user if not 0&lt;br /&gt;
|-&lt;br /&gt;
|location || geometry |||||| lat/long as PostGIS geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ACCELERATION101 or UVA_ACCELERATION_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Acceleration entries if accelerometer was turned on. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|index ||smallint||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration ||smallint||||||acceleration in X-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration ||smallint||||||acceleration in Y-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration ||smallint||||||acceleration in Z-axis (-2666 till 2666)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENERGY101 or UVA_ENERGY_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|timesynced ||smallint||||||TimeSynced (0=not synced, 1=user set, 2=Gps synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode ||smallint||||||(0-99)&lt;br /&gt;
|-&lt;br /&gt;
|vsll ||float||||||Solar Voltage during charging in mV (0-~2500)&lt;br /&gt;
|-&lt;br /&gt;
|vbat ||float||||||Battery Voltage in V (0-~4.200)&lt;br /&gt;
|-&lt;br /&gt;
|ssw ||smallint|||||| Solar Cell Switches ... (0-255) fw1022 and up &lt;br /&gt;
|-&lt;br /&gt;
| ||||||||extended fields if special user switch is on &lt;br /&gt;
|-&lt;br /&gt;
|vsoo ||float|||||| Solar voltage open in V (0-~2.500)&lt;br /&gt;
|-&lt;br /&gt;
|vdrf ||float||||||reference voltage Dac in V (0-~2.435)&lt;br /&gt;
|-&lt;br /&gt;
|vchr ||float||||||charge current voltage&lt;br /&gt;
|-&lt;br /&gt;
|g ||smallint|||||| Gps battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|c || smallint||||||Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|m || smallint||||||Charge Mode (0,1,2 Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|pressure || integer|||||| in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature || float|||||| in celcius degrees   &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING  or UVA_TRACKING_LIMITED == &lt;br /&gt;
&lt;br /&gt;
View to show identical fields for older and newer firmware tracking data&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|altitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|pressure||integer|||||&lt;br /&gt;
|-&lt;br /&gt;
|temperature||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|x_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|y_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|z_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|userflag||integer||||||Flagged as inacceptable by user if not 0&lt;br /&gt;
|-&lt;br /&gt;
|satellites_used||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|positiondop||double||||||&lt;br /&gt;
|-&lt;br /&gt;
|speed_accuracy||double||||||&lt;br /&gt;
|-&lt;br /&gt;
|location||geometry||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_SPEED or UVA_TRACKING_SPEED_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Additional view that computes with the x_speed, y_speed and z_speed components the vnorth, veast and vdown speed components as well as the absolute value speed in meters/second. &lt;br /&gt;
&lt;br /&gt;
In addition to the fields in the UVA_TRACKING view this view adds :&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|vnorth||float||||||- vx * sin(lat) * cos(long) - vy * sin(lat) * sin (long) + vz * cos(lat)&lt;br /&gt;
|-&lt;br /&gt;
|veast||float|||||| - vx * sin(lon) + vy * cos(lon)&lt;br /&gt;
|-&lt;br /&gt;
|vdown||float|||||| - vx * cos(lat) * cos(lon) - vy * cos(lat) * sin(lon) - vz * sin(lat)&lt;br /&gt;
|-&lt;br /&gt;
|speed||float|||||| sqrt(vx^2 + vy^2 + vz^2)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= UvAGPS functions =&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_speed ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters), time-interval, speed (meters/second) and heading (degrees) for a series of subsequent tracking entries with specific device_info_serial.&lt;br /&gt;
For the first entry in the sequence these values will always be missing because they are computed  as the difference between subsequent rows.&lt;br /&gt;
&lt;br /&gt;
Usage examples :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119);&lt;br /&gt;
&lt;br /&gt;
select t.*, a.distance, a.interval, a.speed, a.direction from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00') a join gps.uva_tracking t using(device_info_serial, date_time);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and heading are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. &lt;br /&gt;
The heading is the initial heading. PostGIS does not calculate the heading, so therefore we don't use PostGIS.&lt;br /&gt;
&lt;br /&gt;
In these functions the records that have been flagged as invalid by setting the '''userflag''' are not token into account and discarded. &lt;br /&gt;
If it is required get the speed for all records  a additional boolean argument for '''get raw data''' can be given. i.e.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00', true);&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, true);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) for UvAGPS tracks to arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, 52.1897017, 6.1996606); &lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, (select location from gps.uva_tracking where device_info_serial = 119 and date_time = '2009-05-07 19:55:08')); &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the distance is calculated with the PostGIS distance_sphere function which uses spherical correction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance_direction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) and direction (degrees) for UvAGPS tracks from arbitrary point in lat/long or geometry location&lt;br /&gt;
&lt;br /&gt;
Example usage: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and direction are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. The direction is the direction from the given point.&lt;br /&gt;
&lt;br /&gt;
In this function the records where the '''userflag''' has been set are discarded. To see  these records a additional boolean argument for '''show raw data''' should  be added like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606, true); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Accelerometer calibration =&lt;br /&gt;
&lt;br /&gt;
The accelerometer measures the acceleration in 3D (20 times per second). Acceleration is caused by gravity (static component) and by a change in speed (dynamic component). &lt;br /&gt;
When the logger is static in horizontal position (solar cells up), gravity (green arrow) shows a  heave (vertical acceleration, z) of +1 g (1 g = 9.81 m.s&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;) while surge and heave are both 0. When the front of the logger is vertically pointing down (forward acceleration, x), surge is +1g and when it is rolled to the right (sidewards acceleration, y) sway is +1g. Due to gravity, the pitch of a logger is thus translated into the values of heave, surge and sway (or z, x, y).&lt;br /&gt;
&lt;br /&gt;
However, the values are measured in mV instead of g. Before delivering the GPS-loggers, they have been calibrated at UvA. The acceleration (A) expressed in g is calculated from the measured value (M) and the calibration factors offset (''O'') and sensitivity (''S'').&lt;br /&gt;
&lt;br /&gt;
Thus acceleration for heave (z), surge (x) and sway (y) is calculated as:&lt;br /&gt;
A&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; ;      A&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;;      A&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; ; &lt;br /&gt;
&lt;br /&gt;
The values of ''O'' (in general ranging from 0-60, sometimes even 300) and ''S'' (ranging from 1300-1450) are available in the device table of the data base. If not available, use the factory defaults ''O'' = 0 and ''S'' = 1365.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:accelero1.png|300px]]||[[File:accelero2.png|300px]]|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the figure above heave (z) is shown in green, surge(x) in red and sway (y) in blue, all values are expressed in g (on the y-axis).&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=371</id>
		<title>UvAGPS</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=371"/>
				<updated>2011-01-12T12:13:28Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* UVA_TRACKING  or UVA_TRACKING_LIMITED */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= UvAGPS Data Model =&lt;br /&gt;
&lt;br /&gt;
For different versions of the UvAGPS firmware different tables are used. For firmware version v0.9.3.6 till v1.0.0.X the tables UVA_ENGINEERING_DATA and UVA_TRACKING_DATA are used. But in the new firmware versions 1.0.1.4 till 1.0.2.4 so much information was added  that new tables were introduced. However for the most important tracking tables a view is created so that all similar tracking for all types of firmware can be seen in one view. That is the UVA_TRACKING view. &lt;br /&gt;
&lt;br /&gt;
All tables, views and functions are also in the GPS schema.&lt;br /&gt;
&lt;br /&gt;
Not everybody has access to all data.  For most users access is limited to &amp;quot;limited&amp;quot; views that only give access to selected devices. &lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA or UVA_TRACKING_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float8||||||Horizontal accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float8||||||Vertical accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||float8||||||m&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration||Float8||||||x axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) movement to right is + and to left is -&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration||Float8||||||y axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) forward movement is + and backwards is -&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration||Float8||||||z axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) upwards movement is + downwards is -&lt;br /&gt;
|-&lt;br /&gt;
|speed ||float8||||||m/s&lt;br /&gt;
|-&lt;br /&gt;
|course||float8||||||Degrees&lt;br /&gt;
|-&lt;br /&gt;
|pressure||float8||||||Pressure sensor (pascal)&lt;br /&gt;
|-&lt;br /&gt;
|temperature||Float8||||||Degrees celcius&lt;br /&gt;
|-&lt;br /&gt;
|solar_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|battery_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|userflag||Integer||||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|  “&amp;quot;location”&amp;quot;||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENGINEERING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Engineering data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|t_syncsts||smallint||||||0: not synced, 1: user synced, 2: Gps synced&lt;br /&gt;
|-&lt;br /&gt;
|t_entzt||smallint||||||0: UCT time,1: TZT time (timezone time)&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentrategps||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratecom||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratepwr||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagesolarpanel||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagebattery||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_chargemode||int2||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainrategps||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratecom||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratepwr||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_esavegpsrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_esavecomrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsnavigationmode||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtimeout||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|eh||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_DEVICE or UVA_DEVICE_LIMITED == &lt;br /&gt;
&lt;br /&gt;
To be able to track the different firmware versions and specific properties for the different devices the UVA_DEVICE table was added. This table also includes essential information needed to calibrate the accelerometers. For more information see [[UvAGPS|Accelerometer calibration]]&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL || Serial number of tag&lt;br /&gt;
|- &lt;br /&gt;
| firmware_version || text |||| NOT NULL || Firmware version installed on tag&lt;br /&gt;
|-&lt;br /&gt;
| device_mass || double |||||||Mass of tag (g)&lt;br /&gt;
|-&lt;br /&gt;
| x_s|| double |||||||Calibration sensitivity of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_s|| double |||||||Calibration sensitivity of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_s|| double |||||||Calibration sensitivity of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
| x_o|| double |||||||Calibration offset of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_o|| double |||||||Calibration offset of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_o|| double |||||||Calibration offset of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_COMM101 or UVA_COMM_LIMITED== &lt;br /&gt;
&lt;br /&gt;
Communication table indicates status and result of communications with ground stations. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
| date_time || timestamp || PK || NOT NULL || timestamp of start communication&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end || timestamp |||||| timestamp of end communication           &lt;br /&gt;
|-&lt;br /&gt;
| date_time_utc || timestamp |||||| date_time in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end_utc || timestamp |||||| date_time_end in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| action || text|||||| JOINED / RESCHEDULE  ??&lt;br /&gt;
|-&lt;br /&gt;
| bytes_communicated || integer |||||| Number of bytes communicated (total of all bytes per DATA line)  &lt;br /&gt;
|-&lt;br /&gt;
|status || text |||||| READY, TIMEOUT, LOWPOWER, MISSING&lt;br /&gt;
|-&lt;br /&gt;
| network_join_time || integer||||||milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| number_identical_lines || integer |||||| Number identical lines in data block. Gives indication &lt;br /&gt;
|-&lt;br /&gt;
| non_ascii_char || integer |||||| Number of non ascii characters (indicated by question-mark ?)&lt;br /&gt;
|-&lt;br /&gt;
| sts_time || timestamp |||||| derived from S0 hh,mi&lt;br /&gt;
|-&lt;br /&gt;
| timesynced || smallint|||||| TimeSynced (0=not sy:wnced, 1=user set, 2=Gps Synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode || smallint||||||DeviceMode (0-99)&lt;br /&gt;
|-&lt;br /&gt;
| vbat || float |||||| Battery voltage in V (0-~4.200V) &lt;br /&gt;
|-&lt;br /&gt;
|logb || integer |||||| logged bytes, waiting for download (0-4Mbyte)&lt;br /&gt;
|-&lt;br /&gt;
| logp || smallint |||||| Logged percentage (units 0.1%) of memory waiting to be downloaded (0-1000)&lt;br /&gt;
|-&lt;br /&gt;
| gpsii || integer |||||| GpsIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|comii || integer|||||| ComIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| AcceleroIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| User switches, current (0-65535) &lt;br /&gt;
|-&lt;br /&gt;
|last_gps_fix ||timestamp||||||timestamp of last fix&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||Latitude of last fix. Decimal degrees &lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||Longitude of last fix. Decimal degrees&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_SETTINGS101 or UVA_SETTINGS_LIMITED  == &lt;br /&gt;
&lt;br /&gt;
Settings are either from C0-C1-C9 lines or parsed from uplink communication lines &lt;br /&gt;
If C0-C1 is parsed its values are compared with the previous value and if the settings are the &lt;br /&gt;
same no new records needs to be added &lt;br /&gt;
If uplink settings are parsed wait till the last setting has been seen, (DL command or EOF) &lt;br /&gt;
then store all the new settings in one record. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||Derive timestamp from Hh:mi fields in C0 combined with computer timestamp in JOINED line&lt;br /&gt;
|-&lt;br /&gt;
|timesynced || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|timezone_time || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| SpecialUserSwitches &lt;br /&gt;
|-&lt;br /&gt;
|gpsnavmode || smallint|||||| GpsNavMode 0-7&lt;br /&gt;
|-&lt;br /&gt;
|gpsreceivermode || smallint |||||| GpsReceiverNode 0-3&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtime || smallint|||||| GpsFixTime 0-255&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_h || smallint|||||| hours Gps IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_m || smallint|||||| minutes Gps IvalN on &lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln  || integer|||||| GpsIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_h || smallint|||||| hours Gps IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_m || smallint|||||| minutes GpS IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale  || integer|||||| GpsIvalE &lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_h || smallint|||||| hours Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_m || smallint|||||| minutes Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln || integer|||||| ComIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_h || smallint|||||| hours Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_m || smallint|||||| minutes Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale || integer|||||| ComIvalE&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| Accelero measurement interval         &lt;br /&gt;
|-&lt;br /&gt;
|accbn || integer|||||| Accelero number of blocks &lt;br /&gt;
|-&lt;br /&gt;
|accsn || integer|||||| Accelero number of samples (0-65536)&lt;br /&gt;
|-&lt;br /&gt;
|f || smallint||||||Accelero sample frequency  (0=20Hz, 1=10Hz, 2=5Hz, 3=1Hz)&lt;br /&gt;
|-&lt;br /&gt;
|pdp || smallint|||||| PdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|pac||smallint|||||| PaccMsk (10-100)&lt;br /&gt;
|-&lt;br /&gt;
|tdp ||smallint|||||| TdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|tac ||smallint|||||| TaccMsk (30-300)&lt;br /&gt;
|-&lt;br /&gt;
|ga || smallint|||||| Additional Fixes GpsIval mode (3-25) before interval fix is logged&lt;br /&gt;
|-&lt;br /&gt;
|aol || smallint||||||AccMemOffLev (100 - 950) units 0.1%; if Memfull above  this level all Accelero activity will be overruled and switched off untill MemFull &amp;lt; level - 5&lt;br /&gt;
|-&lt;br /&gt;
|eventnum || text|||||| 12 eventnumbers (0-0xff) only printed if not zero, therfore converted to text&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA101 or UVA_TRACKING_LIMITED==&lt;br /&gt;
&lt;br /&gt;
The tracking dat for newer firmware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||integer||||||heigth above sealevel meters&lt;br /&gt;
|-&lt;br /&gt;
|pressure ||integer||||||in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature ||float||||||in celcius degrees&lt;br /&gt;
|-&lt;br /&gt;
|satellites_used ||smallint||||||satellites used for fix &lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime ||float||||||GpsFixTime in seconds &lt;br /&gt;
|-&lt;br /&gt;
|positiondop ||float||||||Position DOP in units&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy || float||||||Horizontal accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy || float||||||Vertical accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|x_speed ||float||||||Speed in x-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|y_speed ||float||||||Speed in y-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|z_speed ||float||||||Speed in z-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|speed_accuracy || float||||||Speed accuracy (m/s) &lt;br /&gt;
|-&lt;br /&gt;
|userflag||Integer||||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|location || geometry |||||| lat/long as PostGIS geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ACCELERATION101 or UVA_ACCELERATION_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Acceleration entries if accelerometer was turned on. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|index ||smallint||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration ||smallint||||||acceleration in X-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration ||smallint||||||acceleration in Y-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration ||smallint||||||acceleration in Z-axis (-2666 till 2666)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENERGY101 or UVA_ENERGY_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|timesynced ||smallint||||||TimeSynced (0=not synced, 1=user set, 2=Gps synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode ||smallint||||||(0-99)&lt;br /&gt;
|-&lt;br /&gt;
|vsll ||float||||||Solar Voltage during charging in mV (0-~2500)&lt;br /&gt;
|-&lt;br /&gt;
|vbat ||float||||||Battery Voltage in V (0-~4.200)&lt;br /&gt;
|-&lt;br /&gt;
|ssw ||smallint|||||| Solar Cell Switches ... (0-255) fw1022 and up &lt;br /&gt;
|-&lt;br /&gt;
| ||||||||extended fields if special user switch is on &lt;br /&gt;
|-&lt;br /&gt;
|vsoo ||float|||||| Solar voltage open in V (0-~2.500)&lt;br /&gt;
|-&lt;br /&gt;
|vdrf ||float||||||reference voltage Dac in V (0-~2.435)&lt;br /&gt;
|-&lt;br /&gt;
|vchr ||float||||||charge current voltage&lt;br /&gt;
|-&lt;br /&gt;
|g ||smallint|||||| Gps battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|c || smallint||||||Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|m || smallint||||||Charge Mode (0,1,2 Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|pressure || integer|||||| in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature || float|||||| in celcius degrees   &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING  or UVA_TRACKING_LIMITED == &lt;br /&gt;
&lt;br /&gt;
View to show identical fields for older and newer firmware tracking data&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|altitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|pressure||integer|||||&lt;br /&gt;
|-&lt;br /&gt;
|temperature||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|x_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|y_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|z_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|userflag||integer||||||Flagged as inacceptable by user if not 0&lt;br /&gt;
|-&lt;br /&gt;
|satellites_used||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|positiondop||double||||||&lt;br /&gt;
|-&lt;br /&gt;
|speed_accuracy||double||||||&lt;br /&gt;
|-&lt;br /&gt;
|location||geometry||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_SPEED or UVA_TRACKING_SPEED_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Additional view that computes with the x_speed, y_speed and z_speed components the vnorth, veast and vdown speed components as well as the absolute value speed in meters/second. &lt;br /&gt;
&lt;br /&gt;
In addition to the fields in the UVA_TRACKING view this view adds :&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|vnorth||float||||||- vx * sin(lat) * cos(long) - vy * sin(lat) * sin (long) + vz * cos(lat)&lt;br /&gt;
|-&lt;br /&gt;
|veast||float|||||| - vx * sin(lon) + vy * cos(lon)&lt;br /&gt;
|-&lt;br /&gt;
|vdown||float|||||| - vx * cos(lat) * cos(lon) - vy * cos(lat) * sin(lon) - vz * sin(lat)&lt;br /&gt;
|-&lt;br /&gt;
|speed||float|||||| sqrt(vx^2 + vy^2 + vz^2)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= UvAGPS functions =&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_speed ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters), time-interval, speed (meters/second) and heading (degrees) for a series of subsequent tracking entries with specific device_info_serial.&lt;br /&gt;
For the first entry in the sequence these values will always be missing because they are computed  as the difference between subsequent rows.&lt;br /&gt;
&lt;br /&gt;
Usage examples :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119);&lt;br /&gt;
&lt;br /&gt;
select t.*, a.distance, a.interval, a.speed, a.direction from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00') a join gps.uva_tracking t using(device_info_serial, date_time);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and heading are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. &lt;br /&gt;
The heading is the initial heading. PostGIS does not calculate the heading, so therefore we don't use PostGIS.&lt;br /&gt;
&lt;br /&gt;
In these functions the records that have been flagged as invalid by setting the '''userflag''' are not token into account and discarded. &lt;br /&gt;
If it is required get the speed for all records  a additional boolean argument for '''get raw data''' can be given. i.e.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00', true);&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, true);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) for UvAGPS tracks to arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, 52.1897017, 6.1996606); &lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, (select location from gps.uva_tracking where device_info_serial = 119 and date_time = '2009-05-07 19:55:08')); &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the distance is calculated with the PostGIS distance_sphere function which uses spherical correction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance_direction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) and direction (degrees) for UvAGPS tracks from arbitrary point in lat/long or geometry location&lt;br /&gt;
&lt;br /&gt;
Example usage: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and direction are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. The direction is the direction from the given point.&lt;br /&gt;
&lt;br /&gt;
In this function the records where the '''userflag''' has been set are discarded. To see  these records a additional boolean argument for '''show raw data''' should  be added like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606, true); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Accelerometer calibration =&lt;br /&gt;
&lt;br /&gt;
The accelerometer measures the acceleration in 3D (20 times per second). Acceleration is caused by gravity (static component) and by a change in speed (dynamic component). &lt;br /&gt;
When the logger is static in horizontal position (solar cells up), gravity (green arrow) shows a  heave (vertical acceleration, z) of +1 g (1 g = 9.81 m.s&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;) while surge and heave are both 0. When the front of the logger is vertically pointing down (forward acceleration, x), surge is +1g and when it is rolled to the right (sidewards acceleration, y) sway is +1g. Due to gravity, the pitch of a logger is thus translated into the values of heave, surge and sway (or z, x, y).&lt;br /&gt;
&lt;br /&gt;
However, the values are measured in mV instead of g. Before delivering the GPS-loggers, they have been calibrated at UvA. The acceleration (A) expressed in g is calculated from the measured value (M) and the calibration factors offset (''O'') and sensitivity (''S'').&lt;br /&gt;
&lt;br /&gt;
Thus acceleration for heave (z), surge (x) and sway (y) is calculated as:&lt;br /&gt;
A&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; ;      A&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;;      A&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; ; &lt;br /&gt;
&lt;br /&gt;
The values of ''O'' (in general ranging from 0-60, sometimes even 300) and ''S'' (ranging from 1300-1450) are available in the device table of the data base. If not available, use the factory defaults ''O'' = 0 and ''S'' = 1365.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:accelero1.png|300px]]||[[File:accelero2.png|300px]]|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the figure above heave (z) is shown in green, surge(x) in red and sway (y) in blue, all values are expressed in g (on the y-axis).&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=370</id>
		<title>UvAGPS</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=370"/>
				<updated>2011-01-12T12:10:07Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* UVA_TRACKING_DATA101 or UVA_TRACKING_LIMITED */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= UvAGPS Data Model =&lt;br /&gt;
&lt;br /&gt;
For different versions of the UvAGPS firmware different tables are used. For firmware version v0.9.3.6 till v1.0.0.X the tables UVA_ENGINEERING_DATA and UVA_TRACKING_DATA are used. But in the new firmware versions 1.0.1.4 till 1.0.2.4 so much information was added  that new tables were introduced. However for the most important tracking tables a view is created so that all similar tracking for all types of firmware can be seen in one view. That is the UVA_TRACKING view. &lt;br /&gt;
&lt;br /&gt;
All tables, views and functions are also in the GPS schema.&lt;br /&gt;
&lt;br /&gt;
Not everybody has access to all data.  For most users access is limited to &amp;quot;limited&amp;quot; views that only give access to selected devices. &lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA or UVA_TRACKING_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float8||||||Horizontal accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float8||||||Vertical accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||float8||||||m&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration||Float8||||||x axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) movement to right is + and to left is -&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration||Float8||||||y axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) forward movement is + and backwards is -&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration||Float8||||||z axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) upwards movement is + downwards is -&lt;br /&gt;
|-&lt;br /&gt;
|speed ||float8||||||m/s&lt;br /&gt;
|-&lt;br /&gt;
|course||float8||||||Degrees&lt;br /&gt;
|-&lt;br /&gt;
|pressure||float8||||||Pressure sensor (pascal)&lt;br /&gt;
|-&lt;br /&gt;
|temperature||Float8||||||Degrees celcius&lt;br /&gt;
|-&lt;br /&gt;
|solar_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|battery_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|userflag||Integer||||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|  “&amp;quot;location”&amp;quot;||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENGINEERING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Engineering data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|t_syncsts||smallint||||||0: not synced, 1: user synced, 2: Gps synced&lt;br /&gt;
|-&lt;br /&gt;
|t_entzt||smallint||||||0: UCT time,1: TZT time (timezone time)&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentrategps||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratecom||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratepwr||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagesolarpanel||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagebattery||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_chargemode||int2||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainrategps||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratecom||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratepwr||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_esavegpsrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_esavecomrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsnavigationmode||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtimeout||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|eh||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_DEVICE or UVA_DEVICE_LIMITED == &lt;br /&gt;
&lt;br /&gt;
To be able to track the different firmware versions and specific properties for the different devices the UVA_DEVICE table was added. This table also includes essential information needed to calibrate the accelerometers. For more information see [[UvAGPS|Accelerometer calibration]]&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL || Serial number of tag&lt;br /&gt;
|- &lt;br /&gt;
| firmware_version || text |||| NOT NULL || Firmware version installed on tag&lt;br /&gt;
|-&lt;br /&gt;
| device_mass || double |||||||Mass of tag (g)&lt;br /&gt;
|-&lt;br /&gt;
| x_s|| double |||||||Calibration sensitivity of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_s|| double |||||||Calibration sensitivity of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_s|| double |||||||Calibration sensitivity of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
| x_o|| double |||||||Calibration offset of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_o|| double |||||||Calibration offset of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_o|| double |||||||Calibration offset of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_COMM101 or UVA_COMM_LIMITED== &lt;br /&gt;
&lt;br /&gt;
Communication table indicates status and result of communications with ground stations. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
| date_time || timestamp || PK || NOT NULL || timestamp of start communication&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end || timestamp |||||| timestamp of end communication           &lt;br /&gt;
|-&lt;br /&gt;
| date_time_utc || timestamp |||||| date_time in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end_utc || timestamp |||||| date_time_end in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| action || text|||||| JOINED / RESCHEDULE  ??&lt;br /&gt;
|-&lt;br /&gt;
| bytes_communicated || integer |||||| Number of bytes communicated (total of all bytes per DATA line)  &lt;br /&gt;
|-&lt;br /&gt;
|status || text |||||| READY, TIMEOUT, LOWPOWER, MISSING&lt;br /&gt;
|-&lt;br /&gt;
| network_join_time || integer||||||milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| number_identical_lines || integer |||||| Number identical lines in data block. Gives indication &lt;br /&gt;
|-&lt;br /&gt;
| non_ascii_char || integer |||||| Number of non ascii characters (indicated by question-mark ?)&lt;br /&gt;
|-&lt;br /&gt;
| sts_time || timestamp |||||| derived from S0 hh,mi&lt;br /&gt;
|-&lt;br /&gt;
| timesynced || smallint|||||| TimeSynced (0=not sy:wnced, 1=user set, 2=Gps Synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode || smallint||||||DeviceMode (0-99)&lt;br /&gt;
|-&lt;br /&gt;
| vbat || float |||||| Battery voltage in V (0-~4.200V) &lt;br /&gt;
|-&lt;br /&gt;
|logb || integer |||||| logged bytes, waiting for download (0-4Mbyte)&lt;br /&gt;
|-&lt;br /&gt;
| logp || smallint |||||| Logged percentage (units 0.1%) of memory waiting to be downloaded (0-1000)&lt;br /&gt;
|-&lt;br /&gt;
| gpsii || integer |||||| GpsIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|comii || integer|||||| ComIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| AcceleroIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| User switches, current (0-65535) &lt;br /&gt;
|-&lt;br /&gt;
|last_gps_fix ||timestamp||||||timestamp of last fix&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||Latitude of last fix. Decimal degrees &lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||Longitude of last fix. Decimal degrees&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_SETTINGS101 or UVA_SETTINGS_LIMITED  == &lt;br /&gt;
&lt;br /&gt;
Settings are either from C0-C1-C9 lines or parsed from uplink communication lines &lt;br /&gt;
If C0-C1 is parsed its values are compared with the previous value and if the settings are the &lt;br /&gt;
same no new records needs to be added &lt;br /&gt;
If uplink settings are parsed wait till the last setting has been seen, (DL command or EOF) &lt;br /&gt;
then store all the new settings in one record. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||Derive timestamp from Hh:mi fields in C0 combined with computer timestamp in JOINED line&lt;br /&gt;
|-&lt;br /&gt;
|timesynced || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|timezone_time || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| SpecialUserSwitches &lt;br /&gt;
|-&lt;br /&gt;
|gpsnavmode || smallint|||||| GpsNavMode 0-7&lt;br /&gt;
|-&lt;br /&gt;
|gpsreceivermode || smallint |||||| GpsReceiverNode 0-3&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtime || smallint|||||| GpsFixTime 0-255&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_h || smallint|||||| hours Gps IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_m || smallint|||||| minutes Gps IvalN on &lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln  || integer|||||| GpsIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_h || smallint|||||| hours Gps IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_m || smallint|||||| minutes GpS IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale  || integer|||||| GpsIvalE &lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_h || smallint|||||| hours Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_m || smallint|||||| minutes Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln || integer|||||| ComIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_h || smallint|||||| hours Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_m || smallint|||||| minutes Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale || integer|||||| ComIvalE&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| Accelero measurement interval         &lt;br /&gt;
|-&lt;br /&gt;
|accbn || integer|||||| Accelero number of blocks &lt;br /&gt;
|-&lt;br /&gt;
|accsn || integer|||||| Accelero number of samples (0-65536)&lt;br /&gt;
|-&lt;br /&gt;
|f || smallint||||||Accelero sample frequency  (0=20Hz, 1=10Hz, 2=5Hz, 3=1Hz)&lt;br /&gt;
|-&lt;br /&gt;
|pdp || smallint|||||| PdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|pac||smallint|||||| PaccMsk (10-100)&lt;br /&gt;
|-&lt;br /&gt;
|tdp ||smallint|||||| TdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|tac ||smallint|||||| TaccMsk (30-300)&lt;br /&gt;
|-&lt;br /&gt;
|ga || smallint|||||| Additional Fixes GpsIval mode (3-25) before interval fix is logged&lt;br /&gt;
|-&lt;br /&gt;
|aol || smallint||||||AccMemOffLev (100 - 950) units 0.1%; if Memfull above  this level all Accelero activity will be overruled and switched off untill MemFull &amp;lt; level - 5&lt;br /&gt;
|-&lt;br /&gt;
|eventnum || text|||||| 12 eventnumbers (0-0xff) only printed if not zero, therfore converted to text&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA101 or UVA_TRACKING_LIMITED==&lt;br /&gt;
&lt;br /&gt;
The tracking dat for newer firmware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||integer||||||heigth above sealevel meters&lt;br /&gt;
|-&lt;br /&gt;
|pressure ||integer||||||in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature ||float||||||in celcius degrees&lt;br /&gt;
|-&lt;br /&gt;
|satellites_used ||smallint||||||satellites used for fix &lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime ||float||||||GpsFixTime in seconds &lt;br /&gt;
|-&lt;br /&gt;
|positiondop ||float||||||Position DOP in units&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy || float||||||Horizontal accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy || float||||||Vertical accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|x_speed ||float||||||Speed in x-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|y_speed ||float||||||Speed in y-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|z_speed ||float||||||Speed in z-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|speed_accuracy || float||||||Speed accuracy (m/s) &lt;br /&gt;
|-&lt;br /&gt;
|userflag||Integer||||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|location || geometry |||||| lat/long as PostGIS geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ACCELERATION101 or UVA_ACCELERATION_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Acceleration entries if accelerometer was turned on. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|index ||smallint||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration ||smallint||||||acceleration in X-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration ||smallint||||||acceleration in Y-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration ||smallint||||||acceleration in Z-axis (-2666 till 2666)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENERGY101 or UVA_ENERGY_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|timesynced ||smallint||||||TimeSynced (0=not synced, 1=user set, 2=Gps synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode ||smallint||||||(0-99)&lt;br /&gt;
|-&lt;br /&gt;
|vsll ||float||||||Solar Voltage during charging in mV (0-~2500)&lt;br /&gt;
|-&lt;br /&gt;
|vbat ||float||||||Battery Voltage in V (0-~4.200)&lt;br /&gt;
|-&lt;br /&gt;
|ssw ||smallint|||||| Solar Cell Switches ... (0-255) fw1022 and up &lt;br /&gt;
|-&lt;br /&gt;
| ||||||||extended fields if special user switch is on &lt;br /&gt;
|-&lt;br /&gt;
|vsoo ||float|||||| Solar voltage open in V (0-~2.500)&lt;br /&gt;
|-&lt;br /&gt;
|vdrf ||float||||||reference voltage Dac in V (0-~2.435)&lt;br /&gt;
|-&lt;br /&gt;
|vchr ||float||||||charge current voltage&lt;br /&gt;
|-&lt;br /&gt;
|g ||smallint|||||| Gps battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|c || smallint||||||Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|m || smallint||||||Charge Mode (0,1,2 Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|pressure || integer|||||| in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature || float|||||| in celcius degrees   &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING  or UVA_TRACKING_LIMITED == &lt;br /&gt;
&lt;br /&gt;
View to show identical fields for older and newer firmware tracking data&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|altitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|pressure||integer|||||&lt;br /&gt;
|-&lt;br /&gt;
|temperature||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|x_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|y_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|z_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|location||geometry||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_SPEED or UVA_TRACKING_SPEED_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Additional view that computes with the x_speed, y_speed and z_speed components the vnorth, veast and vdown speed components as well as the absolute value speed in meters/second. &lt;br /&gt;
&lt;br /&gt;
In addition to the fields in the UVA_TRACKING view this view adds :&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|vnorth||float||||||- vx * sin(lat) * cos(long) - vy * sin(lat) * sin (long) + vz * cos(lat)&lt;br /&gt;
|-&lt;br /&gt;
|veast||float|||||| - vx * sin(lon) + vy * cos(lon)&lt;br /&gt;
|-&lt;br /&gt;
|vdown||float|||||| - vx * cos(lat) * cos(lon) - vy * cos(lat) * sin(lon) - vz * sin(lat)&lt;br /&gt;
|-&lt;br /&gt;
|speed||float|||||| sqrt(vx^2 + vy^2 + vz^2)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= UvAGPS functions =&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_speed ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters), time-interval, speed (meters/second) and heading (degrees) for a series of subsequent tracking entries with specific device_info_serial.&lt;br /&gt;
For the first entry in the sequence these values will always be missing because they are computed  as the difference between subsequent rows.&lt;br /&gt;
&lt;br /&gt;
Usage examples :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119);&lt;br /&gt;
&lt;br /&gt;
select t.*, a.distance, a.interval, a.speed, a.direction from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00') a join gps.uva_tracking t using(device_info_serial, date_time);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and heading are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. &lt;br /&gt;
The heading is the initial heading. PostGIS does not calculate the heading, so therefore we don't use PostGIS.&lt;br /&gt;
&lt;br /&gt;
In these functions the records that have been flagged as invalid by setting the '''userflag''' are not token into account and discarded. &lt;br /&gt;
If it is required get the speed for all records  a additional boolean argument for '''get raw data''' can be given. i.e.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00', true);&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, true);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) for UvAGPS tracks to arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, 52.1897017, 6.1996606); &lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, (select location from gps.uva_tracking where device_info_serial = 119 and date_time = '2009-05-07 19:55:08')); &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the distance is calculated with the PostGIS distance_sphere function which uses spherical correction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance_direction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) and direction (degrees) for UvAGPS tracks from arbitrary point in lat/long or geometry location&lt;br /&gt;
&lt;br /&gt;
Example usage: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and direction are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. The direction is the direction from the given point.&lt;br /&gt;
&lt;br /&gt;
In this function the records where the '''userflag''' has been set are discarded. To see  these records a additional boolean argument for '''show raw data''' should  be added like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606, true); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Accelerometer calibration =&lt;br /&gt;
&lt;br /&gt;
The accelerometer measures the acceleration in 3D (20 times per second). Acceleration is caused by gravity (static component) and by a change in speed (dynamic component). &lt;br /&gt;
When the logger is static in horizontal position (solar cells up), gravity (green arrow) shows a  heave (vertical acceleration, z) of +1 g (1 g = 9.81 m.s&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;) while surge and heave are both 0. When the front of the logger is vertically pointing down (forward acceleration, x), surge is +1g and when it is rolled to the right (sidewards acceleration, y) sway is +1g. Due to gravity, the pitch of a logger is thus translated into the values of heave, surge and sway (or z, x, y).&lt;br /&gt;
&lt;br /&gt;
However, the values are measured in mV instead of g. Before delivering the GPS-loggers, they have been calibrated at UvA. The acceleration (A) expressed in g is calculated from the measured value (M) and the calibration factors offset (''O'') and sensitivity (''S'').&lt;br /&gt;
&lt;br /&gt;
Thus acceleration for heave (z), surge (x) and sway (y) is calculated as:&lt;br /&gt;
A&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; ;      A&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;;      A&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; ; &lt;br /&gt;
&lt;br /&gt;
The values of ''O'' (in general ranging from 0-60, sometimes even 300) and ''S'' (ranging from 1300-1450) are available in the device table of the data base. If not available, use the factory defaults ''O'' = 0 and ''S'' = 1365.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:accelero1.png|300px]]||[[File:accelero2.png|300px]]|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the figure above heave (z) is shown in green, surge(x) in red and sway (y) in blue, all values are expressed in g (on the y-axis).&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=369</id>
		<title>UvAGPS</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=369"/>
				<updated>2011-01-12T12:09:28Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* UVA_TRACKING_DATA or UVA_TRACKING_LIMITED */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= UvAGPS Data Model =&lt;br /&gt;
&lt;br /&gt;
For different versions of the UvAGPS firmware different tables are used. For firmware version v0.9.3.6 till v1.0.0.X the tables UVA_ENGINEERING_DATA and UVA_TRACKING_DATA are used. But in the new firmware versions 1.0.1.4 till 1.0.2.4 so much information was added  that new tables were introduced. However for the most important tracking tables a view is created so that all similar tracking for all types of firmware can be seen in one view. That is the UVA_TRACKING view. &lt;br /&gt;
&lt;br /&gt;
All tables, views and functions are also in the GPS schema.&lt;br /&gt;
&lt;br /&gt;
Not everybody has access to all data.  For most users access is limited to &amp;quot;limited&amp;quot; views that only give access to selected devices. &lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA or UVA_TRACKING_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float8||||||Horizontal accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float8||||||Vertical accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||float8||||||m&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration||Float8||||||x axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) movement to right is + and to left is -&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration||Float8||||||y axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) forward movement is + and backwards is -&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration||Float8||||||z axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) upwards movement is + downwards is -&lt;br /&gt;
|-&lt;br /&gt;
|speed ||float8||||||m/s&lt;br /&gt;
|-&lt;br /&gt;
|course||float8||||||Degrees&lt;br /&gt;
|-&lt;br /&gt;
|pressure||float8||||||Pressure sensor (pascal)&lt;br /&gt;
|-&lt;br /&gt;
|temperature||Float8||||||Degrees celcius&lt;br /&gt;
|-&lt;br /&gt;
|solar_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|battery_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|userflag||Integer||||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|  “&amp;quot;location”&amp;quot;||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENGINEERING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Engineering data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|t_syncsts||smallint||||||0: not synced, 1: user synced, 2: Gps synced&lt;br /&gt;
|-&lt;br /&gt;
|t_entzt||smallint||||||0: UCT time,1: TZT time (timezone time)&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentrategps||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratecom||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratepwr||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagesolarpanel||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagebattery||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_chargemode||int2||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainrategps||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratecom||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratepwr||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_esavegpsrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_esavecomrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsnavigationmode||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtimeout||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|eh||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_DEVICE or UVA_DEVICE_LIMITED == &lt;br /&gt;
&lt;br /&gt;
To be able to track the different firmware versions and specific properties for the different devices the UVA_DEVICE table was added. This table also includes essential information needed to calibrate the accelerometers. For more information see [[UvAGPS|Accelerometer calibration]]&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL || Serial number of tag&lt;br /&gt;
|- &lt;br /&gt;
| firmware_version || text |||| NOT NULL || Firmware version installed on tag&lt;br /&gt;
|-&lt;br /&gt;
| device_mass || double |||||||Mass of tag (g)&lt;br /&gt;
|-&lt;br /&gt;
| x_s|| double |||||||Calibration sensitivity of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_s|| double |||||||Calibration sensitivity of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_s|| double |||||||Calibration sensitivity of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
| x_o|| double |||||||Calibration offset of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_o|| double |||||||Calibration offset of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_o|| double |||||||Calibration offset of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_COMM101 or UVA_COMM_LIMITED== &lt;br /&gt;
&lt;br /&gt;
Communication table indicates status and result of communications with ground stations. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
| date_time || timestamp || PK || NOT NULL || timestamp of start communication&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end || timestamp |||||| timestamp of end communication           &lt;br /&gt;
|-&lt;br /&gt;
| date_time_utc || timestamp |||||| date_time in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end_utc || timestamp |||||| date_time_end in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| action || text|||||| JOINED / RESCHEDULE  ??&lt;br /&gt;
|-&lt;br /&gt;
| bytes_communicated || integer |||||| Number of bytes communicated (total of all bytes per DATA line)  &lt;br /&gt;
|-&lt;br /&gt;
|status || text |||||| READY, TIMEOUT, LOWPOWER, MISSING&lt;br /&gt;
|-&lt;br /&gt;
| network_join_time || integer||||||milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| number_identical_lines || integer |||||| Number identical lines in data block. Gives indication &lt;br /&gt;
|-&lt;br /&gt;
| non_ascii_char || integer |||||| Number of non ascii characters (indicated by question-mark ?)&lt;br /&gt;
|-&lt;br /&gt;
| sts_time || timestamp |||||| derived from S0 hh,mi&lt;br /&gt;
|-&lt;br /&gt;
| timesynced || smallint|||||| TimeSynced (0=not sy:wnced, 1=user set, 2=Gps Synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode || smallint||||||DeviceMode (0-99)&lt;br /&gt;
|-&lt;br /&gt;
| vbat || float |||||| Battery voltage in V (0-~4.200V) &lt;br /&gt;
|-&lt;br /&gt;
|logb || integer |||||| logged bytes, waiting for download (0-4Mbyte)&lt;br /&gt;
|-&lt;br /&gt;
| logp || smallint |||||| Logged percentage (units 0.1%) of memory waiting to be downloaded (0-1000)&lt;br /&gt;
|-&lt;br /&gt;
| gpsii || integer |||||| GpsIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|comii || integer|||||| ComIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| AcceleroIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| User switches, current (0-65535) &lt;br /&gt;
|-&lt;br /&gt;
|last_gps_fix ||timestamp||||||timestamp of last fix&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||Latitude of last fix. Decimal degrees &lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||Longitude of last fix. Decimal degrees&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_SETTINGS101 or UVA_SETTINGS_LIMITED  == &lt;br /&gt;
&lt;br /&gt;
Settings are either from C0-C1-C9 lines or parsed from uplink communication lines &lt;br /&gt;
If C0-C1 is parsed its values are compared with the previous value and if the settings are the &lt;br /&gt;
same no new records needs to be added &lt;br /&gt;
If uplink settings are parsed wait till the last setting has been seen, (DL command or EOF) &lt;br /&gt;
then store all the new settings in one record. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||Derive timestamp from Hh:mi fields in C0 combined with computer timestamp in JOINED line&lt;br /&gt;
|-&lt;br /&gt;
|timesynced || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|timezone_time || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| SpecialUserSwitches &lt;br /&gt;
|-&lt;br /&gt;
|gpsnavmode || smallint|||||| GpsNavMode 0-7&lt;br /&gt;
|-&lt;br /&gt;
|gpsreceivermode || smallint |||||| GpsReceiverNode 0-3&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtime || smallint|||||| GpsFixTime 0-255&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_h || smallint|||||| hours Gps IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_m || smallint|||||| minutes Gps IvalN on &lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln  || integer|||||| GpsIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_h || smallint|||||| hours Gps IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_m || smallint|||||| minutes GpS IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale  || integer|||||| GpsIvalE &lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_h || smallint|||||| hours Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_m || smallint|||||| minutes Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln || integer|||||| ComIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_h || smallint|||||| hours Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_m || smallint|||||| minutes Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale || integer|||||| ComIvalE&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| Accelero measurement interval         &lt;br /&gt;
|-&lt;br /&gt;
|accbn || integer|||||| Accelero number of blocks &lt;br /&gt;
|-&lt;br /&gt;
|accsn || integer|||||| Accelero number of samples (0-65536)&lt;br /&gt;
|-&lt;br /&gt;
|f || smallint||||||Accelero sample frequency  (0=20Hz, 1=10Hz, 2=5Hz, 3=1Hz)&lt;br /&gt;
|-&lt;br /&gt;
|pdp || smallint|||||| PdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|pac||smallint|||||| PaccMsk (10-100)&lt;br /&gt;
|-&lt;br /&gt;
|tdp ||smallint|||||| TdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|tac ||smallint|||||| TaccMsk (30-300)&lt;br /&gt;
|-&lt;br /&gt;
|ga || smallint|||||| Additional Fixes GpsIval mode (3-25) before interval fix is logged&lt;br /&gt;
|-&lt;br /&gt;
|aol || smallint||||||AccMemOffLev (100 - 950) units 0.1%; if Memfull above  this level all Accelero activity will be overruled and switched off untill MemFull &amp;lt; level - 5&lt;br /&gt;
|-&lt;br /&gt;
|eventnum || text|||||| 12 eventnumbers (0-0xff) only printed if not zero, therfore converted to text&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA101 or UVA_TRACKING_LIMITED==&lt;br /&gt;
&lt;br /&gt;
The tracking dat for newer firmware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||integer||||||heigth above sealevel meters&lt;br /&gt;
|-&lt;br /&gt;
|pressure ||integer||||||in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature ||float||||||in celcius degrees&lt;br /&gt;
|-&lt;br /&gt;
|satellites_used ||smallint||||||satellites used for fix &lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime ||float||||||GpsFixTime in seconds &lt;br /&gt;
|-&lt;br /&gt;
|positiondop ||float||||||Position DOP in units&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy || float||||||Horizontal accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy || float||||||Vertical accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|x_speed ||float||||||Speed in x-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|y_speed ||float||||||Speed in y-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|z_speed ||float||||||Speed in z-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|speed_accuracy || float||||||Speed accuracy (m/s) &lt;br /&gt;
|-&lt;br /&gt;
|location || geometry |||||| lat/long as PostGIS geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_ACCELERATION101 or UVA_ACCELERATION_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Acceleration entries if accelerometer was turned on. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|index ||smallint||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration ||smallint||||||acceleration in X-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration ||smallint||||||acceleration in Y-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration ||smallint||||||acceleration in Z-axis (-2666 till 2666)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENERGY101 or UVA_ENERGY_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|timesynced ||smallint||||||TimeSynced (0=not synced, 1=user set, 2=Gps synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode ||smallint||||||(0-99)&lt;br /&gt;
|-&lt;br /&gt;
|vsll ||float||||||Solar Voltage during charging in mV (0-~2500)&lt;br /&gt;
|-&lt;br /&gt;
|vbat ||float||||||Battery Voltage in V (0-~4.200)&lt;br /&gt;
|-&lt;br /&gt;
|ssw ||smallint|||||| Solar Cell Switches ... (0-255) fw1022 and up &lt;br /&gt;
|-&lt;br /&gt;
| ||||||||extended fields if special user switch is on &lt;br /&gt;
|-&lt;br /&gt;
|vsoo ||float|||||| Solar voltage open in V (0-~2.500)&lt;br /&gt;
|-&lt;br /&gt;
|vdrf ||float||||||reference voltage Dac in V (0-~2.435)&lt;br /&gt;
|-&lt;br /&gt;
|vchr ||float||||||charge current voltage&lt;br /&gt;
|-&lt;br /&gt;
|g ||smallint|||||| Gps battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|c || smallint||||||Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|m || smallint||||||Charge Mode (0,1,2 Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|pressure || integer|||||| in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature || float|||||| in celcius degrees   &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING  or UVA_TRACKING_LIMITED == &lt;br /&gt;
&lt;br /&gt;
View to show identical fields for older and newer firmware tracking data&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|altitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|pressure||integer|||||&lt;br /&gt;
|-&lt;br /&gt;
|temperature||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|x_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|y_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|z_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|location||geometry||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_SPEED or UVA_TRACKING_SPEED_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Additional view that computes with the x_speed, y_speed and z_speed components the vnorth, veast and vdown speed components as well as the absolute value speed in meters/second. &lt;br /&gt;
&lt;br /&gt;
In addition to the fields in the UVA_TRACKING view this view adds :&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|vnorth||float||||||- vx * sin(lat) * cos(long) - vy * sin(lat) * sin (long) + vz * cos(lat)&lt;br /&gt;
|-&lt;br /&gt;
|veast||float|||||| - vx * sin(lon) + vy * cos(lon)&lt;br /&gt;
|-&lt;br /&gt;
|vdown||float|||||| - vx * cos(lat) * cos(lon) - vy * cos(lat) * sin(lon) - vz * sin(lat)&lt;br /&gt;
|-&lt;br /&gt;
|speed||float|||||| sqrt(vx^2 + vy^2 + vz^2)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= UvAGPS functions =&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_speed ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters), time-interval, speed (meters/second) and heading (degrees) for a series of subsequent tracking entries with specific device_info_serial.&lt;br /&gt;
For the first entry in the sequence these values will always be missing because they are computed  as the difference between subsequent rows.&lt;br /&gt;
&lt;br /&gt;
Usage examples :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119);&lt;br /&gt;
&lt;br /&gt;
select t.*, a.distance, a.interval, a.speed, a.direction from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00') a join gps.uva_tracking t using(device_info_serial, date_time);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and heading are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. &lt;br /&gt;
The heading is the initial heading. PostGIS does not calculate the heading, so therefore we don't use PostGIS.&lt;br /&gt;
&lt;br /&gt;
In these functions the records that have been flagged as invalid by setting the '''userflag''' are not token into account and discarded. &lt;br /&gt;
If it is required get the speed for all records  a additional boolean argument for '''get raw data''' can be given. i.e.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00', true);&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, true);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) for UvAGPS tracks to arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, 52.1897017, 6.1996606); &lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, (select location from gps.uva_tracking where device_info_serial = 119 and date_time = '2009-05-07 19:55:08')); &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the distance is calculated with the PostGIS distance_sphere function which uses spherical correction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance_direction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) and direction (degrees) for UvAGPS tracks from arbitrary point in lat/long or geometry location&lt;br /&gt;
&lt;br /&gt;
Example usage: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and direction are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. The direction is the direction from the given point.&lt;br /&gt;
&lt;br /&gt;
In this function the records where the '''userflag''' has been set are discarded. To see  these records a additional boolean argument for '''show raw data''' should  be added like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606, true); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Accelerometer calibration =&lt;br /&gt;
&lt;br /&gt;
The accelerometer measures the acceleration in 3D (20 times per second). Acceleration is caused by gravity (static component) and by a change in speed (dynamic component). &lt;br /&gt;
When the logger is static in horizontal position (solar cells up), gravity (green arrow) shows a  heave (vertical acceleration, z) of +1 g (1 g = 9.81 m.s&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;) while surge and heave are both 0. When the front of the logger is vertically pointing down (forward acceleration, x), surge is +1g and when it is rolled to the right (sidewards acceleration, y) sway is +1g. Due to gravity, the pitch of a logger is thus translated into the values of heave, surge and sway (or z, x, y).&lt;br /&gt;
&lt;br /&gt;
However, the values are measured in mV instead of g. Before delivering the GPS-loggers, they have been calibrated at UvA. The acceleration (A) expressed in g is calculated from the measured value (M) and the calibration factors offset (''O'') and sensitivity (''S'').&lt;br /&gt;
&lt;br /&gt;
Thus acceleration for heave (z), surge (x) and sway (y) is calculated as:&lt;br /&gt;
A&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; ;      A&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;;      A&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; ; &lt;br /&gt;
&lt;br /&gt;
The values of ''O'' (in general ranging from 0-60, sometimes even 300) and ''S'' (ranging from 1300-1450) are available in the device table of the data base. If not available, use the factory defaults ''O'' = 0 and ''S'' = 1365.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:accelero1.png|300px]]||[[File:accelero2.png|300px]]|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the figure above heave (z) is shown in green, surge(x) in red and sway (y) in blue, all values are expressed in g (on the y-axis).&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=368</id>
		<title>UvAGPS</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=368"/>
				<updated>2011-01-12T12:08:52Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* UVA_TRACKING_DATA or UVA_TRACKING_LIMITED */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= UvAGPS Data Model =&lt;br /&gt;
&lt;br /&gt;
For different versions of the UvAGPS firmware different tables are used. For firmware version v0.9.3.6 till v1.0.0.X the tables UVA_ENGINEERING_DATA and UVA_TRACKING_DATA are used. But in the new firmware versions 1.0.1.4 till 1.0.2.4 so much information was added  that new tables were introduced. However for the most important tracking tables a view is created so that all similar tracking for all types of firmware can be seen in one view. That is the UVA_TRACKING view. &lt;br /&gt;
&lt;br /&gt;
All tables, views and functions are also in the GPS schema.&lt;br /&gt;
&lt;br /&gt;
Not everybody has access to all data.  For most users access is limited to &amp;quot;limited&amp;quot; views that only give access to selected devices. &lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA or UVA_TRACKING_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float8||||||Horizontal accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float8||||||Vertical accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||float8||||||m&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration||Float8||||||x axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) movement to right is + and to left is -&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration||Float8||||||y axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) forward movement is + and backwards is -&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration||Float8||||||z axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) upwards movement is + downwards is -&lt;br /&gt;
|-&lt;br /&gt;
|speed ||float8||||||m/s&lt;br /&gt;
|-&lt;br /&gt;
|course||float8||||||Degrees&lt;br /&gt;
|-&lt;br /&gt;
|pressure||float8||||||Pressure sensor (pascal)&lt;br /&gt;
|-&lt;br /&gt;
|temperature||Float8||||||Degrees celcius&lt;br /&gt;
|-&lt;br /&gt;
|solar_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|battery_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|userflag||text||Integer||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|  “&amp;quot;location”&amp;quot;||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENGINEERING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Engineering data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|t_syncsts||smallint||||||0: not synced, 1: user synced, 2: Gps synced&lt;br /&gt;
|-&lt;br /&gt;
|t_entzt||smallint||||||0: UCT time,1: TZT time (timezone time)&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentrategps||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratecom||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratepwr||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagesolarpanel||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagebattery||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_chargemode||int2||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainrategps||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratecom||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratepwr||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_esavegpsrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_esavecomrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsnavigationmode||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtimeout||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|eh||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_DEVICE or UVA_DEVICE_LIMITED == &lt;br /&gt;
&lt;br /&gt;
To be able to track the different firmware versions and specific properties for the different devices the UVA_DEVICE table was added. This table also includes essential information needed to calibrate the accelerometers. For more information see [[UvAGPS|Accelerometer calibration]]&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL || Serial number of tag&lt;br /&gt;
|- &lt;br /&gt;
| firmware_version || text |||| NOT NULL || Firmware version installed on tag&lt;br /&gt;
|-&lt;br /&gt;
| device_mass || double |||||||Mass of tag (g)&lt;br /&gt;
|-&lt;br /&gt;
| x_s|| double |||||||Calibration sensitivity of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_s|| double |||||||Calibration sensitivity of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_s|| double |||||||Calibration sensitivity of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
| x_o|| double |||||||Calibration offset of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_o|| double |||||||Calibration offset of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_o|| double |||||||Calibration offset of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_COMM101 or UVA_COMM_LIMITED== &lt;br /&gt;
&lt;br /&gt;
Communication table indicates status and result of communications with ground stations. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
| date_time || timestamp || PK || NOT NULL || timestamp of start communication&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end || timestamp |||||| timestamp of end communication           &lt;br /&gt;
|-&lt;br /&gt;
| date_time_utc || timestamp |||||| date_time in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end_utc || timestamp |||||| date_time_end in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| action || text|||||| JOINED / RESCHEDULE  ??&lt;br /&gt;
|-&lt;br /&gt;
| bytes_communicated || integer |||||| Number of bytes communicated (total of all bytes per DATA line)  &lt;br /&gt;
|-&lt;br /&gt;
|status || text |||||| READY, TIMEOUT, LOWPOWER, MISSING&lt;br /&gt;
|-&lt;br /&gt;
| network_join_time || integer||||||milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| number_identical_lines || integer |||||| Number identical lines in data block. Gives indication &lt;br /&gt;
|-&lt;br /&gt;
| non_ascii_char || integer |||||| Number of non ascii characters (indicated by question-mark ?)&lt;br /&gt;
|-&lt;br /&gt;
| sts_time || timestamp |||||| derived from S0 hh,mi&lt;br /&gt;
|-&lt;br /&gt;
| timesynced || smallint|||||| TimeSynced (0=not sy:wnced, 1=user set, 2=Gps Synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode || smallint||||||DeviceMode (0-99)&lt;br /&gt;
|-&lt;br /&gt;
| vbat || float |||||| Battery voltage in V (0-~4.200V) &lt;br /&gt;
|-&lt;br /&gt;
|logb || integer |||||| logged bytes, waiting for download (0-4Mbyte)&lt;br /&gt;
|-&lt;br /&gt;
| logp || smallint |||||| Logged percentage (units 0.1%) of memory waiting to be downloaded (0-1000)&lt;br /&gt;
|-&lt;br /&gt;
| gpsii || integer |||||| GpsIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|comii || integer|||||| ComIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| AcceleroIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| User switches, current (0-65535) &lt;br /&gt;
|-&lt;br /&gt;
|last_gps_fix ||timestamp||||||timestamp of last fix&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||Latitude of last fix. Decimal degrees &lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||Longitude of last fix. Decimal degrees&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_SETTINGS101 or UVA_SETTINGS_LIMITED  == &lt;br /&gt;
&lt;br /&gt;
Settings are either from C0-C1-C9 lines or parsed from uplink communication lines &lt;br /&gt;
If C0-C1 is parsed its values are compared with the previous value and if the settings are the &lt;br /&gt;
same no new records needs to be added &lt;br /&gt;
If uplink settings are parsed wait till the last setting has been seen, (DL command or EOF) &lt;br /&gt;
then store all the new settings in one record. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||Derive timestamp from Hh:mi fields in C0 combined with computer timestamp in JOINED line&lt;br /&gt;
|-&lt;br /&gt;
|timesynced || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|timezone_time || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| SpecialUserSwitches &lt;br /&gt;
|-&lt;br /&gt;
|gpsnavmode || smallint|||||| GpsNavMode 0-7&lt;br /&gt;
|-&lt;br /&gt;
|gpsreceivermode || smallint |||||| GpsReceiverNode 0-3&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtime || smallint|||||| GpsFixTime 0-255&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_h || smallint|||||| hours Gps IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_m || smallint|||||| minutes Gps IvalN on &lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln  || integer|||||| GpsIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_h || smallint|||||| hours Gps IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_m || smallint|||||| minutes GpS IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale  || integer|||||| GpsIvalE &lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_h || smallint|||||| hours Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_m || smallint|||||| minutes Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln || integer|||||| ComIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_h || smallint|||||| hours Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_m || smallint|||||| minutes Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale || integer|||||| ComIvalE&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| Accelero measurement interval         &lt;br /&gt;
|-&lt;br /&gt;
|accbn || integer|||||| Accelero number of blocks &lt;br /&gt;
|-&lt;br /&gt;
|accsn || integer|||||| Accelero number of samples (0-65536)&lt;br /&gt;
|-&lt;br /&gt;
|f || smallint||||||Accelero sample frequency  (0=20Hz, 1=10Hz, 2=5Hz, 3=1Hz)&lt;br /&gt;
|-&lt;br /&gt;
|pdp || smallint|||||| PdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|pac||smallint|||||| PaccMsk (10-100)&lt;br /&gt;
|-&lt;br /&gt;
|tdp ||smallint|||||| TdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|tac ||smallint|||||| TaccMsk (30-300)&lt;br /&gt;
|-&lt;br /&gt;
|ga || smallint|||||| Additional Fixes GpsIval mode (3-25) before interval fix is logged&lt;br /&gt;
|-&lt;br /&gt;
|aol || smallint||||||AccMemOffLev (100 - 950) units 0.1%; if Memfull above  this level all Accelero activity will be overruled and switched off untill MemFull &amp;lt; level - 5&lt;br /&gt;
|-&lt;br /&gt;
|eventnum || text|||||| 12 eventnumbers (0-0xff) only printed if not zero, therfore converted to text&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA101 or UVA_TRACKING_LIMITED==&lt;br /&gt;
&lt;br /&gt;
The tracking dat for newer firmware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||integer||||||heigth above sealevel meters&lt;br /&gt;
|-&lt;br /&gt;
|pressure ||integer||||||in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature ||float||||||in celcius degrees&lt;br /&gt;
|-&lt;br /&gt;
|satellites_used ||smallint||||||satellites used for fix &lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime ||float||||||GpsFixTime in seconds &lt;br /&gt;
|-&lt;br /&gt;
|positiondop ||float||||||Position DOP in units&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy || float||||||Horizontal accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy || float||||||Vertical accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|x_speed ||float||||||Speed in x-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|y_speed ||float||||||Speed in y-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|z_speed ||float||||||Speed in z-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|speed_accuracy || float||||||Speed accuracy (m/s) &lt;br /&gt;
|-&lt;br /&gt;
|location || geometry |||||| lat/long as PostGIS geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_ACCELERATION101 or UVA_ACCELERATION_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Acceleration entries if accelerometer was turned on. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|index ||smallint||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration ||smallint||||||acceleration in X-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration ||smallint||||||acceleration in Y-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration ||smallint||||||acceleration in Z-axis (-2666 till 2666)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENERGY101 or UVA_ENERGY_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|timesynced ||smallint||||||TimeSynced (0=not synced, 1=user set, 2=Gps synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode ||smallint||||||(0-99)&lt;br /&gt;
|-&lt;br /&gt;
|vsll ||float||||||Solar Voltage during charging in mV (0-~2500)&lt;br /&gt;
|-&lt;br /&gt;
|vbat ||float||||||Battery Voltage in V (0-~4.200)&lt;br /&gt;
|-&lt;br /&gt;
|ssw ||smallint|||||| Solar Cell Switches ... (0-255) fw1022 and up &lt;br /&gt;
|-&lt;br /&gt;
| ||||||||extended fields if special user switch is on &lt;br /&gt;
|-&lt;br /&gt;
|vsoo ||float|||||| Solar voltage open in V (0-~2.500)&lt;br /&gt;
|-&lt;br /&gt;
|vdrf ||float||||||reference voltage Dac in V (0-~2.435)&lt;br /&gt;
|-&lt;br /&gt;
|vchr ||float||||||charge current voltage&lt;br /&gt;
|-&lt;br /&gt;
|g ||smallint|||||| Gps battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|c || smallint||||||Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|m || smallint||||||Charge Mode (0,1,2 Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|pressure || integer|||||| in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature || float|||||| in celcius degrees   &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING  or UVA_TRACKING_LIMITED == &lt;br /&gt;
&lt;br /&gt;
View to show identical fields for older and newer firmware tracking data&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|altitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|pressure||integer|||||&lt;br /&gt;
|-&lt;br /&gt;
|temperature||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|x_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|y_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|z_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|location||geometry||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_SPEED or UVA_TRACKING_SPEED_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Additional view that computes with the x_speed, y_speed and z_speed components the vnorth, veast and vdown speed components as well as the absolute value speed in meters/second. &lt;br /&gt;
&lt;br /&gt;
In addition to the fields in the UVA_TRACKING view this view adds :&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|vnorth||float||||||- vx * sin(lat) * cos(long) - vy * sin(lat) * sin (long) + vz * cos(lat)&lt;br /&gt;
|-&lt;br /&gt;
|veast||float|||||| - vx * sin(lon) + vy * cos(lon)&lt;br /&gt;
|-&lt;br /&gt;
|vdown||float|||||| - vx * cos(lat) * cos(lon) - vy * cos(lat) * sin(lon) - vz * sin(lat)&lt;br /&gt;
|-&lt;br /&gt;
|speed||float|||||| sqrt(vx^2 + vy^2 + vz^2)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= UvAGPS functions =&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_speed ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters), time-interval, speed (meters/second) and heading (degrees) for a series of subsequent tracking entries with specific device_info_serial.&lt;br /&gt;
For the first entry in the sequence these values will always be missing because they are computed  as the difference between subsequent rows.&lt;br /&gt;
&lt;br /&gt;
Usage examples :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119);&lt;br /&gt;
&lt;br /&gt;
select t.*, a.distance, a.interval, a.speed, a.direction from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00') a join gps.uva_tracking t using(device_info_serial, date_time);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and heading are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. &lt;br /&gt;
The heading is the initial heading. PostGIS does not calculate the heading, so therefore we don't use PostGIS.&lt;br /&gt;
&lt;br /&gt;
In these functions the records that have been flagged as invalid by setting the '''userflag''' are not token into account and discarded. &lt;br /&gt;
If it is required get the speed for all records  a additional boolean argument for '''get raw data''' can be given. i.e.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00', true);&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, true);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) for UvAGPS tracks to arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, 52.1897017, 6.1996606); &lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, (select location from gps.uva_tracking where device_info_serial = 119 and date_time = '2009-05-07 19:55:08')); &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the distance is calculated with the PostGIS distance_sphere function which uses spherical correction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance_direction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) and direction (degrees) for UvAGPS tracks from arbitrary point in lat/long or geometry location&lt;br /&gt;
&lt;br /&gt;
Example usage: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and direction are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. The direction is the direction from the given point.&lt;br /&gt;
&lt;br /&gt;
In this function the records where the '''userflag''' has been set are discarded. To see  these records a additional boolean argument for '''show raw data''' should  be added like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606, true); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Accelerometer calibration =&lt;br /&gt;
&lt;br /&gt;
The accelerometer measures the acceleration in 3D (20 times per second). Acceleration is caused by gravity (static component) and by a change in speed (dynamic component). &lt;br /&gt;
When the logger is static in horizontal position (solar cells up), gravity (green arrow) shows a  heave (vertical acceleration, z) of +1 g (1 g = 9.81 m.s&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;) while surge and heave are both 0. When the front of the logger is vertically pointing down (forward acceleration, x), surge is +1g and when it is rolled to the right (sidewards acceleration, y) sway is +1g. Due to gravity, the pitch of a logger is thus translated into the values of heave, surge and sway (or z, x, y).&lt;br /&gt;
&lt;br /&gt;
However, the values are measured in mV instead of g. Before delivering the GPS-loggers, they have been calibrated at UvA. The acceleration (A) expressed in g is calculated from the measured value (M) and the calibration factors offset (''O'') and sensitivity (''S'').&lt;br /&gt;
&lt;br /&gt;
Thus acceleration for heave (z), surge (x) and sway (y) is calculated as:&lt;br /&gt;
A&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; ;      A&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;;      A&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; ; &lt;br /&gt;
&lt;br /&gt;
The values of ''O'' (in general ranging from 0-60, sometimes even 300) and ''S'' (ranging from 1300-1450) are available in the device table of the data base. If not available, use the factory defaults ''O'' = 0 and ''S'' = 1365.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:accelero1.png|300px]]||[[File:accelero2.png|300px]]|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the figure above heave (z) is shown in green, surge(x) in red and sway (y) in blue, all values are expressed in g (on the y-axis).&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=ToDo&amp;diff=367</id>
		<title>ToDo</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=ToDo&amp;diff=367"/>
				<updated>2010-12-24T10:14:22Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* ToDo List */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ToDo List == &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* View/function to identify foraging trips &lt;br /&gt;
&lt;br /&gt;
* Update speed function to account for userflag (december 2010)  &lt;br /&gt;
&lt;br /&gt;
* Create Flagging facility for invalid tracking data (december 2010) &lt;br /&gt;
&lt;br /&gt;
* Fix UvAGPS KMZ generator (color range, symbol selection) (november 2010)&lt;br /&gt;
&lt;br /&gt;
* Make a readonly copy of Flysafe Wiki on public server (september 2010) &lt;br /&gt;
 &lt;br /&gt;
* Improve UvA GPS parser to log errors such as CRC8 in database (september 2010) &lt;br /&gt;
&lt;br /&gt;
* Implement service to create graphs for UvAGPS devices according to Willem's Matlab scripts  ( october 2010)&lt;br /&gt;
&lt;br /&gt;
* Import UvAGPS log files via standard storage facility ( november 2010) &lt;br /&gt;
&lt;br /&gt;
* Implement generate KML service for for UvAGPS on public server (october 2010) &lt;br /&gt;
&lt;br /&gt;
* Define and implement service to flag invalid GPS tracks  (november 2010)&lt;br /&gt;
&lt;br /&gt;
* Add accelerometer calibration factors to uva_device (september 2010)&lt;br /&gt;
&lt;br /&gt;
* Import UvAGPS metadata. (november 2010)&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=366</id>
		<title>UvAGPS</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=366"/>
				<updated>2010-12-24T10:13:56Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* get_uvagps_track_speed */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= UvAGPS Data Model =&lt;br /&gt;
&lt;br /&gt;
For different versions of the UvAGPS firmware different tables are used. For firmware version v0.9.3.6 till v1.0.0.X the tables UVA_ENGINEERING_DATA and UVA_TRACKING_DATA are used. But in the new firmware versions 1.0.1.4 till 1.0.2.4 so much information was added  that new tables were introduced. However for the most important tracking tables a view is created so that all similar tracking for all types of firmware can be seen in one view. That is the UVA_TRACKING view. &lt;br /&gt;
&lt;br /&gt;
All tables, views and functions are also in the GPS schema.&lt;br /&gt;
&lt;br /&gt;
Not everybody has access to all data.  For most users access is limited to &amp;quot;limited&amp;quot; views that only give access to selected devices. &lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA or UVA_TRACKING_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float8||||||Horizontal accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float8||||||Vertical accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||float8||||||m&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration||Float8||||||x axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) movement to right is + and to left is -&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration||Float8||||||y axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) forward movement is + and backwards is -&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration||Float8||||||z axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) upwards movement is + downwards is -&lt;br /&gt;
|-&lt;br /&gt;
|speed ||float8||||||m/s&lt;br /&gt;
|-&lt;br /&gt;
|course||float8||||||Degrees&lt;br /&gt;
|-&lt;br /&gt;
|pressure||float8||||||Pressure sensor (pascal)&lt;br /&gt;
|-&lt;br /&gt;
|temperature||Float8||||||Degrees celcius&lt;br /&gt;
|-&lt;br /&gt;
|solar_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|battery_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|quality||text||||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|  “&amp;quot;location”&amp;quot;||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENGINEERING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Engineering data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|t_syncsts||smallint||||||0: not synced, 1: user synced, 2: Gps synced&lt;br /&gt;
|-&lt;br /&gt;
|t_entzt||smallint||||||0: UCT time,1: TZT time (timezone time)&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentrategps||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratecom||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratepwr||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagesolarpanel||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagebattery||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_chargemode||int2||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainrategps||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratecom||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratepwr||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_esavegpsrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_esavecomrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsnavigationmode||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtimeout||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|eh||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_DEVICE or UVA_DEVICE_LIMITED == &lt;br /&gt;
&lt;br /&gt;
To be able to track the different firmware versions and specific properties for the different devices the UVA_DEVICE table was added. This table also includes essential information needed to calibrate the accelerometers. For more information see [[UvAGPS|Accelerometer calibration]]&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL || Serial number of tag&lt;br /&gt;
|- &lt;br /&gt;
| firmware_version || text |||| NOT NULL || Firmware version installed on tag&lt;br /&gt;
|-&lt;br /&gt;
| device_mass || double |||||||Mass of tag (g)&lt;br /&gt;
|-&lt;br /&gt;
| x_s|| double |||||||Calibration sensitivity of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_s|| double |||||||Calibration sensitivity of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_s|| double |||||||Calibration sensitivity of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
| x_o|| double |||||||Calibration offset of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_o|| double |||||||Calibration offset of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_o|| double |||||||Calibration offset of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_COMM101 or UVA_COMM_LIMITED== &lt;br /&gt;
&lt;br /&gt;
Communication table indicates status and result of communications with ground stations. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
| date_time || timestamp || PK || NOT NULL || timestamp of start communication&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end || timestamp |||||| timestamp of end communication           &lt;br /&gt;
|-&lt;br /&gt;
| date_time_utc || timestamp |||||| date_time in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end_utc || timestamp |||||| date_time_end in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| action || text|||||| JOINED / RESCHEDULE  ??&lt;br /&gt;
|-&lt;br /&gt;
| bytes_communicated || integer |||||| Number of bytes communicated (total of all bytes per DATA line)  &lt;br /&gt;
|-&lt;br /&gt;
|status || text |||||| READY, TIMEOUT, LOWPOWER, MISSING&lt;br /&gt;
|-&lt;br /&gt;
| network_join_time || integer||||||milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| number_identical_lines || integer |||||| Number identical lines in data block. Gives indication &lt;br /&gt;
|-&lt;br /&gt;
| non_ascii_char || integer |||||| Number of non ascii characters (indicated by question-mark ?)&lt;br /&gt;
|-&lt;br /&gt;
| sts_time || timestamp |||||| derived from S0 hh,mi&lt;br /&gt;
|-&lt;br /&gt;
| timesynced || smallint|||||| TimeSynced (0=not sy:wnced, 1=user set, 2=Gps Synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode || smallint||||||DeviceMode (0-99)&lt;br /&gt;
|-&lt;br /&gt;
| vbat || float |||||| Battery voltage in V (0-~4.200V) &lt;br /&gt;
|-&lt;br /&gt;
|logb || integer |||||| logged bytes, waiting for download (0-4Mbyte)&lt;br /&gt;
|-&lt;br /&gt;
| logp || smallint |||||| Logged percentage (units 0.1%) of memory waiting to be downloaded (0-1000)&lt;br /&gt;
|-&lt;br /&gt;
| gpsii || integer |||||| GpsIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|comii || integer|||||| ComIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| AcceleroIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| User switches, current (0-65535) &lt;br /&gt;
|-&lt;br /&gt;
|last_gps_fix ||timestamp||||||timestamp of last fix&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||Latitude of last fix. Decimal degrees &lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||Longitude of last fix. Decimal degrees&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_SETTINGS101 or UVA_SETTINGS_LIMITED  == &lt;br /&gt;
&lt;br /&gt;
Settings are either from C0-C1-C9 lines or parsed from uplink communication lines &lt;br /&gt;
If C0-C1 is parsed its values are compared with the previous value and if the settings are the &lt;br /&gt;
same no new records needs to be added &lt;br /&gt;
If uplink settings are parsed wait till the last setting has been seen, (DL command or EOF) &lt;br /&gt;
then store all the new settings in one record. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||Derive timestamp from Hh:mi fields in C0 combined with computer timestamp in JOINED line&lt;br /&gt;
|-&lt;br /&gt;
|timesynced || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|timezone_time || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| SpecialUserSwitches &lt;br /&gt;
|-&lt;br /&gt;
|gpsnavmode || smallint|||||| GpsNavMode 0-7&lt;br /&gt;
|-&lt;br /&gt;
|gpsreceivermode || smallint |||||| GpsReceiverNode 0-3&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtime || smallint|||||| GpsFixTime 0-255&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_h || smallint|||||| hours Gps IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_m || smallint|||||| minutes Gps IvalN on &lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln  || integer|||||| GpsIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_h || smallint|||||| hours Gps IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_m || smallint|||||| minutes GpS IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale  || integer|||||| GpsIvalE &lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_h || smallint|||||| hours Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_m || smallint|||||| minutes Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln || integer|||||| ComIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_h || smallint|||||| hours Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_m || smallint|||||| minutes Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale || integer|||||| ComIvalE&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| Accelero measurement interval         &lt;br /&gt;
|-&lt;br /&gt;
|accbn || integer|||||| Accelero number of blocks &lt;br /&gt;
|-&lt;br /&gt;
|accsn || integer|||||| Accelero number of samples (0-65536)&lt;br /&gt;
|-&lt;br /&gt;
|f || smallint||||||Accelero sample frequency  (0=20Hz, 1=10Hz, 2=5Hz, 3=1Hz)&lt;br /&gt;
|-&lt;br /&gt;
|pdp || smallint|||||| PdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|pac||smallint|||||| PaccMsk (10-100)&lt;br /&gt;
|-&lt;br /&gt;
|tdp ||smallint|||||| TdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|tac ||smallint|||||| TaccMsk (30-300)&lt;br /&gt;
|-&lt;br /&gt;
|ga || smallint|||||| Additional Fixes GpsIval mode (3-25) before interval fix is logged&lt;br /&gt;
|-&lt;br /&gt;
|aol || smallint||||||AccMemOffLev (100 - 950) units 0.1%; if Memfull above  this level all Accelero activity will be overruled and switched off untill MemFull &amp;lt; level - 5&lt;br /&gt;
|-&lt;br /&gt;
|eventnum || text|||||| 12 eventnumbers (0-0xff) only printed if not zero, therfore converted to text&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA101 or UVA_TRACKING_LIMITED==&lt;br /&gt;
&lt;br /&gt;
The tracking dat for newer firmware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||integer||||||heigth above sealevel meters&lt;br /&gt;
|-&lt;br /&gt;
|pressure ||integer||||||in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature ||float||||||in celcius degrees&lt;br /&gt;
|-&lt;br /&gt;
|satellites_used ||smallint||||||satellites used for fix &lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime ||float||||||GpsFixTime in seconds &lt;br /&gt;
|-&lt;br /&gt;
|positiondop ||float||||||Position DOP in units&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy || float||||||Horizontal accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy || float||||||Vertical accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|x_speed ||float||||||Speed in x-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|y_speed ||float||||||Speed in y-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|z_speed ||float||||||Speed in z-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|speed_accuracy || float||||||Speed accuracy (m/s) &lt;br /&gt;
|-&lt;br /&gt;
|location || geometry |||||| lat/long as PostGIS geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_ACCELERATION101 or UVA_ACCELERATION_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Acceleration entries if accelerometer was turned on. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|index ||smallint||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration ||smallint||||||acceleration in X-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration ||smallint||||||acceleration in Y-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration ||smallint||||||acceleration in Z-axis (-2666 till 2666)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENERGY101 or UVA_ENERGY_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|timesynced ||smallint||||||TimeSynced (0=not synced, 1=user set, 2=Gps synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode ||smallint||||||(0-99)&lt;br /&gt;
|-&lt;br /&gt;
|vsll ||float||||||Solar Voltage during charging in mV (0-~2500)&lt;br /&gt;
|-&lt;br /&gt;
|vbat ||float||||||Battery Voltage in V (0-~4.200)&lt;br /&gt;
|-&lt;br /&gt;
|ssw ||smallint|||||| Solar Cell Switches ... (0-255) fw1022 and up &lt;br /&gt;
|-&lt;br /&gt;
| ||||||||extended fields if special user switch is on &lt;br /&gt;
|-&lt;br /&gt;
|vsoo ||float|||||| Solar voltage open in V (0-~2.500)&lt;br /&gt;
|-&lt;br /&gt;
|vdrf ||float||||||reference voltage Dac in V (0-~2.435)&lt;br /&gt;
|-&lt;br /&gt;
|vchr ||float||||||charge current voltage&lt;br /&gt;
|-&lt;br /&gt;
|g ||smallint|||||| Gps battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|c || smallint||||||Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|m || smallint||||||Charge Mode (0,1,2 Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|pressure || integer|||||| in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature || float|||||| in celcius degrees   &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING  or UVA_TRACKING_LIMITED == &lt;br /&gt;
&lt;br /&gt;
View to show identical fields for older and newer firmware tracking data&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|altitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|pressure||integer|||||&lt;br /&gt;
|-&lt;br /&gt;
|temperature||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|x_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|y_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|z_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|location||geometry||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_SPEED or UVA_TRACKING_SPEED_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Additional view that computes with the x_speed, y_speed and z_speed components the vnorth, veast and vdown speed components as well as the absolute value speed in meters/second. &lt;br /&gt;
&lt;br /&gt;
In addition to the fields in the UVA_TRACKING view this view adds :&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|vnorth||float||||||- vx * sin(lat) * cos(long) - vy * sin(lat) * sin (long) + vz * cos(lat)&lt;br /&gt;
|-&lt;br /&gt;
|veast||float|||||| - vx * sin(lon) + vy * cos(lon)&lt;br /&gt;
|-&lt;br /&gt;
|vdown||float|||||| - vx * cos(lat) * cos(lon) - vy * cos(lat) * sin(lon) - vz * sin(lat)&lt;br /&gt;
|-&lt;br /&gt;
|speed||float|||||| sqrt(vx^2 + vy^2 + vz^2)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= UvAGPS functions =&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_speed ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters), time-interval, speed (meters/second) and heading (degrees) for a series of subsequent tracking entries with specific device_info_serial.&lt;br /&gt;
For the first entry in the sequence these values will always be missing because they are computed  as the difference between subsequent rows.&lt;br /&gt;
&lt;br /&gt;
Usage examples :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119);&lt;br /&gt;
&lt;br /&gt;
select t.*, a.distance, a.interval, a.speed, a.direction from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00') a join gps.uva_tracking t using(device_info_serial, date_time);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and heading are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. &lt;br /&gt;
The heading is the initial heading. PostGIS does not calculate the heading, so therefore we don't use PostGIS.&lt;br /&gt;
&lt;br /&gt;
In these functions the records that have been flagged as invalid by setting the '''userflag''' are not token into account and discarded. &lt;br /&gt;
If it is required get the speed for all records  a additional boolean argument for '''get raw data''' can be given. i.e.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00', true);&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, true);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) for UvAGPS tracks to arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, 52.1897017, 6.1996606); &lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, (select location from gps.uva_tracking where device_info_serial = 119 and date_time = '2009-05-07 19:55:08')); &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the distance is calculated with the PostGIS distance_sphere function which uses spherical correction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance_direction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) and direction (degrees) for UvAGPS tracks from arbitrary point in lat/long or geometry location&lt;br /&gt;
&lt;br /&gt;
Example usage: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and direction are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. The direction is the direction from the given point.&lt;br /&gt;
&lt;br /&gt;
In this function the records where the '''userflag''' has been set are discarded. To see  these records a additional boolean argument for '''show raw data''' should  be added like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606, true); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Accelerometer calibration =&lt;br /&gt;
&lt;br /&gt;
The accelerometer measures the acceleration in 3D (20 times per second). Acceleration is caused by gravity (static component) and by a change in speed (dynamic component). &lt;br /&gt;
When the logger is static in horizontal position (solar cells up), gravity (green arrow) shows a  heave (vertical acceleration, z) of +1 g (1 g = 9.81 m.s&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;) while surge and heave are both 0. When the front of the logger is vertically pointing down (forward acceleration, x), surge is +1g and when it is rolled to the right (sidewards acceleration, y) sway is +1g. Due to gravity, the pitch of a logger is thus translated into the values of heave, surge and sway (or z, x, y).&lt;br /&gt;
&lt;br /&gt;
However, the values are measured in mV instead of g. Before delivering the GPS-loggers, they have been calibrated at UvA. The acceleration (A) expressed in g is calculated from the measured value (M) and the calibration factors offset (''O'') and sensitivity (''S'').&lt;br /&gt;
&lt;br /&gt;
Thus acceleration for heave (z), surge (x) and sway (y) is calculated as:&lt;br /&gt;
A&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; ;      A&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;;      A&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; ; &lt;br /&gt;
&lt;br /&gt;
The values of ''O'' (in general ranging from 0-60, sometimes even 300) and ''S'' (ranging from 1300-1450) are available in the device table of the data base. If not available, use the factory defaults ''O'' = 0 and ''S'' = 1365.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:accelero1.png|300px]]||[[File:accelero2.png|300px]]|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the figure above heave (z) is shown in green, surge(x) in red and sway (y) in blue, all values are expressed in g (on the y-axis).&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=365</id>
		<title>UvAGPS</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=365"/>
				<updated>2010-12-24T10:13:29Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* get_uvagps_track_distance_direction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= UvAGPS Data Model =&lt;br /&gt;
&lt;br /&gt;
For different versions of the UvAGPS firmware different tables are used. For firmware version v0.9.3.6 till v1.0.0.X the tables UVA_ENGINEERING_DATA and UVA_TRACKING_DATA are used. But in the new firmware versions 1.0.1.4 till 1.0.2.4 so much information was added  that new tables were introduced. However for the most important tracking tables a view is created so that all similar tracking for all types of firmware can be seen in one view. That is the UVA_TRACKING view. &lt;br /&gt;
&lt;br /&gt;
All tables, views and functions are also in the GPS schema.&lt;br /&gt;
&lt;br /&gt;
Not everybody has access to all data.  For most users access is limited to &amp;quot;limited&amp;quot; views that only give access to selected devices. &lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA or UVA_TRACKING_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float8||||||Horizontal accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float8||||||Vertical accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||float8||||||m&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration||Float8||||||x axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) movement to right is + and to left is -&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration||Float8||||||y axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) forward movement is + and backwards is -&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration||Float8||||||z axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) upwards movement is + downwards is -&lt;br /&gt;
|-&lt;br /&gt;
|speed ||float8||||||m/s&lt;br /&gt;
|-&lt;br /&gt;
|course||float8||||||Degrees&lt;br /&gt;
|-&lt;br /&gt;
|pressure||float8||||||Pressure sensor (pascal)&lt;br /&gt;
|-&lt;br /&gt;
|temperature||Float8||||||Degrees celcius&lt;br /&gt;
|-&lt;br /&gt;
|solar_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|battery_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|quality||text||||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|  “&amp;quot;location”&amp;quot;||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENGINEERING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Engineering data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|t_syncsts||smallint||||||0: not synced, 1: user synced, 2: Gps synced&lt;br /&gt;
|-&lt;br /&gt;
|t_entzt||smallint||||||0: UCT time,1: TZT time (timezone time)&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentrategps||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratecom||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratepwr||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagesolarpanel||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagebattery||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_chargemode||int2||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainrategps||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratecom||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratepwr||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_esavegpsrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_esavecomrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsnavigationmode||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtimeout||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|eh||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_DEVICE or UVA_DEVICE_LIMITED == &lt;br /&gt;
&lt;br /&gt;
To be able to track the different firmware versions and specific properties for the different devices the UVA_DEVICE table was added. This table also includes essential information needed to calibrate the accelerometers. For more information see [[UvAGPS|Accelerometer calibration]]&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL || Serial number of tag&lt;br /&gt;
|- &lt;br /&gt;
| firmware_version || text |||| NOT NULL || Firmware version installed on tag&lt;br /&gt;
|-&lt;br /&gt;
| device_mass || double |||||||Mass of tag (g)&lt;br /&gt;
|-&lt;br /&gt;
| x_s|| double |||||||Calibration sensitivity of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_s|| double |||||||Calibration sensitivity of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_s|| double |||||||Calibration sensitivity of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
| x_o|| double |||||||Calibration offset of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_o|| double |||||||Calibration offset of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_o|| double |||||||Calibration offset of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_COMM101 or UVA_COMM_LIMITED== &lt;br /&gt;
&lt;br /&gt;
Communication table indicates status and result of communications with ground stations. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
| date_time || timestamp || PK || NOT NULL || timestamp of start communication&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end || timestamp |||||| timestamp of end communication           &lt;br /&gt;
|-&lt;br /&gt;
| date_time_utc || timestamp |||||| date_time in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end_utc || timestamp |||||| date_time_end in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| action || text|||||| JOINED / RESCHEDULE  ??&lt;br /&gt;
|-&lt;br /&gt;
| bytes_communicated || integer |||||| Number of bytes communicated (total of all bytes per DATA line)  &lt;br /&gt;
|-&lt;br /&gt;
|status || text |||||| READY, TIMEOUT, LOWPOWER, MISSING&lt;br /&gt;
|-&lt;br /&gt;
| network_join_time || integer||||||milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| number_identical_lines || integer |||||| Number identical lines in data block. Gives indication &lt;br /&gt;
|-&lt;br /&gt;
| non_ascii_char || integer |||||| Number of non ascii characters (indicated by question-mark ?)&lt;br /&gt;
|-&lt;br /&gt;
| sts_time || timestamp |||||| derived from S0 hh,mi&lt;br /&gt;
|-&lt;br /&gt;
| timesynced || smallint|||||| TimeSynced (0=not sy:wnced, 1=user set, 2=Gps Synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode || smallint||||||DeviceMode (0-99)&lt;br /&gt;
|-&lt;br /&gt;
| vbat || float |||||| Battery voltage in V (0-~4.200V) &lt;br /&gt;
|-&lt;br /&gt;
|logb || integer |||||| logged bytes, waiting for download (0-4Mbyte)&lt;br /&gt;
|-&lt;br /&gt;
| logp || smallint |||||| Logged percentage (units 0.1%) of memory waiting to be downloaded (0-1000)&lt;br /&gt;
|-&lt;br /&gt;
| gpsii || integer |||||| GpsIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|comii || integer|||||| ComIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| AcceleroIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| User switches, current (0-65535) &lt;br /&gt;
|-&lt;br /&gt;
|last_gps_fix ||timestamp||||||timestamp of last fix&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||Latitude of last fix. Decimal degrees &lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||Longitude of last fix. Decimal degrees&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_SETTINGS101 or UVA_SETTINGS_LIMITED  == &lt;br /&gt;
&lt;br /&gt;
Settings are either from C0-C1-C9 lines or parsed from uplink communication lines &lt;br /&gt;
If C0-C1 is parsed its values are compared with the previous value and if the settings are the &lt;br /&gt;
same no new records needs to be added &lt;br /&gt;
If uplink settings are parsed wait till the last setting has been seen, (DL command or EOF) &lt;br /&gt;
then store all the new settings in one record. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||Derive timestamp from Hh:mi fields in C0 combined with computer timestamp in JOINED line&lt;br /&gt;
|-&lt;br /&gt;
|timesynced || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|timezone_time || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| SpecialUserSwitches &lt;br /&gt;
|-&lt;br /&gt;
|gpsnavmode || smallint|||||| GpsNavMode 0-7&lt;br /&gt;
|-&lt;br /&gt;
|gpsreceivermode || smallint |||||| GpsReceiverNode 0-3&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtime || smallint|||||| GpsFixTime 0-255&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_h || smallint|||||| hours Gps IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_m || smallint|||||| minutes Gps IvalN on &lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln  || integer|||||| GpsIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_h || smallint|||||| hours Gps IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_m || smallint|||||| minutes GpS IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale  || integer|||||| GpsIvalE &lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_h || smallint|||||| hours Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_m || smallint|||||| minutes Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln || integer|||||| ComIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_h || smallint|||||| hours Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_m || smallint|||||| minutes Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale || integer|||||| ComIvalE&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| Accelero measurement interval         &lt;br /&gt;
|-&lt;br /&gt;
|accbn || integer|||||| Accelero number of blocks &lt;br /&gt;
|-&lt;br /&gt;
|accsn || integer|||||| Accelero number of samples (0-65536)&lt;br /&gt;
|-&lt;br /&gt;
|f || smallint||||||Accelero sample frequency  (0=20Hz, 1=10Hz, 2=5Hz, 3=1Hz)&lt;br /&gt;
|-&lt;br /&gt;
|pdp || smallint|||||| PdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|pac||smallint|||||| PaccMsk (10-100)&lt;br /&gt;
|-&lt;br /&gt;
|tdp ||smallint|||||| TdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|tac ||smallint|||||| TaccMsk (30-300)&lt;br /&gt;
|-&lt;br /&gt;
|ga || smallint|||||| Additional Fixes GpsIval mode (3-25) before interval fix is logged&lt;br /&gt;
|-&lt;br /&gt;
|aol || smallint||||||AccMemOffLev (100 - 950) units 0.1%; if Memfull above  this level all Accelero activity will be overruled and switched off untill MemFull &amp;lt; level - 5&lt;br /&gt;
|-&lt;br /&gt;
|eventnum || text|||||| 12 eventnumbers (0-0xff) only printed if not zero, therfore converted to text&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA101 or UVA_TRACKING_LIMITED==&lt;br /&gt;
&lt;br /&gt;
The tracking dat for newer firmware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||integer||||||heigth above sealevel meters&lt;br /&gt;
|-&lt;br /&gt;
|pressure ||integer||||||in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature ||float||||||in celcius degrees&lt;br /&gt;
|-&lt;br /&gt;
|satellites_used ||smallint||||||satellites used for fix &lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime ||float||||||GpsFixTime in seconds &lt;br /&gt;
|-&lt;br /&gt;
|positiondop ||float||||||Position DOP in units&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy || float||||||Horizontal accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy || float||||||Vertical accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|x_speed ||float||||||Speed in x-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|y_speed ||float||||||Speed in y-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|z_speed ||float||||||Speed in z-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|speed_accuracy || float||||||Speed accuracy (m/s) &lt;br /&gt;
|-&lt;br /&gt;
|location || geometry |||||| lat/long as PostGIS geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_ACCELERATION101 or UVA_ACCELERATION_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Acceleration entries if accelerometer was turned on. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|index ||smallint||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration ||smallint||||||acceleration in X-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration ||smallint||||||acceleration in Y-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration ||smallint||||||acceleration in Z-axis (-2666 till 2666)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENERGY101 or UVA_ENERGY_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|timesynced ||smallint||||||TimeSynced (0=not synced, 1=user set, 2=Gps synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode ||smallint||||||(0-99)&lt;br /&gt;
|-&lt;br /&gt;
|vsll ||float||||||Solar Voltage during charging in mV (0-~2500)&lt;br /&gt;
|-&lt;br /&gt;
|vbat ||float||||||Battery Voltage in V (0-~4.200)&lt;br /&gt;
|-&lt;br /&gt;
|ssw ||smallint|||||| Solar Cell Switches ... (0-255) fw1022 and up &lt;br /&gt;
|-&lt;br /&gt;
| ||||||||extended fields if special user switch is on &lt;br /&gt;
|-&lt;br /&gt;
|vsoo ||float|||||| Solar voltage open in V (0-~2.500)&lt;br /&gt;
|-&lt;br /&gt;
|vdrf ||float||||||reference voltage Dac in V (0-~2.435)&lt;br /&gt;
|-&lt;br /&gt;
|vchr ||float||||||charge current voltage&lt;br /&gt;
|-&lt;br /&gt;
|g ||smallint|||||| Gps battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|c || smallint||||||Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|m || smallint||||||Charge Mode (0,1,2 Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|pressure || integer|||||| in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature || float|||||| in celcius degrees   &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING  or UVA_TRACKING_LIMITED == &lt;br /&gt;
&lt;br /&gt;
View to show identical fields for older and newer firmware tracking data&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|altitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|pressure||integer|||||&lt;br /&gt;
|-&lt;br /&gt;
|temperature||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|x_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|y_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|z_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|location||geometry||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_SPEED or UVA_TRACKING_SPEED_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Additional view that computes with the x_speed, y_speed and z_speed components the vnorth, veast and vdown speed components as well as the absolute value speed in meters/second. &lt;br /&gt;
&lt;br /&gt;
In addition to the fields in the UVA_TRACKING view this view adds :&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|vnorth||float||||||- vx * sin(lat) * cos(long) - vy * sin(lat) * sin (long) + vz * cos(lat)&lt;br /&gt;
|-&lt;br /&gt;
|veast||float|||||| - vx * sin(lon) + vy * cos(lon)&lt;br /&gt;
|-&lt;br /&gt;
|vdown||float|||||| - vx * cos(lat) * cos(lon) - vy * cos(lat) * sin(lon) - vz * sin(lat)&lt;br /&gt;
|-&lt;br /&gt;
|speed||float|||||| sqrt(vx^2 + vy^2 + vz^2)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= UvAGPS functions =&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_speed ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters), time-interval, speed (meters/second) and heading (degrees) for a series of subsequent tracking entries with specific device_info_serial.&lt;br /&gt;
For the first entry in the sequence these values will always be missing because they are computed  as the difference between subsequent rows.&lt;br /&gt;
&lt;br /&gt;
Usage examples :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119);&lt;br /&gt;
&lt;br /&gt;
select t.*, a.distance, a.interval, a.speed, a.direction from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00') a join gps.uva_tracking t using(device_info_serial, date_time);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and heading are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. &lt;br /&gt;
The heading is the initial heading. PostGIS does not calculate the heading, so therefore we don't use PostGIS.&lt;br /&gt;
&lt;br /&gt;
In these functions the records that have been flagged as invalid by setting the userflag are not token into account and discarded. &lt;br /&gt;
If it is required get the speed for all records  a additional boolean argument for '''get raw data''' can be given. i.e.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00', true);&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, true);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) for UvAGPS tracks to arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, 52.1897017, 6.1996606); &lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, (select location from gps.uva_tracking where device_info_serial = 119 and date_time = '2009-05-07 19:55:08')); &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the distance is calculated with the PostGIS distance_sphere function which uses spherical correction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance_direction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) and direction (degrees) for UvAGPS tracks from arbitrary point in lat/long or geometry location&lt;br /&gt;
&lt;br /&gt;
Example usage: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and direction are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. The direction is the direction from the given point.&lt;br /&gt;
&lt;br /&gt;
In this function the records where the '''userflag''' has been set are discarded. To see  these records a additional boolean argument for '''show raw data''' should  be added like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606, true); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Accelerometer calibration =&lt;br /&gt;
&lt;br /&gt;
The accelerometer measures the acceleration in 3D (20 times per second). Acceleration is caused by gravity (static component) and by a change in speed (dynamic component). &lt;br /&gt;
When the logger is static in horizontal position (solar cells up), gravity (green arrow) shows a  heave (vertical acceleration, z) of +1 g (1 g = 9.81 m.s&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;) while surge and heave are both 0. When the front of the logger is vertically pointing down (forward acceleration, x), surge is +1g and when it is rolled to the right (sidewards acceleration, y) sway is +1g. Due to gravity, the pitch of a logger is thus translated into the values of heave, surge and sway (or z, x, y).&lt;br /&gt;
&lt;br /&gt;
However, the values are measured in mV instead of g. Before delivering the GPS-loggers, they have been calibrated at UvA. The acceleration (A) expressed in g is calculated from the measured value (M) and the calibration factors offset (''O'') and sensitivity (''S'').&lt;br /&gt;
&lt;br /&gt;
Thus acceleration for heave (z), surge (x) and sway (y) is calculated as:&lt;br /&gt;
A&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; ;      A&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;;      A&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; ; &lt;br /&gt;
&lt;br /&gt;
The values of ''O'' (in general ranging from 0-60, sometimes even 300) and ''S'' (ranging from 1300-1450) are available in the device table of the data base. If not available, use the factory defaults ''O'' = 0 and ''S'' = 1365.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:accelero1.png|300px]]||[[File:accelero2.png|300px]]|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the figure above heave (z) is shown in green, surge(x) in red and sway (y) in blue, all values are expressed in g (on the y-axis).&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=364</id>
		<title>UvAGPS</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=364"/>
				<updated>2010-12-24T10:13:09Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* get_uvagps_track_distance_direction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= UvAGPS Data Model =&lt;br /&gt;
&lt;br /&gt;
For different versions of the UvAGPS firmware different tables are used. For firmware version v0.9.3.6 till v1.0.0.X the tables UVA_ENGINEERING_DATA and UVA_TRACKING_DATA are used. But in the new firmware versions 1.0.1.4 till 1.0.2.4 so much information was added  that new tables were introduced. However for the most important tracking tables a view is created so that all similar tracking for all types of firmware can be seen in one view. That is the UVA_TRACKING view. &lt;br /&gt;
&lt;br /&gt;
All tables, views and functions are also in the GPS schema.&lt;br /&gt;
&lt;br /&gt;
Not everybody has access to all data.  For most users access is limited to &amp;quot;limited&amp;quot; views that only give access to selected devices. &lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA or UVA_TRACKING_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float8||||||Horizontal accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float8||||||Vertical accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||float8||||||m&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration||Float8||||||x axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) movement to right is + and to left is -&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration||Float8||||||y axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) forward movement is + and backwards is -&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration||Float8||||||z axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) upwards movement is + downwards is -&lt;br /&gt;
|-&lt;br /&gt;
|speed ||float8||||||m/s&lt;br /&gt;
|-&lt;br /&gt;
|course||float8||||||Degrees&lt;br /&gt;
|-&lt;br /&gt;
|pressure||float8||||||Pressure sensor (pascal)&lt;br /&gt;
|-&lt;br /&gt;
|temperature||Float8||||||Degrees celcius&lt;br /&gt;
|-&lt;br /&gt;
|solar_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|battery_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|quality||text||||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|  “&amp;quot;location”&amp;quot;||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENGINEERING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Engineering data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|t_syncsts||smallint||||||0: not synced, 1: user synced, 2: Gps synced&lt;br /&gt;
|-&lt;br /&gt;
|t_entzt||smallint||||||0: UCT time,1: TZT time (timezone time)&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentrategps||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratecom||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratepwr||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagesolarpanel||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagebattery||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_chargemode||int2||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainrategps||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratecom||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratepwr||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_esavegpsrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_esavecomrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsnavigationmode||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtimeout||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|eh||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_DEVICE or UVA_DEVICE_LIMITED == &lt;br /&gt;
&lt;br /&gt;
To be able to track the different firmware versions and specific properties for the different devices the UVA_DEVICE table was added. This table also includes essential information needed to calibrate the accelerometers. For more information see [[UvAGPS|Accelerometer calibration]]&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL || Serial number of tag&lt;br /&gt;
|- &lt;br /&gt;
| firmware_version || text |||| NOT NULL || Firmware version installed on tag&lt;br /&gt;
|-&lt;br /&gt;
| device_mass || double |||||||Mass of tag (g)&lt;br /&gt;
|-&lt;br /&gt;
| x_s|| double |||||||Calibration sensitivity of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_s|| double |||||||Calibration sensitivity of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_s|| double |||||||Calibration sensitivity of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
| x_o|| double |||||||Calibration offset of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_o|| double |||||||Calibration offset of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_o|| double |||||||Calibration offset of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_COMM101 or UVA_COMM_LIMITED== &lt;br /&gt;
&lt;br /&gt;
Communication table indicates status and result of communications with ground stations. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
| date_time || timestamp || PK || NOT NULL || timestamp of start communication&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end || timestamp |||||| timestamp of end communication           &lt;br /&gt;
|-&lt;br /&gt;
| date_time_utc || timestamp |||||| date_time in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end_utc || timestamp |||||| date_time_end in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| action || text|||||| JOINED / RESCHEDULE  ??&lt;br /&gt;
|-&lt;br /&gt;
| bytes_communicated || integer |||||| Number of bytes communicated (total of all bytes per DATA line)  &lt;br /&gt;
|-&lt;br /&gt;
|status || text |||||| READY, TIMEOUT, LOWPOWER, MISSING&lt;br /&gt;
|-&lt;br /&gt;
| network_join_time || integer||||||milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| number_identical_lines || integer |||||| Number identical lines in data block. Gives indication &lt;br /&gt;
|-&lt;br /&gt;
| non_ascii_char || integer |||||| Number of non ascii characters (indicated by question-mark ?)&lt;br /&gt;
|-&lt;br /&gt;
| sts_time || timestamp |||||| derived from S0 hh,mi&lt;br /&gt;
|-&lt;br /&gt;
| timesynced || smallint|||||| TimeSynced (0=not sy:wnced, 1=user set, 2=Gps Synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode || smallint||||||DeviceMode (0-99)&lt;br /&gt;
|-&lt;br /&gt;
| vbat || float |||||| Battery voltage in V (0-~4.200V) &lt;br /&gt;
|-&lt;br /&gt;
|logb || integer |||||| logged bytes, waiting for download (0-4Mbyte)&lt;br /&gt;
|-&lt;br /&gt;
| logp || smallint |||||| Logged percentage (units 0.1%) of memory waiting to be downloaded (0-1000)&lt;br /&gt;
|-&lt;br /&gt;
| gpsii || integer |||||| GpsIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|comii || integer|||||| ComIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| AcceleroIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| User switches, current (0-65535) &lt;br /&gt;
|-&lt;br /&gt;
|last_gps_fix ||timestamp||||||timestamp of last fix&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||Latitude of last fix. Decimal degrees &lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||Longitude of last fix. Decimal degrees&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_SETTINGS101 or UVA_SETTINGS_LIMITED  == &lt;br /&gt;
&lt;br /&gt;
Settings are either from C0-C1-C9 lines or parsed from uplink communication lines &lt;br /&gt;
If C0-C1 is parsed its values are compared with the previous value and if the settings are the &lt;br /&gt;
same no new records needs to be added &lt;br /&gt;
If uplink settings are parsed wait till the last setting has been seen, (DL command or EOF) &lt;br /&gt;
then store all the new settings in one record. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||Derive timestamp from Hh:mi fields in C0 combined with computer timestamp in JOINED line&lt;br /&gt;
|-&lt;br /&gt;
|timesynced || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|timezone_time || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| SpecialUserSwitches &lt;br /&gt;
|-&lt;br /&gt;
|gpsnavmode || smallint|||||| GpsNavMode 0-7&lt;br /&gt;
|-&lt;br /&gt;
|gpsreceivermode || smallint |||||| GpsReceiverNode 0-3&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtime || smallint|||||| GpsFixTime 0-255&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_h || smallint|||||| hours Gps IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_m || smallint|||||| minutes Gps IvalN on &lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln  || integer|||||| GpsIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_h || smallint|||||| hours Gps IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_m || smallint|||||| minutes GpS IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale  || integer|||||| GpsIvalE &lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_h || smallint|||||| hours Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_m || smallint|||||| minutes Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln || integer|||||| ComIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_h || smallint|||||| hours Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_m || smallint|||||| minutes Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale || integer|||||| ComIvalE&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| Accelero measurement interval         &lt;br /&gt;
|-&lt;br /&gt;
|accbn || integer|||||| Accelero number of blocks &lt;br /&gt;
|-&lt;br /&gt;
|accsn || integer|||||| Accelero number of samples (0-65536)&lt;br /&gt;
|-&lt;br /&gt;
|f || smallint||||||Accelero sample frequency  (0=20Hz, 1=10Hz, 2=5Hz, 3=1Hz)&lt;br /&gt;
|-&lt;br /&gt;
|pdp || smallint|||||| PdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|pac||smallint|||||| PaccMsk (10-100)&lt;br /&gt;
|-&lt;br /&gt;
|tdp ||smallint|||||| TdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|tac ||smallint|||||| TaccMsk (30-300)&lt;br /&gt;
|-&lt;br /&gt;
|ga || smallint|||||| Additional Fixes GpsIval mode (3-25) before interval fix is logged&lt;br /&gt;
|-&lt;br /&gt;
|aol || smallint||||||AccMemOffLev (100 - 950) units 0.1%; if Memfull above  this level all Accelero activity will be overruled and switched off untill MemFull &amp;lt; level - 5&lt;br /&gt;
|-&lt;br /&gt;
|eventnum || text|||||| 12 eventnumbers (0-0xff) only printed if not zero, therfore converted to text&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA101 or UVA_TRACKING_LIMITED==&lt;br /&gt;
&lt;br /&gt;
The tracking dat for newer firmware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||integer||||||heigth above sealevel meters&lt;br /&gt;
|-&lt;br /&gt;
|pressure ||integer||||||in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature ||float||||||in celcius degrees&lt;br /&gt;
|-&lt;br /&gt;
|satellites_used ||smallint||||||satellites used for fix &lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime ||float||||||GpsFixTime in seconds &lt;br /&gt;
|-&lt;br /&gt;
|positiondop ||float||||||Position DOP in units&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy || float||||||Horizontal accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy || float||||||Vertical accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|x_speed ||float||||||Speed in x-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|y_speed ||float||||||Speed in y-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|z_speed ||float||||||Speed in z-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|speed_accuracy || float||||||Speed accuracy (m/s) &lt;br /&gt;
|-&lt;br /&gt;
|location || geometry |||||| lat/long as PostGIS geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_ACCELERATION101 or UVA_ACCELERATION_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Acceleration entries if accelerometer was turned on. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|index ||smallint||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration ||smallint||||||acceleration in X-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration ||smallint||||||acceleration in Y-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration ||smallint||||||acceleration in Z-axis (-2666 till 2666)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENERGY101 or UVA_ENERGY_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|timesynced ||smallint||||||TimeSynced (0=not synced, 1=user set, 2=Gps synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode ||smallint||||||(0-99)&lt;br /&gt;
|-&lt;br /&gt;
|vsll ||float||||||Solar Voltage during charging in mV (0-~2500)&lt;br /&gt;
|-&lt;br /&gt;
|vbat ||float||||||Battery Voltage in V (0-~4.200)&lt;br /&gt;
|-&lt;br /&gt;
|ssw ||smallint|||||| Solar Cell Switches ... (0-255) fw1022 and up &lt;br /&gt;
|-&lt;br /&gt;
| ||||||||extended fields if special user switch is on &lt;br /&gt;
|-&lt;br /&gt;
|vsoo ||float|||||| Solar voltage open in V (0-~2.500)&lt;br /&gt;
|-&lt;br /&gt;
|vdrf ||float||||||reference voltage Dac in V (0-~2.435)&lt;br /&gt;
|-&lt;br /&gt;
|vchr ||float||||||charge current voltage&lt;br /&gt;
|-&lt;br /&gt;
|g ||smallint|||||| Gps battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|c || smallint||||||Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|m || smallint||||||Charge Mode (0,1,2 Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|pressure || integer|||||| in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature || float|||||| in celcius degrees   &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING  or UVA_TRACKING_LIMITED == &lt;br /&gt;
&lt;br /&gt;
View to show identical fields for older and newer firmware tracking data&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|altitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|pressure||integer|||||&lt;br /&gt;
|-&lt;br /&gt;
|temperature||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|x_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|y_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|z_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|location||geometry||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_SPEED or UVA_TRACKING_SPEED_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Additional view that computes with the x_speed, y_speed and z_speed components the vnorth, veast and vdown speed components as well as the absolute value speed in meters/second. &lt;br /&gt;
&lt;br /&gt;
In addition to the fields in the UVA_TRACKING view this view adds :&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|vnorth||float||||||- vx * sin(lat) * cos(long) - vy * sin(lat) * sin (long) + vz * cos(lat)&lt;br /&gt;
|-&lt;br /&gt;
|veast||float|||||| - vx * sin(lon) + vy * cos(lon)&lt;br /&gt;
|-&lt;br /&gt;
|vdown||float|||||| - vx * cos(lat) * cos(lon) - vy * cos(lat) * sin(lon) - vz * sin(lat)&lt;br /&gt;
|-&lt;br /&gt;
|speed||float|||||| sqrt(vx^2 + vy^2 + vz^2)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= UvAGPS functions =&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_speed ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters), time-interval, speed (meters/second) and heading (degrees) for a series of subsequent tracking entries with specific device_info_serial.&lt;br /&gt;
For the first entry in the sequence these values will always be missing because they are computed  as the difference between subsequent rows.&lt;br /&gt;
&lt;br /&gt;
Usage examples :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119);&lt;br /&gt;
&lt;br /&gt;
select t.*, a.distance, a.interval, a.speed, a.direction from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00') a join gps.uva_tracking t using(device_info_serial, date_time);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and heading are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. &lt;br /&gt;
The heading is the initial heading. PostGIS does not calculate the heading, so therefore we don't use PostGIS.&lt;br /&gt;
&lt;br /&gt;
In these functions the records that have been flagged as invalid by setting the userflag are not token into account and discarded. &lt;br /&gt;
If it is required get the speed for all records  a additional boolean argument for '''get raw data''' can be given. i.e.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00', true);&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, true);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) for UvAGPS tracks to arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, 52.1897017, 6.1996606); &lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, (select location from gps.uva_tracking where device_info_serial = 119 and date_time = '2009-05-07 19:55:08')); &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the distance is calculated with the PostGIS distance_sphere function which uses spherical correction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance_direction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) and direction (degrees) for UvAGPS tracks from arbitrary point in lat/long or geometry location&lt;br /&gt;
&lt;br /&gt;
Example usage: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and direction are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. The direction is the direction from the given point.&lt;br /&gt;
&lt;br /&gt;
In this function the records where the userflag has been set are discarded. To see  these records a additional boolean argument for '''show raw data''' should  be added like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606, true); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Accelerometer calibration =&lt;br /&gt;
&lt;br /&gt;
The accelerometer measures the acceleration in 3D (20 times per second). Acceleration is caused by gravity (static component) and by a change in speed (dynamic component). &lt;br /&gt;
When the logger is static in horizontal position (solar cells up), gravity (green arrow) shows a  heave (vertical acceleration, z) of +1 g (1 g = 9.81 m.s&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;) while surge and heave are both 0. When the front of the logger is vertically pointing down (forward acceleration, x), surge is +1g and when it is rolled to the right (sidewards acceleration, y) sway is +1g. Due to gravity, the pitch of a logger is thus translated into the values of heave, surge and sway (or z, x, y).&lt;br /&gt;
&lt;br /&gt;
However, the values are measured in mV instead of g. Before delivering the GPS-loggers, they have been calibrated at UvA. The acceleration (A) expressed in g is calculated from the measured value (M) and the calibration factors offset (''O'') and sensitivity (''S'').&lt;br /&gt;
&lt;br /&gt;
Thus acceleration for heave (z), surge (x) and sway (y) is calculated as:&lt;br /&gt;
A&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; ;      A&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;;      A&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; ; &lt;br /&gt;
&lt;br /&gt;
The values of ''O'' (in general ranging from 0-60, sometimes even 300) and ''S'' (ranging from 1300-1450) are available in the device table of the data base. If not available, use the factory defaults ''O'' = 0 and ''S'' = 1365.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:accelero1.png|300px]]||[[File:accelero2.png|300px]]|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the figure above heave (z) is shown in green, surge(x) in red and sway (y) in blue, all values are expressed in g (on the y-axis).&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=363</id>
		<title>UvAGPS</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=363"/>
				<updated>2010-12-24T10:10:00Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* get_uvagps_track_speed */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= UvAGPS Data Model =&lt;br /&gt;
&lt;br /&gt;
For different versions of the UvAGPS firmware different tables are used. For firmware version v0.9.3.6 till v1.0.0.X the tables UVA_ENGINEERING_DATA and UVA_TRACKING_DATA are used. But in the new firmware versions 1.0.1.4 till 1.0.2.4 so much information was added  that new tables were introduced. However for the most important tracking tables a view is created so that all similar tracking for all types of firmware can be seen in one view. That is the UVA_TRACKING view. &lt;br /&gt;
&lt;br /&gt;
All tables, views and functions are also in the GPS schema.&lt;br /&gt;
&lt;br /&gt;
Not everybody has access to all data.  For most users access is limited to &amp;quot;limited&amp;quot; views that only give access to selected devices. &lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA or UVA_TRACKING_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float8||||||Horizontal accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float8||||||Vertical accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||float8||||||m&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration||Float8||||||x axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) movement to right is + and to left is -&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration||Float8||||||y axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) forward movement is + and backwards is -&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration||Float8||||||z axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) upwards movement is + downwards is -&lt;br /&gt;
|-&lt;br /&gt;
|speed ||float8||||||m/s&lt;br /&gt;
|-&lt;br /&gt;
|course||float8||||||Degrees&lt;br /&gt;
|-&lt;br /&gt;
|pressure||float8||||||Pressure sensor (pascal)&lt;br /&gt;
|-&lt;br /&gt;
|temperature||Float8||||||Degrees celcius&lt;br /&gt;
|-&lt;br /&gt;
|solar_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|battery_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|quality||text||||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|  “&amp;quot;location”&amp;quot;||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENGINEERING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Engineering data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|t_syncsts||smallint||||||0: not synced, 1: user synced, 2: Gps synced&lt;br /&gt;
|-&lt;br /&gt;
|t_entzt||smallint||||||0: UCT time,1: TZT time (timezone time)&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentrategps||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratecom||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratepwr||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagesolarpanel||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagebattery||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_chargemode||int2||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainrategps||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratecom||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratepwr||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_esavegpsrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_esavecomrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsnavigationmode||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtimeout||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|eh||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_DEVICE or UVA_DEVICE_LIMITED == &lt;br /&gt;
&lt;br /&gt;
To be able to track the different firmware versions and specific properties for the different devices the UVA_DEVICE table was added. This table also includes essential information needed to calibrate the accelerometers. For more information see [[UvAGPS|Accelerometer calibration]]&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL || Serial number of tag&lt;br /&gt;
|- &lt;br /&gt;
| firmware_version || text |||| NOT NULL || Firmware version installed on tag&lt;br /&gt;
|-&lt;br /&gt;
| device_mass || double |||||||Mass of tag (g)&lt;br /&gt;
|-&lt;br /&gt;
| x_s|| double |||||||Calibration sensitivity of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_s|| double |||||||Calibration sensitivity of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_s|| double |||||||Calibration sensitivity of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
| x_o|| double |||||||Calibration offset of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_o|| double |||||||Calibration offset of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_o|| double |||||||Calibration offset of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_COMM101 or UVA_COMM_LIMITED== &lt;br /&gt;
&lt;br /&gt;
Communication table indicates status and result of communications with ground stations. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
| date_time || timestamp || PK || NOT NULL || timestamp of start communication&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end || timestamp |||||| timestamp of end communication           &lt;br /&gt;
|-&lt;br /&gt;
| date_time_utc || timestamp |||||| date_time in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end_utc || timestamp |||||| date_time_end in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| action || text|||||| JOINED / RESCHEDULE  ??&lt;br /&gt;
|-&lt;br /&gt;
| bytes_communicated || integer |||||| Number of bytes communicated (total of all bytes per DATA line)  &lt;br /&gt;
|-&lt;br /&gt;
|status || text |||||| READY, TIMEOUT, LOWPOWER, MISSING&lt;br /&gt;
|-&lt;br /&gt;
| network_join_time || integer||||||milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| number_identical_lines || integer |||||| Number identical lines in data block. Gives indication &lt;br /&gt;
|-&lt;br /&gt;
| non_ascii_char || integer |||||| Number of non ascii characters (indicated by question-mark ?)&lt;br /&gt;
|-&lt;br /&gt;
| sts_time || timestamp |||||| derived from S0 hh,mi&lt;br /&gt;
|-&lt;br /&gt;
| timesynced || smallint|||||| TimeSynced (0=not sy:wnced, 1=user set, 2=Gps Synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode || smallint||||||DeviceMode (0-99)&lt;br /&gt;
|-&lt;br /&gt;
| vbat || float |||||| Battery voltage in V (0-~4.200V) &lt;br /&gt;
|-&lt;br /&gt;
|logb || integer |||||| logged bytes, waiting for download (0-4Mbyte)&lt;br /&gt;
|-&lt;br /&gt;
| logp || smallint |||||| Logged percentage (units 0.1%) of memory waiting to be downloaded (0-1000)&lt;br /&gt;
|-&lt;br /&gt;
| gpsii || integer |||||| GpsIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|comii || integer|||||| ComIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| AcceleroIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| User switches, current (0-65535) &lt;br /&gt;
|-&lt;br /&gt;
|last_gps_fix ||timestamp||||||timestamp of last fix&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||Latitude of last fix. Decimal degrees &lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||Longitude of last fix. Decimal degrees&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_SETTINGS101 or UVA_SETTINGS_LIMITED  == &lt;br /&gt;
&lt;br /&gt;
Settings are either from C0-C1-C9 lines or parsed from uplink communication lines &lt;br /&gt;
If C0-C1 is parsed its values are compared with the previous value and if the settings are the &lt;br /&gt;
same no new records needs to be added &lt;br /&gt;
If uplink settings are parsed wait till the last setting has been seen, (DL command or EOF) &lt;br /&gt;
then store all the new settings in one record. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||Derive timestamp from Hh:mi fields in C0 combined with computer timestamp in JOINED line&lt;br /&gt;
|-&lt;br /&gt;
|timesynced || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|timezone_time || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| SpecialUserSwitches &lt;br /&gt;
|-&lt;br /&gt;
|gpsnavmode || smallint|||||| GpsNavMode 0-7&lt;br /&gt;
|-&lt;br /&gt;
|gpsreceivermode || smallint |||||| GpsReceiverNode 0-3&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtime || smallint|||||| GpsFixTime 0-255&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_h || smallint|||||| hours Gps IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_m || smallint|||||| minutes Gps IvalN on &lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln  || integer|||||| GpsIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_h || smallint|||||| hours Gps IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_m || smallint|||||| minutes GpS IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale  || integer|||||| GpsIvalE &lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_h || smallint|||||| hours Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_m || smallint|||||| minutes Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln || integer|||||| ComIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_h || smallint|||||| hours Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_m || smallint|||||| minutes Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale || integer|||||| ComIvalE&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| Accelero measurement interval         &lt;br /&gt;
|-&lt;br /&gt;
|accbn || integer|||||| Accelero number of blocks &lt;br /&gt;
|-&lt;br /&gt;
|accsn || integer|||||| Accelero number of samples (0-65536)&lt;br /&gt;
|-&lt;br /&gt;
|f || smallint||||||Accelero sample frequency  (0=20Hz, 1=10Hz, 2=5Hz, 3=1Hz)&lt;br /&gt;
|-&lt;br /&gt;
|pdp || smallint|||||| PdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|pac||smallint|||||| PaccMsk (10-100)&lt;br /&gt;
|-&lt;br /&gt;
|tdp ||smallint|||||| TdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|tac ||smallint|||||| TaccMsk (30-300)&lt;br /&gt;
|-&lt;br /&gt;
|ga || smallint|||||| Additional Fixes GpsIval mode (3-25) before interval fix is logged&lt;br /&gt;
|-&lt;br /&gt;
|aol || smallint||||||AccMemOffLev (100 - 950) units 0.1%; if Memfull above  this level all Accelero activity will be overruled and switched off untill MemFull &amp;lt; level - 5&lt;br /&gt;
|-&lt;br /&gt;
|eventnum || text|||||| 12 eventnumbers (0-0xff) only printed if not zero, therfore converted to text&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA101 or UVA_TRACKING_LIMITED==&lt;br /&gt;
&lt;br /&gt;
The tracking dat for newer firmware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||integer||||||heigth above sealevel meters&lt;br /&gt;
|-&lt;br /&gt;
|pressure ||integer||||||in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature ||float||||||in celcius degrees&lt;br /&gt;
|-&lt;br /&gt;
|satellites_used ||smallint||||||satellites used for fix &lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime ||float||||||GpsFixTime in seconds &lt;br /&gt;
|-&lt;br /&gt;
|positiondop ||float||||||Position DOP in units&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy || float||||||Horizontal accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy || float||||||Vertical accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|x_speed ||float||||||Speed in x-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|y_speed ||float||||||Speed in y-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|z_speed ||float||||||Speed in z-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|speed_accuracy || float||||||Speed accuracy (m/s) &lt;br /&gt;
|-&lt;br /&gt;
|location || geometry |||||| lat/long as PostGIS geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_ACCELERATION101 or UVA_ACCELERATION_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Acceleration entries if accelerometer was turned on. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|index ||smallint||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration ||smallint||||||acceleration in X-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration ||smallint||||||acceleration in Y-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration ||smallint||||||acceleration in Z-axis (-2666 till 2666)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENERGY101 or UVA_ENERGY_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|timesynced ||smallint||||||TimeSynced (0=not synced, 1=user set, 2=Gps synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode ||smallint||||||(0-99)&lt;br /&gt;
|-&lt;br /&gt;
|vsll ||float||||||Solar Voltage during charging in mV (0-~2500)&lt;br /&gt;
|-&lt;br /&gt;
|vbat ||float||||||Battery Voltage in V (0-~4.200)&lt;br /&gt;
|-&lt;br /&gt;
|ssw ||smallint|||||| Solar Cell Switches ... (0-255) fw1022 and up &lt;br /&gt;
|-&lt;br /&gt;
| ||||||||extended fields if special user switch is on &lt;br /&gt;
|-&lt;br /&gt;
|vsoo ||float|||||| Solar voltage open in V (0-~2.500)&lt;br /&gt;
|-&lt;br /&gt;
|vdrf ||float||||||reference voltage Dac in V (0-~2.435)&lt;br /&gt;
|-&lt;br /&gt;
|vchr ||float||||||charge current voltage&lt;br /&gt;
|-&lt;br /&gt;
|g ||smallint|||||| Gps battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|c || smallint||||||Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|m || smallint||||||Charge Mode (0,1,2 Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|pressure || integer|||||| in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature || float|||||| in celcius degrees   &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING  or UVA_TRACKING_LIMITED == &lt;br /&gt;
&lt;br /&gt;
View to show identical fields for older and newer firmware tracking data&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|altitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|pressure||integer|||||&lt;br /&gt;
|-&lt;br /&gt;
|temperature||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|x_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|y_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|z_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|location||geometry||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_SPEED or UVA_TRACKING_SPEED_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Additional view that computes with the x_speed, y_speed and z_speed components the vnorth, veast and vdown speed components as well as the absolute value speed in meters/second. &lt;br /&gt;
&lt;br /&gt;
In addition to the fields in the UVA_TRACKING view this view adds :&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|vnorth||float||||||- vx * sin(lat) * cos(long) - vy * sin(lat) * sin (long) + vz * cos(lat)&lt;br /&gt;
|-&lt;br /&gt;
|veast||float|||||| - vx * sin(lon) + vy * cos(lon)&lt;br /&gt;
|-&lt;br /&gt;
|vdown||float|||||| - vx * cos(lat) * cos(lon) - vy * cos(lat) * sin(lon) - vz * sin(lat)&lt;br /&gt;
|-&lt;br /&gt;
|speed||float|||||| sqrt(vx^2 + vy^2 + vz^2)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= UvAGPS functions =&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_speed ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters), time-interval, speed (meters/second) and heading (degrees) for a series of subsequent tracking entries with specific device_info_serial.&lt;br /&gt;
For the first entry in the sequence these values will always be missing because they are computed  as the difference between subsequent rows.&lt;br /&gt;
&lt;br /&gt;
Usage examples :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119);&lt;br /&gt;
&lt;br /&gt;
select t.*, a.distance, a.interval, a.speed, a.direction from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00') a join gps.uva_tracking t using(device_info_serial, date_time);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and heading are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. &lt;br /&gt;
The heading is the initial heading. PostGIS does not calculate the heading, so therefore we don't use PostGIS.&lt;br /&gt;
&lt;br /&gt;
In these functions the records that have been flagged as invalid by setting the userflag are not token into account and discarded. &lt;br /&gt;
If it is required get the speed for all records  a additional boolean argument for '''get raw data''' can be given. i.e.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00', true);&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, true);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) for UvAGPS tracks to arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, 52.1897017, 6.1996606); &lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, (select location from gps.uva_tracking where device_info_serial = 119 and date_time = '2009-05-07 19:55:08')); &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the distance is calculated with the PostGIS distance_sphere function which uses spherical correction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance_direction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) and direction (degrees) for UvAGPS tracks from arbitrary point in lat/long or geometry location&lt;br /&gt;
&lt;br /&gt;
Example usage: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and direction are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. The direction is the direction from the given point.&lt;br /&gt;
&lt;br /&gt;
= Accelerometer calibration =&lt;br /&gt;
&lt;br /&gt;
The accelerometer measures the acceleration in 3D (20 times per second). Acceleration is caused by gravity (static component) and by a change in speed (dynamic component). &lt;br /&gt;
When the logger is static in horizontal position (solar cells up), gravity (green arrow) shows a  heave (vertical acceleration, z) of +1 g (1 g = 9.81 m.s&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;) while surge and heave are both 0. When the front of the logger is vertically pointing down (forward acceleration, x), surge is +1g and when it is rolled to the right (sidewards acceleration, y) sway is +1g. Due to gravity, the pitch of a logger is thus translated into the values of heave, surge and sway (or z, x, y).&lt;br /&gt;
&lt;br /&gt;
However, the values are measured in mV instead of g. Before delivering the GPS-loggers, they have been calibrated at UvA. The acceleration (A) expressed in g is calculated from the measured value (M) and the calibration factors offset (''O'') and sensitivity (''S'').&lt;br /&gt;
&lt;br /&gt;
Thus acceleration for heave (z), surge (x) and sway (y) is calculated as:&lt;br /&gt;
A&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; ;      A&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;;      A&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; ; &lt;br /&gt;
&lt;br /&gt;
The values of ''O'' (in general ranging from 0-60, sometimes even 300) and ''S'' (ranging from 1300-1450) are available in the device table of the data base. If not available, use the factory defaults ''O'' = 0 and ''S'' = 1365.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:accelero1.png|300px]]||[[File:accelero2.png|300px]]|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the figure above heave (z) is shown in green, surge(x) in red and sway (y) in blue, all values are expressed in g (on the y-axis).&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=ToDo&amp;diff=362</id>
		<title>ToDo</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=ToDo&amp;diff=362"/>
				<updated>2010-12-23T11:33:11Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* ToDo List */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ToDo List == &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* View/function to identify foraging trips &lt;br /&gt;
&lt;br /&gt;
* Update speed function to account for userflag  &lt;br /&gt;
&lt;br /&gt;
* Create Flagging facility for invalid tracking data (december 2010) &lt;br /&gt;
&lt;br /&gt;
* Fix UvAGPS KMZ generator (color range, symbol selection) (november 2010)&lt;br /&gt;
&lt;br /&gt;
* Make a readonly copy of Flysafe Wiki on public server (september 2010) &lt;br /&gt;
 &lt;br /&gt;
* Improve UvA GPS parser to log errors such as CRC8 in database (september 2010) &lt;br /&gt;
&lt;br /&gt;
* Implement service to create graphs for UvAGPS devices according to Willem's Matlab scripts  ( october 2010)&lt;br /&gt;
&lt;br /&gt;
* Import UvAGPS log files via standard storage facility ( november 2010) &lt;br /&gt;
&lt;br /&gt;
* Implement generate KML service for for UvAGPS on public server (october 2010) &lt;br /&gt;
&lt;br /&gt;
* Define and implement service to flag invalid GPS tracks  (november 2010)&lt;br /&gt;
&lt;br /&gt;
* Add accelerometer calibration factors to uva_device (september 2010)&lt;br /&gt;
&lt;br /&gt;
* Import UvAGPS metadata. (november 2010)&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=Usage&amp;diff=361</id>
		<title>Usage</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=Usage&amp;diff=361"/>
				<updated>2010-12-09T12:36:29Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* Uploading UvAGPS log files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Database Issues == &lt;br /&gt;
&lt;br /&gt;
* [[ Connecting to the Flysafe database ]]&lt;br /&gt;
&lt;br /&gt;
* [[ Useful Queries ]]&lt;br /&gt;
&lt;br /&gt;
== Website Issues ==&lt;br /&gt;
&lt;br /&gt;
== Various == &lt;br /&gt;
&lt;br /&gt;
=== Uploading UvAGPS log files === &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Goto [https://irods.grid.sara.nl/~ https://irods.grid.sara.nl/~] &lt;br /&gt;
&lt;br /&gt;
* Goto the '''uvagps''' directory&lt;br /&gt;
&lt;br /&gt;
* Upload your UvAGPS files logfiles or zipped logfiles directly in that directory &lt;br /&gt;
&lt;br /&gt;
* If the files have been processed correctly they are moved to the '''~/uvagps/processed''' directory&lt;br /&gt;
&lt;br /&gt;
* If the processing failed they are moved to the '''~/uvagps/failed''' directory, together with a error log.&lt;br /&gt;
&lt;br /&gt;
* If nothing happens within an hour check that the uploaded files (and the ~/uvagps directory) are also owned by the '''uvagps_parser''' user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The files should be processed every hour. If the files have been processed the data is loaded in the master database at '''services.flysafe.sara.nl'''. That database is not accessible for everyone.&lt;br /&gt;
&lt;br /&gt;
The data is being copied to the mirror database on '''public.flysafe.sara.nl''' every night at 2:30 (Amsterdam time) if new files haven been processed, so it can take a day before the uploads of your files are visible on '''public.flysafe.sara.nl'''.&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=Usage&amp;diff=360</id>
		<title>Usage</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=Usage&amp;diff=360"/>
				<updated>2010-12-09T12:33:51Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* Uploading UvAGPS log files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Database Issues == &lt;br /&gt;
&lt;br /&gt;
* [[ Connecting to the Flysafe database ]]&lt;br /&gt;
&lt;br /&gt;
* [[ Useful Queries ]]&lt;br /&gt;
&lt;br /&gt;
== Website Issues ==&lt;br /&gt;
&lt;br /&gt;
== Various == &lt;br /&gt;
&lt;br /&gt;
=== Uploading UvAGPS log files === &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Goto [https://irods.grid.sara.nl/~ https://irods.grid.sara.nl/~] &lt;br /&gt;
&lt;br /&gt;
* Goto the '''uvagps''' directory&lt;br /&gt;
&lt;br /&gt;
* Upload your UvAGPS files logfiles or zipped logfiles directly in that directory &lt;br /&gt;
&lt;br /&gt;
* If the files have been processed correctly they are moved to the '''~/uvagps/processed''' directory&lt;br /&gt;
&lt;br /&gt;
* If the processing failed they are moved to the '''~/uvagps/failed''' directory, together with a error log.&lt;br /&gt;
&lt;br /&gt;
* If nothing happens within an our check that the uploaded files (and the ~/uvagps directory) alre also owned by the '''uvagps_parser''' user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the files have been processed data is loaded in the master database at '''services.flysafe.sara.nl'''. That database is not accessible for everyone.&lt;br /&gt;
&lt;br /&gt;
The data is being copied to the mirror database on '''public.flysafe.sara.nl''' every night at 2:30 (Amsterdam time) if new files haven been processed, so it can take a day before the uploads of your files are visible on '''public.flysafe.sara.nl'''.&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=Usage&amp;diff=359</id>
		<title>Usage</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=Usage&amp;diff=359"/>
				<updated>2010-12-09T12:26:17Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* Uploading UvAGPS log files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Database Issues == &lt;br /&gt;
&lt;br /&gt;
* [[ Connecting to the Flysafe database ]]&lt;br /&gt;
&lt;br /&gt;
* [[ Useful Queries ]]&lt;br /&gt;
&lt;br /&gt;
== Website Issues ==&lt;br /&gt;
&lt;br /&gt;
== Various == &lt;br /&gt;
&lt;br /&gt;
=== Uploading UvAGPS log files === &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Goto [https://irods.grid.sara.nl/~ https://irods.grid.sara.nl/~] &lt;br /&gt;
&lt;br /&gt;
* Goto the '''uvagps''' directory&lt;br /&gt;
&lt;br /&gt;
* Upload your UvAGPS files logfiles or zipped logfiles directly in that directory &lt;br /&gt;
&lt;br /&gt;
* If the files have been processed correctly they are moved to the '''~/uvagps/processed''' directory&lt;br /&gt;
&lt;br /&gt;
* If the processing failed they are moved to the '''~/uvagps/failed''' directory, together with a error log.&lt;br /&gt;
&lt;br /&gt;
* If nothing happens within an our check that the uploaded files (and the ~/uvagps directory) alre also owned by the '''uvagps_parser''' user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the files have been processed data is loaded in the master database at '''services.flysafe.sara.nl'''. That database is not accessible for everyone.&lt;br /&gt;
&lt;br /&gt;
The Mirror database on '''public.flysafe.sara.nl''' is being copied every night at 2:30 if new files haven been processed, so it can take a day before the uploads of your files &lt;br /&gt;
are visible on '''public.flysafe.sara.nl'''.&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=ToDo&amp;diff=358</id>
		<title>ToDo</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=ToDo&amp;diff=358"/>
				<updated>2010-11-25T10:35:31Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* ToDo List */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ToDo List == &lt;br /&gt;
&lt;br /&gt;
* Create Flagging facility for invalid tracking data &lt;br /&gt;
&lt;br /&gt;
* View/function to identify foraging trips &lt;br /&gt;
&lt;br /&gt;
* Fix UvAGPS KMZ generator (color range, symbol selection) (november 2010)&lt;br /&gt;
&lt;br /&gt;
* Make a readonly copy of Flysafe Wiki on public server (september 2010) &lt;br /&gt;
 &lt;br /&gt;
* Improve UvA GPS parser to log errors such as CRC8 in database (september 2010) &lt;br /&gt;
&lt;br /&gt;
* Implement service to create graphs for UvAGPS devices according to Willem's Matlab scripts  ( october 2010)&lt;br /&gt;
&lt;br /&gt;
* Import UvAGPS log files via standard storage facility ( november 2010) &lt;br /&gt;
&lt;br /&gt;
* Implement generate KML service for for UvAGPS on public server (october 2010) &lt;br /&gt;
&lt;br /&gt;
* Define and implement service to flag invalid GPS tracks  (november 2010)&lt;br /&gt;
&lt;br /&gt;
* Add accelerometer calibration factors to uva_device (september 2010)&lt;br /&gt;
&lt;br /&gt;
* Import UvAGPS metadata. (november 2010)&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=ToDo&amp;diff=357</id>
		<title>ToDo</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=ToDo&amp;diff=357"/>
				<updated>2010-11-24T13:40:08Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* ToDo List */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ToDo List == &lt;br /&gt;
&lt;br /&gt;
* Fix UvAGPS KMZ generator (color range, symbol selection) &lt;br /&gt;
&lt;br /&gt;
* Create Flagging facility for invalid tracking data &lt;br /&gt;
&lt;br /&gt;
* View/function to identify foraging trips &lt;br /&gt;
&lt;br /&gt;
* Make a readonly copy of Flysafe Wiki on public server (september 2010) &lt;br /&gt;
 &lt;br /&gt;
* Improve UvA GPS parser to log errors such as CRC8 in database (september 2010) &lt;br /&gt;
&lt;br /&gt;
* Implement service to create graphs for UvAGPS devices according to Willem's Matlab scripts  ( october 2010)&lt;br /&gt;
&lt;br /&gt;
* Import UvAGPS log files via standard storage facility ( november 2010) &lt;br /&gt;
&lt;br /&gt;
* Implement generate KML service for for UvAGPS on public server (october 2010) &lt;br /&gt;
&lt;br /&gt;
* Define and implement service to flag invalid GPS tracks  (november 2010)&lt;br /&gt;
&lt;br /&gt;
* Add accelerometer calibration factors to uva_device (september 2010)&lt;br /&gt;
&lt;br /&gt;
* Import UvAGPS metadata. (november 2010)&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=Usage&amp;diff=356</id>
		<title>Usage</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=Usage&amp;diff=356"/>
				<updated>2010-11-24T11:58:03Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Database Issues == &lt;br /&gt;
&lt;br /&gt;
* [[ Connecting to the Flysafe database ]]&lt;br /&gt;
&lt;br /&gt;
* [[ Useful Queries ]]&lt;br /&gt;
&lt;br /&gt;
== Website Issues ==&lt;br /&gt;
&lt;br /&gt;
== Various == &lt;br /&gt;
&lt;br /&gt;
=== Uploading UvAGPS log files === &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Goto [https://irods.grid.sara.nl/~ https://irods.grid.sara.nl/~] &lt;br /&gt;
&lt;br /&gt;
* Goto the '''uvagps''' directory&lt;br /&gt;
&lt;br /&gt;
* Upload your UvAGPS files logfiles or zipped logfiles directly in that directory &lt;br /&gt;
&lt;br /&gt;
* If the files have been processed correctly they are moved to the '''~/uvagps/processed''' directory&lt;br /&gt;
&lt;br /&gt;
* If the processing failed they are moved to the '''~/uvagps/failed''' directory, together with a error log.&lt;br /&gt;
&lt;br /&gt;
* If nothing happens within a hour check that the uploaded files (and the ~/uvagps directory) alre also owned by the '''uvagps_parser''' user.&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=Usage&amp;diff=355</id>
		<title>Usage</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=Usage&amp;diff=355"/>
				<updated>2010-11-24T11:52:01Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* Uploading UvAGPS log files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General ==&lt;br /&gt;
&lt;br /&gt;
=== Uploading UvAGPS log files === &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Goto [https://irods.grid.sara.nl/~ https://irods.grid.sara.nl/~] &lt;br /&gt;
&lt;br /&gt;
* Goto the '''uvagps''' directory&lt;br /&gt;
&lt;br /&gt;
* Upload your UvAGPS files logfiles or zipped logfiles directly in that directory &lt;br /&gt;
&lt;br /&gt;
* If the files have been processed correctly they are moved to the '''~/uvagps/processed''' directory&lt;br /&gt;
&lt;br /&gt;
* If the processing failed they are moved to the '''~/uvagps/failed''' directory, together with a error log.&lt;br /&gt;
&lt;br /&gt;
* If nothing happens within a hour check that the uploaded files (and the ~/uvagps directory) alre also owned by the '''uvagps_parser''' user.&lt;br /&gt;
&lt;br /&gt;
== Database Issues == &lt;br /&gt;
&lt;br /&gt;
* [[ Connecting to the Flysafe database ]]&lt;br /&gt;
&lt;br /&gt;
* [[ Useful Queries ]]&lt;br /&gt;
&lt;br /&gt;
== Website Issues ==&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=Usage&amp;diff=354</id>
		<title>Usage</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=Usage&amp;diff=354"/>
				<updated>2010-11-24T11:51:32Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* Uploading UvAGPS log files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General ==&lt;br /&gt;
&lt;br /&gt;
=== Uploading UvAGPS log files === &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Goto [https://irods.grid.sara.nl/~ https://irods.grid.sara.nl/~] &lt;br /&gt;
&lt;br /&gt;
* Got to the '''uvagps''' directory&lt;br /&gt;
&lt;br /&gt;
* Upload your UvAGPS files logfiles or zipped logfiles directly in that directory &lt;br /&gt;
&lt;br /&gt;
* If the files have been processed correctly they are moved to the '''~/uvagps/processed''' directory&lt;br /&gt;
&lt;br /&gt;
* If the processing failed they are moved to the '''~/uvagps/failed''' directory, together with a error log.&lt;br /&gt;
&lt;br /&gt;
* If nothing happens within a hour check that the uploaded files (and the ~/uvagps directory) alre also owned by the '''uvagps_parser''' user.&lt;br /&gt;
&lt;br /&gt;
== Database Issues == &lt;br /&gt;
&lt;br /&gt;
* [[ Connecting to the Flysafe database ]]&lt;br /&gt;
&lt;br /&gt;
* [[ Useful Queries ]]&lt;br /&gt;
&lt;br /&gt;
== Website Issues ==&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=Usage&amp;diff=353</id>
		<title>Usage</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=Usage&amp;diff=353"/>
				<updated>2010-11-24T11:50:03Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* General */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General ==&lt;br /&gt;
&lt;br /&gt;
=== Uploading UvAGPS log files === &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Goto [https://irods.grid.sara.nl/~] &lt;br /&gt;
&lt;br /&gt;
* Got to the '''uvagps''' directory&lt;br /&gt;
&lt;br /&gt;
* Upload your UvAGPS files logfiles or zipped logfiles directly in that directory &lt;br /&gt;
&lt;br /&gt;
* If the files have been processed correctly they are moved to the '''~/uvagps/processed''' directory&lt;br /&gt;
&lt;br /&gt;
* If the processing failed they are moved to the '''~/uvagps/failed''' directory, together with a error log.&lt;br /&gt;
&lt;br /&gt;
== Database Issues == &lt;br /&gt;
&lt;br /&gt;
* [[ Connecting to the Flysafe database ]]&lt;br /&gt;
&lt;br /&gt;
* [[ Useful Queries ]]&lt;br /&gt;
&lt;br /&gt;
== Website Issues ==&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=352</id>
		<title>UvAGPS</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=352"/>
				<updated>2010-11-04T09:42:47Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* UvAGPS Data Model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= UvAGPS Data Model =&lt;br /&gt;
&lt;br /&gt;
For different versions of the UvAGPS firmware different tables are used. For firmware version v0.9.3.6 till v1.0.0.X the tables UVA_ENGINEERING_DATA and UVA_TRACKING_DATA are used. But in the new firmware versions 1.0.1.4 till 1.0.2.4 so much information was added  that new tables were introduced. However for the most important tracking tables a view is created so that all similar tracking for all types of firmware can be seen in one view. That is the UVA_TRACKING view. &lt;br /&gt;
&lt;br /&gt;
All tables, views and functions are also in the GPS schema.&lt;br /&gt;
&lt;br /&gt;
Not everybody has access to all data.  For most users access is limited to &amp;quot;limited&amp;quot; views that only give access to selected devices. &lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA or UVA_TRACKING_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float8||||||Horizontal accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float8||||||Vertical accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||float8||||||m&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration||Float8||||||x axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) movement to right is + and to left is -&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration||Float8||||||y axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) forward movement is + and backwards is -&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration||Float8||||||z axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) upwards movement is + downwards is -&lt;br /&gt;
|-&lt;br /&gt;
|speed ||float8||||||m/s&lt;br /&gt;
|-&lt;br /&gt;
|course||float8||||||Degrees&lt;br /&gt;
|-&lt;br /&gt;
|pressure||float8||||||Pressure sensor (pascal)&lt;br /&gt;
|-&lt;br /&gt;
|temperature||Float8||||||Degrees celcius&lt;br /&gt;
|-&lt;br /&gt;
|solar_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|battery_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|quality||text||||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|  “&amp;quot;location”&amp;quot;||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENGINEERING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Engineering data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|t_syncsts||smallint||||||0: not synced, 1: user synced, 2: Gps synced&lt;br /&gt;
|-&lt;br /&gt;
|t_entzt||smallint||||||0: UCT time,1: TZT time (timezone time)&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentrategps||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratecom||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratepwr||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagesolarpanel||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagebattery||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_chargemode||int2||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainrategps||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratecom||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratepwr||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_esavegpsrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_esavecomrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsnavigationmode||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtimeout||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|eh||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_DEVICE or UVA_DEVICE_LIMITED == &lt;br /&gt;
&lt;br /&gt;
To be able to track the different firmware versions and specific properties for the different devices the UVA_DEVICE table was added. This table also includes essential information needed to calibrate the accelerometers. For more information see [[UvAGPS|Accelerometer calibration]]&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL || Serial number of tag&lt;br /&gt;
|- &lt;br /&gt;
| firmware_version || text |||| NOT NULL || Firmware version installed on tag&lt;br /&gt;
|-&lt;br /&gt;
| device_mass || double |||||||Mass of tag (g)&lt;br /&gt;
|-&lt;br /&gt;
| x_s|| double |||||||Calibration sensitivity of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_s|| double |||||||Calibration sensitivity of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_s|| double |||||||Calibration sensitivity of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
| x_o|| double |||||||Calibration offset of accelerometer in the x-axis &lt;br /&gt;
|-&lt;br /&gt;
| y_o|| double |||||||Calibration offset of accelerometer in the y-axis &lt;br /&gt;
|-&lt;br /&gt;
| z_o|| double |||||||Calibration offset of accelerometer in the z-axis &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_COMM101 or UVA_COMM_LIMITED== &lt;br /&gt;
&lt;br /&gt;
Communication table indicates status and result of communications with ground stations. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
| date_time || timestamp || PK || NOT NULL || timestamp of start communication&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end || timestamp |||||| timestamp of end communication           &lt;br /&gt;
|-&lt;br /&gt;
| date_time_utc || timestamp |||||| date_time in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end_utc || timestamp |||||| date_time_end in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| action || text|||||| JOINED / RESCHEDULE  ??&lt;br /&gt;
|-&lt;br /&gt;
| bytes_communicated || integer |||||| Number of bytes communicated (total of all bytes per DATA line)  &lt;br /&gt;
|-&lt;br /&gt;
|status || text |||||| READY, TIMEOUT, LOWPOWER, MISSING&lt;br /&gt;
|-&lt;br /&gt;
| network_join_time || integer||||||milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| number_identical_lines || integer |||||| Number identical lines in data block. Gives indication &lt;br /&gt;
|-&lt;br /&gt;
| non_ascii_char || integer |||||| Number of non ascii characters (indicated by question-mark ?)&lt;br /&gt;
|-&lt;br /&gt;
| sts_time || timestamp |||||| derived from S0 hh,mi&lt;br /&gt;
|-&lt;br /&gt;
| timesynced || smallint|||||| TimeSynced (0=not sy:wnced, 1=user set, 2=Gps Synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode || smallint||||||DeviceMode (0-99)&lt;br /&gt;
|-&lt;br /&gt;
| vbat || float |||||| Battery voltage in V (0-~4.200V) &lt;br /&gt;
|-&lt;br /&gt;
|logb || integer |||||| logged bytes, waiting for download (0-4Mbyte)&lt;br /&gt;
|-&lt;br /&gt;
| logp || smallint |||||| Logged percentage (units 0.1%) of memory waiting to be downloaded (0-1000)&lt;br /&gt;
|-&lt;br /&gt;
| gpsii || integer |||||| GpsIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|comii || integer|||||| ComIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| AcceleroIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| User switches, current (0-65535) &lt;br /&gt;
|-&lt;br /&gt;
|last_gps_fix ||timestamp||||||timestamp of last fix&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||Latitude of last fix. Decimal degrees &lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||Longitude of last fix. Decimal degrees&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_SETTINGS101 or UVA_SETTINGS_LIMITED  == &lt;br /&gt;
&lt;br /&gt;
Settings are either from C0-C1-C9 lines or parsed from uplink communication lines &lt;br /&gt;
If C0-C1 is parsed its values are compared with the previous value and if the settings are the &lt;br /&gt;
same no new records needs to be added &lt;br /&gt;
If uplink settings are parsed wait till the last setting has been seen, (DL command or EOF) &lt;br /&gt;
then store all the new settings in one record. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||Derive timestamp from Hh:mi fields in C0 combined with computer timestamp in JOINED line&lt;br /&gt;
|-&lt;br /&gt;
|timesynced || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|timezone_time || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| SpecialUserSwitches &lt;br /&gt;
|-&lt;br /&gt;
|gpsnavmode || smallint|||||| GpsNavMode 0-7&lt;br /&gt;
|-&lt;br /&gt;
|gpsreceivermode || smallint |||||| GpsReceiverNode 0-3&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtime || smallint|||||| GpsFixTime 0-255&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_h || smallint|||||| hours Gps IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_m || smallint|||||| minutes Gps IvalN on &lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln  || integer|||||| GpsIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_h || smallint|||||| hours Gps IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_m || smallint|||||| minutes GpS IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale  || integer|||||| GpsIvalE &lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_h || smallint|||||| hours Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_m || smallint|||||| minutes Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln || integer|||||| ComIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_h || smallint|||||| hours Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_m || smallint|||||| minutes Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale || integer|||||| ComIvalE&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| Accelero measurement interval         &lt;br /&gt;
|-&lt;br /&gt;
|accbn || integer|||||| Accelero number of blocks &lt;br /&gt;
|-&lt;br /&gt;
|accsn || integer|||||| Accelero number of samples (0-65536)&lt;br /&gt;
|-&lt;br /&gt;
|f || smallint||||||Accelero sample frequency  (0=20Hz, 1=10Hz, 2=5Hz, 3=1Hz)&lt;br /&gt;
|-&lt;br /&gt;
|pdp || smallint|||||| PdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|pac||smallint|||||| PaccMsk (10-100)&lt;br /&gt;
|-&lt;br /&gt;
|tdp ||smallint|||||| TdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|tac ||smallint|||||| TaccMsk (30-300)&lt;br /&gt;
|-&lt;br /&gt;
|ga || smallint|||||| Additional Fixes GpsIval mode (3-25) before interval fix is logged&lt;br /&gt;
|-&lt;br /&gt;
|aol || smallint||||||AccMemOffLev (100 - 950) units 0.1%; if Memfull above  this level all Accelero activity will be overruled and switched off untill MemFull &amp;lt; level - 5&lt;br /&gt;
|-&lt;br /&gt;
|eventnum || text|||||| 12 eventnumbers (0-0xff) only printed if not zero, therfore converted to text&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA101 or UVA_TRACKING_LIMITED==&lt;br /&gt;
&lt;br /&gt;
The tracking dat for newer firmware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||integer||||||heigth above sealevel meters&lt;br /&gt;
|-&lt;br /&gt;
|pressure ||integer||||||in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature ||float||||||in celcius degrees&lt;br /&gt;
|-&lt;br /&gt;
|satellites_used ||smallint||||||satellites used for fix &lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime ||float||||||GpsFixTime in seconds &lt;br /&gt;
|-&lt;br /&gt;
|positiondop ||float||||||Position DOP in units&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy || float||||||Horizontal accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy || float||||||Vertical accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|x_speed ||float||||||Speed in x-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|y_speed ||float||||||Speed in y-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|z_speed ||float||||||Speed in z-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|speed_accuracy || float||||||Speed accuracy (m/s) &lt;br /&gt;
|-&lt;br /&gt;
|location || geometry |||||| lat/long as PostGIS geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_ACCELERATION101 or UVA_ACCELERATION_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Acceleration entries if accelerometer was turned on. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|index ||smallint||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration ||smallint||||||acceleration in X-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration ||smallint||||||acceleration in Y-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration ||smallint||||||acceleration in Z-axis (-2666 till 2666)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENERGY101 or UVA_ENERGY_LIMITED ==&lt;br /&gt;
&lt;br /&gt;
Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|timesynced ||smallint||||||TimeSynced (0=not synced, 1=user set, 2=Gps synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode ||smallint||||||(0-99)&lt;br /&gt;
|-&lt;br /&gt;
|vsll ||float||||||Solar Voltage during charging in mV (0-~2500)&lt;br /&gt;
|-&lt;br /&gt;
|vbat ||float||||||Battery Voltage in V (0-~4.200)&lt;br /&gt;
|-&lt;br /&gt;
|ssw ||smallint|||||| Solar Cell Switches ... (0-255) fw1022 and up &lt;br /&gt;
|-&lt;br /&gt;
| ||||||||extended fields if special user switch is on &lt;br /&gt;
|-&lt;br /&gt;
|vsoo ||float|||||| Solar voltage open in V (0-~2.500)&lt;br /&gt;
|-&lt;br /&gt;
|vdrf ||float||||||reference voltage Dac in V (0-~2.435)&lt;br /&gt;
|-&lt;br /&gt;
|vchr ||float||||||charge current voltage&lt;br /&gt;
|-&lt;br /&gt;
|g ||smallint|||||| Gps battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|c || smallint||||||Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|m || smallint||||||Charge Mode (0,1,2 Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|pressure || integer|||||| in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature || float|||||| in celcius degrees   &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING  or UVA_TRACKING_LIMITED == &lt;br /&gt;
&lt;br /&gt;
View to show identical fields for older and newer firmware tracking data&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|altitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|pressure||integer|||||&lt;br /&gt;
|-&lt;br /&gt;
|temperature||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|x_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|y_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|z_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|location||geometry||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_SPEED or UVA_TRACKING_SPEED_LIMITED == &lt;br /&gt;
&lt;br /&gt;
Additional view that computes with the x_speed, y_speed and z_speed components the vnorth, veast and vdown speed components as well as the absolute value speed in meters/second. &lt;br /&gt;
&lt;br /&gt;
In addition to the fields in the UVA_TRACKING view this view adds :&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|vnorth||float||||||- vx * sin(lat) * cos(long) - vy * sin(lat) * sin (long) + vz * cos(lat)&lt;br /&gt;
|-&lt;br /&gt;
|veast||float|||||| - vx * sin(lon) + vy * cos(lon)&lt;br /&gt;
|-&lt;br /&gt;
|vdown||float|||||| - vx * cos(lat) * cos(lon) - vy * cos(lat) * sin(lon) - vz * sin(lat)&lt;br /&gt;
|-&lt;br /&gt;
|speed||float|||||| sqrt(vx^2 + vy^2 + vz^2)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= UvAGPS functions =&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_speed ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters), time-interval, speed (meters/second) and heading (degrees) for a series of subsequent tracking entries with specific device_info_serial.&lt;br /&gt;
For the first entry in the sequence these values will always be missing because they are computed  as the difference between subsequent rows.&lt;br /&gt;
&lt;br /&gt;
Usage examples :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119);&lt;br /&gt;
&lt;br /&gt;
select t.*, a.distance, a.interval, a.speed, a.direction from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00') a join gps.uva_tracking t using(device_info_serial, date_time);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and heading are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. &lt;br /&gt;
The heading is the initial heading. PostGIS does not calculate the heading, so therefore we don't use PostGIS.&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) for UvAGPS tracks to arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, 52.1897017, 6.1996606); &lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, (select location from gps.uva_tracking where device_info_serial = 119 and date_time = '2009-05-07 19:55:08')); &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the distance is calculated with the PostGIS distance_sphere function which uses spherical correction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance_direction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) and direction (degrees) for UvAGPS tracks from arbitrary point in lat/long or geometry location&lt;br /&gt;
&lt;br /&gt;
Example usage: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and direction are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. The direction is the direction from the given point.&lt;br /&gt;
&lt;br /&gt;
= Accelerometer calibration =&lt;br /&gt;
&lt;br /&gt;
The accelerometer measures the acceleration in 3D (20 times per second). Acceleration is caused by gravity (static component) and by a change in speed (dynamic component). &lt;br /&gt;
When the logger is static in horizontal position (solar cells up), gravity (green arrow) shows a  heave (vertical acceleration, z) of +1 g (1 g = 9.81 m.s&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;) while surge and heave are both 0. When the front of the logger is vertically pointing down (forward acceleration, x), surge is +1g and when it is rolled to the right (sidewards acceleration, y) sway is +1g. Due to gravity, the pitch of a logger is thus translated into the values of heave, surge and sway (or z, x, y).&lt;br /&gt;
&lt;br /&gt;
However, the values are measured in mV instead of g. Before delivering the GPS-loggers, they have been calibrated at UvA. The acceleration (A) expressed in g is calculated from the measured value (M) and the calibration factors offset (''O'') and sensitivity (''S'').&lt;br /&gt;
&lt;br /&gt;
Thus acceleration for heave (z), surge (x) and sway (y) is calculated as:&lt;br /&gt;
A&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt; ;      A&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;;      A&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; = (M&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;-O&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;)/S&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt; ; &lt;br /&gt;
&lt;br /&gt;
The values of ''O'' (in general ranging from 0-60, sometimes even 300) and ''S'' (ranging from 1300-1450) are available in the device table of the data base. If not available, use the factory defaults ''O'' = 0 and ''S'' = 1365.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:accelero1.png|300px]]||[[File:accelero2.png|300px]]|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the figure above heave (z) is shown in green, surge(x) in red and sway (y) in blue, all values are expressed in g (on the y-axis).&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=Setting_up_a_connection_to_the_e-Ecology_database&amp;diff=351</id>
		<title>Setting up a connection to the e-Ecology database</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=Setting_up_a_connection_to_the_e-Ecology_database&amp;diff=351"/>
				<updated>2010-11-04T09:36:24Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* Setting up an ODBC connection */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Connecting to the FlySafe database via Access or other relational database programs=&lt;br /&gt;
Judy Shamoun-Baranes / Bart Heupers&lt;br /&gt;
Last updated: November 4, 2010&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=General Information=&lt;br /&gt;
&lt;br /&gt;
The Flysafe database is a spatial postgreSQL ([http://www.postgresql.org/-http://www.postgresql.org/]).  &lt;br /&gt;
&lt;br /&gt;
PGAdmin can be used to browse and query data.  If you use pgadmin you do not need to set up an ODBC connection.&lt;br /&gt;
&lt;br /&gt;
Database can also be called from other programs by installing an ODBC driver for postgreSQL  and establishing a &amp;quot;User Data Source&amp;quot; [http://www.postgresql.org/ftp/odbc/versions/msi/-http://www.postgresql.org/ftp/odbc/versions/msi/]&lt;br /&gt;
&lt;br /&gt;
In order to access the database your IP address must be sent to Bart Heupers who will provide a user name and password. For organizations an IP range can also be given.&lt;br /&gt;
&lt;br /&gt;
Resticted flysafe server information&lt;br /&gt;
&lt;br /&gt;
  server : services.flysafe.sara.nl  or analysis.flysafe.sara.nl&lt;br /&gt;
  port : 5432&lt;br /&gt;
  ssl : required&lt;br /&gt;
&lt;br /&gt;
The public server is at &lt;br /&gt;
&lt;br /&gt;
  server : public.flysafe.sara.nl&lt;br /&gt;
  port : 5432&lt;br /&gt;
  ssl : required&lt;br /&gt;
&lt;br /&gt;
The tracking data can be found in schema '''gps'''. However these instructions can be followed for any of the data included in the flysafe database.&lt;br /&gt;
&lt;br /&gt;
=Setting up an ODBC connection=&lt;br /&gt;
&lt;br /&gt;
ODBC (Open Database connectivity) is a standard method of sharing data between databases and other programs. ODBC drivers use SQL to gain access to data from sources outside the program.  Therefore, in order to connect between your database and other programs you must set up an ODBC connection.  &lt;br /&gt;
Step 1: Download and install an ODBC driver for postgreSQL.&lt;br /&gt;
[http://www.postgresql.org/ftp/odbc/versions/msi/-http://www.postgresql.org/ftp/odbc/versions/msi/]&lt;br /&gt;
Step 2: Set up ODBC connection&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Do the following:&lt;br /&gt;
# go to '''start | Control panel | Administrative tools | Data sources (ODBC)'''&lt;br /&gt;
# go to '''User DSN''' (first tab in Data sources)&lt;br /&gt;
# click '''ADD'''&lt;br /&gt;
# in window '''create''' '''new data source''' select '''PostgreSQL ANSI''' click '''FINISH'''&lt;br /&gt;
# The '''ODBC Driver setup''' window opens. '''Data source name''': give your data source a name (eg GPS).  Keep it simple, easily identifiable, this is the name you will use to identify your database from other applications, this will be the '''ODBC driver name'''.&lt;br /&gt;
# In the same window fill in the following information: '''database''' ''flysafe'', '''Server'''  ''services.flysafe.sara.nl'' or ''public.flysafe.sara.nl'', '''User Name''' your user name, '''SSL Mode''' ''require'', '''Port''' ''5432'', '''Password''' your password. When the window is completed click '''SAVE'''&lt;br /&gt;
# Back in the '''User DSN''' window you should now see your ODBC driver you just named, click '''OK'''&lt;br /&gt;
After completing these steps many other programs will now recognize your database and be able to communicate with it&lt;br /&gt;
&lt;br /&gt;
=Connecting to Access=&lt;br /&gt;
You can now connect to the database via access. You have two options. One is to import the data, once this is done your database is not automatically updated but does not require a link to the database.&lt;br /&gt;
&lt;br /&gt;
The second option (described below) is to create a dynamic link to the database (you must be connected to the network) in this case you are always viewing data that is in the actual SARA database.&lt;br /&gt;
&lt;br /&gt;
# Open a new database in Access&lt;br /&gt;
# go to '''file | Get external data | Link tables'''&lt;br /&gt;
# in '''files of type''' select '''ODBC databases'''&lt;br /&gt;
# in '''select data source''' click on tab '''Machine Data Source'''&lt;br /&gt;
# select the data source name you created when setting up the ODBC connection (eg GPS) click '''OK'''&lt;br /&gt;
# Select the tables you want to import click OK&lt;br /&gt;
&lt;br /&gt;
You now have access to your selected tables in the database. Have fun.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Original document  [[ Media:Connect_flysafe.doc ]]&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=Setting_up_a_connection_to_the_e-Ecology_database&amp;diff=350</id>
		<title>Setting up a connection to the e-Ecology database</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=Setting_up_a_connection_to_the_e-Ecology_database&amp;diff=350"/>
				<updated>2010-11-04T09:35:42Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Connecting to the FlySafe database via Access or other relational database programs=&lt;br /&gt;
Judy Shamoun-Baranes / Bart Heupers&lt;br /&gt;
Last updated: November 4, 2010&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=General Information=&lt;br /&gt;
&lt;br /&gt;
The Flysafe database is a spatial postgreSQL ([http://www.postgresql.org/-http://www.postgresql.org/]).  &lt;br /&gt;
&lt;br /&gt;
PGAdmin can be used to browse and query data.  If you use pgadmin you do not need to set up an ODBC connection.&lt;br /&gt;
&lt;br /&gt;
Database can also be called from other programs by installing an ODBC driver for postgreSQL  and establishing a &amp;quot;User Data Source&amp;quot; [http://www.postgresql.org/ftp/odbc/versions/msi/-http://www.postgresql.org/ftp/odbc/versions/msi/]&lt;br /&gt;
&lt;br /&gt;
In order to access the database your IP address must be sent to Bart Heupers who will provide a user name and password. For organizations an IP range can also be given.&lt;br /&gt;
&lt;br /&gt;
Resticted flysafe server information&lt;br /&gt;
&lt;br /&gt;
  server : services.flysafe.sara.nl  or analysis.flysafe.sara.nl&lt;br /&gt;
  port : 5432&lt;br /&gt;
  ssl : required&lt;br /&gt;
&lt;br /&gt;
The public server is at &lt;br /&gt;
&lt;br /&gt;
  server : public.flysafe.sara.nl&lt;br /&gt;
  port : 5432&lt;br /&gt;
  ssl : required&lt;br /&gt;
&lt;br /&gt;
The tracking data can be found in schema '''gps'''. However these instructions can be followed for any of the data included in the flysafe database.&lt;br /&gt;
&lt;br /&gt;
=Setting up an ODBC connection=&lt;br /&gt;
&lt;br /&gt;
ODBC (Open Database connectivity) is a standard method of sharing data between databases and other programs. ODBC drivers use SQL to gain access to data from sources outside the program.  Therefore, in order to connect between your database and other programs you must set up an ODBC connection.  &lt;br /&gt;
Step 1: Download and install an ODBC driver for postgreSQL.&lt;br /&gt;
[http://www.postgresql.org/ftp/odbc/versions/msi/-http://www.postgresql.org/ftp/odbc/versions/msi/]&lt;br /&gt;
Step 2: Set up ODBC connection&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Do the following:&lt;br /&gt;
# go to '''start | Control panel | Administrative tools | Data sources (ODBC)'''&lt;br /&gt;
# go to '''User DSN''' (first tab in Data sources)&lt;br /&gt;
# click '''ADD'''&lt;br /&gt;
# in window '''create''' '''new data source''' select '''PostgreSQL ANSI''' click '''FINISH'''&lt;br /&gt;
# The '''ODBC Driver setup''' window opens. '''Data source name''': give your data source a name (eg GPS).  Keep it simple, easily identifiable, this is the name you will use to identify your database from other applications, this will be the '''ODBC driver name'''.&lt;br /&gt;
# In the same window fill in the following information: '''database''' ''flysafe'', '''Server'''  ''services.flysafe.sara.nl'', '''User Name''' your user name, '''SSL Mode''' ''require'', '''Port''' ''5432'', '''Password''' your password. When the window is completed click '''SAVE'''&lt;br /&gt;
# Back in the '''User DSN''' window you should now see your ODBC driver you just named, click '''OK'''&lt;br /&gt;
After completing these steps many other programs will now recognize your database and be able to communicate with it&lt;br /&gt;
&lt;br /&gt;
=Connecting to Access=&lt;br /&gt;
You can now connect to the database via access. You have two options. One is to import the data, once this is done your database is not automatically updated but does not require a link to the database.&lt;br /&gt;
&lt;br /&gt;
The second option (described below) is to create a dynamic link to the database (you must be connected to the network) in this case you are always viewing data that is in the actual SARA database.&lt;br /&gt;
&lt;br /&gt;
# Open a new database in Access&lt;br /&gt;
# go to '''file | Get external data | Link tables'''&lt;br /&gt;
# in '''files of type''' select '''ODBC databases'''&lt;br /&gt;
# in '''select data source''' click on tab '''Machine Data Source'''&lt;br /&gt;
# select the data source name you created when setting up the ODBC connection (eg GPS) click '''OK'''&lt;br /&gt;
# Select the tables you want to import click OK&lt;br /&gt;
&lt;br /&gt;
You now have access to your selected tables in the database. Have fun.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Original document  [[ Media:Connect_flysafe.doc ]]&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=Useful_Queries&amp;diff=338</id>
		<title>Useful Queries</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=Useful_Queries&amp;diff=338"/>
				<updated>2010-09-27T09:44:58Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A query to determine the total distance a bird has flown is : &lt;br /&gt;
&lt;br /&gt;
 select sum(distance)/1000 as total_distance&lt;br /&gt;
 from gps.get_uvagps_track_speed('''&amp;lt;ID&amp;gt;''');&lt;br /&gt;
&lt;br /&gt;
or for a fixed time period :&lt;br /&gt;
&lt;br /&gt;
 select sum(distance)/1000 as total_distance&lt;br /&gt;
 from gps.get_uvagps_track_speed('''&amp;lt;ID&amp;gt;''', '2010-01-01 00:00:00', '2011-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to do this for all ID's at the same time you can do something like :&lt;br /&gt;
&lt;br /&gt;
 select device_info_serial,  (select sum(distance)/1000&lt;br /&gt;
   from gps.get_uvagps_track_speed(device_info_serial, '2010-01-01 00:00:00', '2011-01-01 00:00:00')) as total_distance&lt;br /&gt;
 from gps.uva_device&lt;br /&gt;
&lt;br /&gt;
For limited users :&lt;br /&gt;
&lt;br /&gt;
 select device_info_serial,  (select sum(distance)/1000&lt;br /&gt;
   from gps.get_uvagps_track_speed(device_info_serial, '2010-01-01 00:00:00', '2011-01-01 00:00:00')) as total_distance&lt;br /&gt;
 from gps.uva_device_limited&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The GROUP BY clause in SQL can be used to count the total number of measurements for each device :&lt;br /&gt;
&lt;br /&gt;
 select device_info_serial, count(*) &lt;br /&gt;
 from gps.uva_tracking&lt;br /&gt;
 group by device_info_serial; &lt;br /&gt;
&lt;br /&gt;
and for limited users :&lt;br /&gt;
&lt;br /&gt;
 select device_info_serial, count(*) &lt;br /&gt;
 from gps.uva_tracking_limited&lt;br /&gt;
 group by device_info_serial; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to count the number of measurements with valid GPS fixes you can add a where clause :&lt;br /&gt;
  &lt;br /&gt;
 select device_info_serial, count(*) &lt;br /&gt;
 from gps.uva_tracking &lt;br /&gt;
 where latitude is not null &lt;br /&gt;
 group by device_info_serial;&lt;br /&gt;
&lt;br /&gt;
If you to see want both the count of valid and invalid GPS fixes per device you can do something like :&lt;br /&gt;
&lt;br /&gt;
  select device_info_serial, latitude is not null as valid, count(*) &lt;br /&gt;
  from gps.uva_tracking &lt;br /&gt;
  group by device_info_serial, valid &lt;br /&gt;
  order by device_info_serial, valid;&lt;br /&gt;
&lt;br /&gt;
and for limited users: &lt;br /&gt;
&lt;br /&gt;
  select device_info_serial, latitude is not null as valid, count(*) &lt;br /&gt;
  from gps.uva_tracking_limited &lt;br /&gt;
  group by device_info_serial, valid &lt;br /&gt;
  order by device_info_serial, valid;&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=Useful_Queries&amp;diff=337</id>
		<title>Useful Queries</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=Useful_Queries&amp;diff=337"/>
				<updated>2010-09-27T09:43:59Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* Useful Queries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
A query to determine the total distance a bird has flown for a time period is : &lt;br /&gt;
&lt;br /&gt;
 select sum(distance)/1000 as total_distance&lt;br /&gt;
 from gps.get_uvagps_track_speed('''&amp;lt;ID&amp;gt;''');&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
 select sum(distance)/1000 as total_distance&lt;br /&gt;
 from gps.get_uvagps_track_speed('''&amp;lt;ID&amp;gt;''', '2010-01-01 00:00:00', '2011-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to do this for all ID's at the same time you can do something like :&lt;br /&gt;
&lt;br /&gt;
 select device_info_serial,  (select sum(distance)/1000&lt;br /&gt;
   from gps.get_uvagps_track_speed(device_info_serial, '2010-01-01 00:00:00', '2011-01-01 00:00:00')) as total_distance&lt;br /&gt;
 from gps.uva_device&lt;br /&gt;
&lt;br /&gt;
For limited users :&lt;br /&gt;
&lt;br /&gt;
 select device_info_serial,  (select sum(distance)/1000&lt;br /&gt;
   from gps.get_uvagps_track_speed(device_info_serial, '2010-01-01 00:00:00', '2011-01-01 00:00:00')) as total_distance&lt;br /&gt;
 from gps.uva_device_limited&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The GROUP BY clause in SQL can be used to count the total number of measurements for each device :&lt;br /&gt;
&lt;br /&gt;
 select device_info_serial, count(*) &lt;br /&gt;
 from gps.uva_tracking&lt;br /&gt;
 group by device_info_serial; &lt;br /&gt;
&lt;br /&gt;
and for limited users :&lt;br /&gt;
&lt;br /&gt;
 select device_info_serial, count(*) &lt;br /&gt;
 from gps.uva_tracking_limited&lt;br /&gt;
 group by device_info_serial; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to count the number of measurements with valid GPS fixes you can add a where clause :&lt;br /&gt;
  &lt;br /&gt;
 select device_info_serial, count(*) &lt;br /&gt;
 from gps.uva_tracking &lt;br /&gt;
 where latitude is not null &lt;br /&gt;
 group by device_info_serial;&lt;br /&gt;
&lt;br /&gt;
If you to see want both the count of valid and invalid GPS fixes per device you can do something like :&lt;br /&gt;
&lt;br /&gt;
  select device_info_serial, latitude is not null as valid, count(*) &lt;br /&gt;
  from gps.uva_tracking &lt;br /&gt;
  group by device_info_serial, valid &lt;br /&gt;
  order by device_info_serial, valid;&lt;br /&gt;
&lt;br /&gt;
and for limited users: &lt;br /&gt;
&lt;br /&gt;
  select device_info_serial, latitude is not null as valid, count(*) &lt;br /&gt;
  from gps.uva_tracking_limited &lt;br /&gt;
  group by device_info_serial, valid &lt;br /&gt;
  order by device_info_serial, valid;&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=Useful_Queries&amp;diff=336</id>
		<title>Useful Queries</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=Useful_Queries&amp;diff=336"/>
				<updated>2010-09-27T09:41:58Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* Useful Queries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Useful Queries = &lt;br /&gt;
&lt;br /&gt;
A query to determine the total distance a bird has flown for a time period is : &lt;br /&gt;
&lt;br /&gt;
 select sum(distance)/1000 as total_distance&lt;br /&gt;
 from gps.get_uvagps_track_speed('''&amp;lt;ID&amp;gt;''');&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
 select sum(distance)/1000 as total_distance&lt;br /&gt;
 from gps.get_uvagps_track_speed('''&amp;lt;ID&amp;gt;''', '2010-01-01 00:00:00', '2011-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to do this for all ID's at the same time you can do something like :&lt;br /&gt;
&lt;br /&gt;
 select device_info_serial,  (select sum(distance)/1000&lt;br /&gt;
   from gps.get_uvagps_track_speed(device_info_serial, '2010-01-01 00:00:00', '2011-01-01 00:00:00')) as total_distance&lt;br /&gt;
 from gps.uva_device(_limited)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The GROUP BY clause in SQL can be used to count the total number of measurements for each device :&lt;br /&gt;
&lt;br /&gt;
 select device_info_serial, count(*) &lt;br /&gt;
 from gps.uva_tracking(_limited) &lt;br /&gt;
 group by device_info_serial; &lt;br /&gt;
&lt;br /&gt;
If you want to count the number of measurements with valid GPS fixes you can add a where clause :&lt;br /&gt;
  &lt;br /&gt;
 select device_info_serial, count(*) &lt;br /&gt;
 from gps.uva_tracking &lt;br /&gt;
 where latitude is not null &lt;br /&gt;
 group by device_info_serial;&lt;br /&gt;
&lt;br /&gt;
If you to see want both the count of valid and invalid GPS fixes per device you can do something like :&lt;br /&gt;
&lt;br /&gt;
  select device_info_serial, latitude is not null as valid, count(*) &lt;br /&gt;
  from gps.uva_tracking &lt;br /&gt;
  group by device_info_serial, valid &lt;br /&gt;
  order by device_info_serial, valid;&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=Useful_Queries&amp;diff=335</id>
		<title>Useful Queries</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=Useful_Queries&amp;diff=335"/>
				<updated>2010-09-27T09:41:45Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* Useful Queries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Useful Queries = &lt;br /&gt;
&lt;br /&gt;
A query to determine the total distance a bird has flown for a time period is : &lt;br /&gt;
&lt;br /&gt;
 select sum(distance)/1000 as total_distance&lt;br /&gt;
 from gps.get_uvagps_track_speed('''&amp;lt;ID&amp;gt;''');&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
 select sum(distance)/1000 as total_distance&lt;br /&gt;
 from gps.get_uvagps_track_speed('''&amp;lt;ID&amp;gt;''', '2010-01-01 00:00:00', '2011-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to do this for all ID's at the same time you can do something like :&lt;br /&gt;
&lt;br /&gt;
 select device_info_serial,  (select sum(distance)/1000&lt;br /&gt;
   from gps.get_uvagps_track_speed(device_info_serial, '2010-01-01 00:00:00', '2011-01-01 00:00:00')) as total_distance&lt;br /&gt;
 from gps.uva_device(_limited)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The GROUP BY clause in SQL can be used to count the total number of measurements for each device :&lt;br /&gt;
&lt;br /&gt;
 select device_info_serial, count(*) &lt;br /&gt;
 from gps.uva_tracking(_limited) &lt;br /&gt;
 group by device_info_serial; &lt;br /&gt;
&lt;br /&gt;
If you want to count the number of measurements with valid GPS fixes you can add a where clause :&lt;br /&gt;
  &lt;br /&gt;
 select device_info_serial, count(*) &lt;br /&gt;
 from gps.uva_tracking &lt;br /&gt;
 where latitude is not null &lt;br /&gt;
 group by device_info_serial;&lt;br /&gt;
&lt;br /&gt;
If you to see want both the count of valid and invalid GPS fixes per device you can do something like :&lt;br /&gt;
&lt;br /&gt;
  select device_info_serial, latitude is not null as valid, count(*) &lt;br /&gt;
  from gps.uva_tracking &lt;br /&gt;
  group by device_info_serial, valid &lt;br /&gt;
  order by device_info_serial, valid;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ik zal dit in de WIKI zetten .&lt;br /&gt;
&lt;br /&gt;
Met vriendelijke groet,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Bart Heupers&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=Usage&amp;diff=334</id>
		<title>Usage</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=Usage&amp;diff=334"/>
				<updated>2010-09-27T09:32:55Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* Database Issues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General == &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Database Issues == &lt;br /&gt;
&lt;br /&gt;
* [[ Connecting to the Flysafe database ]]&lt;br /&gt;
&lt;br /&gt;
* [[ Useful Queries ]]&lt;br /&gt;
&lt;br /&gt;
== Website Issues ==&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=Useful_Queries&amp;diff=333</id>
		<title>Useful Queries</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=Useful_Queries&amp;diff=333"/>
				<updated>2010-09-27T09:32:22Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: Created page with &amp;quot;= Useful Queries =    Judy had al een query om de totale afstand te bepalen voor een ID. Dat was :  select sum(distance)/1000 as total_distance from gps.get_uvagps_track_speed(35...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Useful Queries = &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Judy had al een query om de totale afstand te bepalen voor een ID. Dat was :&lt;br /&gt;
&lt;br /&gt;
select sum(distance)/1000 as total_distance&lt;br /&gt;
from gps.get_uvagps_track_speed(355);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Als je dat voor alle ID’s tegelijk wilt doen krijg je bijvoorbeeld iets van : &lt;br /&gt;
&lt;br /&gt;
select device_info_serial,  (select sum(distance)/1000&lt;br /&gt;
   from gps.get_uvagps_track_speed(device_info_serial)) as total_distance&lt;br /&gt;
from gps.uva_device&lt;br /&gt;
&lt;br /&gt;
dat duurt even.&lt;br /&gt;
&lt;br /&gt;
Ik kan me voorstellen dat je  dat alleen voor een  bepaalde tijdsperiode wilt zien. Dan heb je bijvoorbeeld :&lt;br /&gt;
&lt;br /&gt;
select device_info_serial,  (select sum(distance)/1000&lt;br /&gt;
   from gps.get_uvagps_track_speed(device_info_serial, '2010-01-01 00:00:00', '2011-01-01 00:00:00')) as total_distance&lt;br /&gt;
from gps.uva_device&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2)&lt;br /&gt;
&lt;br /&gt;
In SQL heb je de GROUP BY clause, die het mogelijk maakt om aggregaties zoals som, aantal, gemiddelde, te groeperen volgens bepaalde criteria zoals ID &lt;br /&gt;
&lt;br /&gt;
Het totaal aantal positiemetingen per ID is dan :&lt;br /&gt;
&lt;br /&gt;
select device_info_serial, count(*) from gps.uva_tracking group by device_info_serial;&lt;br /&gt;
&lt;br /&gt;
Als je alleen de valide metingen met gps fix wilt hebben voeg je nog een conditie toe waar de latitude niet null is &lt;br /&gt;
&lt;br /&gt;
select device_info_serial, count(*) from gps.uva_tracking where latitude is not null group by device_info_serial;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Een als je zowel het aantal meteingen  met gps fix als zonder wilt zien per device  kun je iets doen als :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
select device_info_serial, latitude is not null as valid, count(*) from gps.uva_tracking group by device_info_serial, valid order by device_info_serial, valid;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ik zal dit in de WIKI zetten .&lt;br /&gt;
&lt;br /&gt;
Met vriendelijke groet,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Bart Heupers&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=ToDo&amp;diff=329</id>
		<title>ToDo</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=ToDo&amp;diff=329"/>
				<updated>2010-09-15T15:37:38Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* ToDo List */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ToDo List == &lt;br /&gt;
&lt;br /&gt;
* Make a readonly copy of Flysafe Wiki on public server (september 2010) &lt;br /&gt;
 &lt;br /&gt;
* Improve UvA GPS parser to log errors such as CRC8 in database (september 2010) &lt;br /&gt;
&lt;br /&gt;
* Implement service to create graphs for UvAGPS devices according to Willem's Matlab scripts  ( october 2010, waiting for matlab scripts )&lt;br /&gt;
&lt;br /&gt;
* Import UvAGPS log files via standard storage facility ( ??) &lt;br /&gt;
&lt;br /&gt;
* Implement generate KML service for for UvAGPS on public server (october 2010) &lt;br /&gt;
&lt;br /&gt;
* Define and implement service to flag invalid GPS tracks  (november 2010)&lt;br /&gt;
&lt;br /&gt;
* Add accelerometer calibration factors to uva_device (september 2010)&lt;br /&gt;
&lt;br /&gt;
* Import UvAGPS metadata. (When received after &lt;br /&gt;
&lt;br /&gt;
*&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=ToDo&amp;diff=328</id>
		<title>ToDo</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=ToDo&amp;diff=328"/>
				<updated>2010-09-15T15:33:25Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* ToDo List */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ToDo List == &lt;br /&gt;
&lt;br /&gt;
* Make a readonly copy of Flysafe Wiki on public server (september 2010) &lt;br /&gt;
 &lt;br /&gt;
* Improve UvA GPS parser to log errors such as CRC8 in database (september 2010) &lt;br /&gt;
&lt;br /&gt;
* Implement service to create  graphs for UvAGPS devices according to Willem's Matlab scripts  ( october 2010, waiting for matlab scripts )&lt;br /&gt;
&lt;br /&gt;
* Import UvAGPS log files via standard storage facility ( ??) &lt;br /&gt;
&lt;br /&gt;
* Implement generate KML service for for UvAGPS on public server (october 2010) &lt;br /&gt;
&lt;br /&gt;
* Define and implement service to flag invalid GPS tracks  (november 2010)&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=ToDo&amp;diff=327</id>
		<title>ToDo</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=ToDo&amp;diff=327"/>
				<updated>2010-09-15T15:13:31Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ToDo List == &lt;br /&gt;
&lt;br /&gt;
* Make a readonly copy of Flysafe Wiki on public server &lt;br /&gt;
 &lt;br /&gt;
* Improve UvA GPS parser to log errors such as CRC8 in database&lt;br /&gt;
&lt;br /&gt;
* Implement service to create  graphs for UvAGPS devices according to Willem's Matlab scripts &lt;br /&gt;
&lt;br /&gt;
* Import UvAGPS log files via standard storage facility&lt;br /&gt;
&lt;br /&gt;
*&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=File:MediaWikiRefCard.pdf&amp;diff=326</id>
		<title>File:MediaWikiRefCard.pdf</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=File:MediaWikiRefCard.pdf&amp;diff=326"/>
				<updated>2010-09-15T15:12:41Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=ToDo&amp;diff=325</id>
		<title>ToDo</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=ToDo&amp;diff=325"/>
				<updated>2010-09-15T15:09:28Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: New page: == ToDo List ==    * Make a readonly copy of Flysafe Wiki on public server     * Improve UvA GPS parser to log errors such as CRC8 in database   * Implement service to create  graphs for U...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ToDo List == &lt;br /&gt;
&lt;br /&gt;
 * Make a readonly copy of Flysafe Wiki on public server &lt;br /&gt;
 &lt;br /&gt;
 * Improve UvA GPS parser to log errors such as CRC8 in database&lt;br /&gt;
&lt;br /&gt;
 * Implement service to create  graphs for UvAGPS devices according to Willem's Matlab scripts &lt;br /&gt;
&lt;br /&gt;
 * Import UvAGPS log files via standard storage facility&lt;br /&gt;
&lt;br /&gt;
 *&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=E-Ecology_Documentation_and_Guidance&amp;diff=324</id>
		<title>E-Ecology Documentation and Guidance</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=E-Ecology_Documentation_and_Guidance&amp;diff=324"/>
				<updated>2010-09-15T15:05:16Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[ Usage ]] &lt;br /&gt;
&lt;br /&gt;
[[ Flysafe Data Model ]]&lt;br /&gt;
&lt;br /&gt;
[[ Services ]]&lt;br /&gt;
&lt;br /&gt;
[[ ToDo ]]&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
&lt;br /&gt;
New to MediaWiki? Print out this [[Media:MediaWikiRefCard.pdf|quick reference card]], or find out more at the [[mediawikiwiki:Main Page|MetaWiki website]].&lt;br /&gt;
&lt;br /&gt;
[[MediaWiki References]]&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=Argos_Data_Model&amp;diff=323</id>
		<title>Argos Data Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=Argos_Data_Model&amp;diff=323"/>
				<updated>2010-03-01T12:32:26Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* get_argosgps_track_distance_direction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GPS Data Model == &lt;br /&gt;
&lt;br /&gt;
Last updated January 5, 2010 Bart Heupers - [[ UvAGPS ]] moved to special page&lt;br /&gt;
&lt;br /&gt;
Updated January 22, 2008 Judy Shamoun-Baranes &lt;br /&gt;
&lt;br /&gt;
'''FLYSAFE TRACKING DATABASE'''&lt;br /&gt;
&lt;br /&gt;
The tracking database will include data from several species. Some species are trapped and then monitored during the breeding season while others are trapped during the winter season. Information is collected on each tracked bird, including biometric measurements. These measurements may be collected more than once. During the breeding season information is also collected about the gull breeding colony itself, location of nests, state of breeding (number of eggs and juveniles) and then juveniles themselves are marked and measured (although not tracked).&lt;br /&gt;
&lt;br /&gt;
In addition, PTTs are often tested before they are actually placed on the birds. This information is also important during analysis and particularly to establish accuracy of data. This data should also be stored in the database. Therefore it is important that this information is stored properly in the database&lt;br /&gt;
&lt;br /&gt;
Units and descriptions should be filled in for all measurements&lt;br /&gt;
&lt;br /&gt;
One way of looking at this structure is considering 3 categories of tables: &lt;br /&gt;
&lt;br /&gt;
# '''lookup tables''' (information stored once) &lt;br /&gt;
# '''session tables''' (stored occasionally) &lt;br /&gt;
# '''observations''' – highest frequency of information.&lt;br /&gt;
&lt;br /&gt;
Primary keys are noted by bold italic text. Foreign keys are noted by italic text in the Field column.&lt;br /&gt;
&lt;br /&gt;
Microwave, will under no circumstances provide information about their checksum calculations. If feasible, SARA will duplicate the procedure and include a flag in the representing the microwave filtered data.&lt;br /&gt;
	&lt;br /&gt;
'''TECHNICAL INFORMATION FROM TAGS'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DEVICE_INFO ==&lt;br /&gt;
&lt;br /&gt;
Table including technical information about tag hardware. &lt;br /&gt;
	&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4||PK||NOT NULL||serial number of PTT provided by Argos and used for communication with Argos satellite&lt;br /&gt;
|-&lt;br /&gt;
|serial ||int4||||NOT NULL||serial number of tag from manufacturer&lt;br /&gt;
|-&lt;br /&gt;
|weight ||int4||||NOT NULL||Unit = grams&lt;br /&gt;
|-&lt;br /&gt;
|type ||text||||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|manufacturer ||text||||||Device manufacturer&lt;br /&gt;
|-&lt;br /&gt;
|hexadecimal_id||text||||||Hexadecimal address, unique for each tag&lt;br /&gt;
|-&lt;br /&gt;
|PAN_id||Text||||||Personal area network ground based tags communicates with&lt;br /&gt;
|-&lt;br /&gt;
|Base_station_id||Int4||||||base station ground based tag communicates with&lt;br /&gt;
|-&lt;br /&gt;
|Remarks||text||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== TRACK_SESSION == &lt;br /&gt;
&lt;br /&gt;
This table includes information about each measurement session and enables inclusion of data from new species and also from the test phase of different tags&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''id '''||int4 ||PK||NOT NULL||unique ID for each usage of a PTT so test and bird with same ptt_id are two separate IDs/indexes&lt;br /&gt;
|-&lt;br /&gt;
|''pttid''||int4 ||FK||NOT NULL||Link to DEVICE_INFO table&lt;br /&gt;
|-&lt;br /&gt;
|''ring_number''||text ||FK||||link to individual table – tests do not have a ring_number&lt;br /&gt;
|-&lt;br /&gt;
|start_date ||timestamptz||||||Date/time (Local) when tracking begins&lt;br /&gt;
|-&lt;br /&gt;
|start_latitude ||float8||||NOT NULL||latitude where tracking begins, unit = dec degress&lt;br /&gt;
|-&lt;br /&gt;
|start_longitude ||float8||||NOT NULL||longitude where tracking begins, unit = dec degrees&lt;br /&gt;
|-&lt;br /&gt;
|start_altitude||Float8||||||Unit = m, include when known, important for testing&lt;br /&gt;
|-&lt;br /&gt;
|end_date||timestamptz||||||End of session if known&lt;br /&gt;
|-&lt;br /&gt;
|time_window ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|time_steps ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|location ||geometry||||||postgreSQL geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== GPS_TRACKING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from GPS sensors on PTT/GPS tags&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|'''date_time'''||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|speed ||float8||||||m/s&lt;br /&gt;
|-&lt;br /&gt;
|course||float8||||||degrees&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||float8||||||m&lt;br /&gt;
|-&lt;br /&gt;
|alt_status||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|quality||text||||||Quality information from sensor&lt;br /&gt;
|-&lt;br /&gt;
|user_QC||text||||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|parser_QC||text||||||Data flagged as unacceptable by Microwave parser&lt;br /&gt;
|-&lt;br /&gt;
|location||geometry||||||postgreSQL geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note : &lt;br /&gt;
&lt;br /&gt;
The parser_QC value can be 1, 2,3,4, 99, or 100. If it 1 the data is OK. If it is 2 or 3 or 4 some form of error correction has been &lt;br /&gt;
performed by the Microwave parser. And if it is 100 no error correction was possible. For reliable results it is advised only to use &lt;br /&gt;
records with parser_QC values of 1&lt;br /&gt;
&lt;br /&gt;
== ARGOS_TRACKING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from Argos sensors&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type '''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4 ||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|'''date_time'''||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|fix ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|latitude1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|latitude2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|msgcount ||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|frequency ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|average_ti ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|satellite ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|max_str ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|location1 ||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|location2 ||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== PTT_ENGINEERING_DATA ==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|'''tx_date_time'''||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|'''satellite_id'''||text ||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|ptt_date_time ||timestamp||||||GMT&lt;br /&gt;
|-&lt;br /&gt;
|activity||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|tx_count||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|temperature||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|battery_voltage||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|gps_fix_time||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|satellite_count||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|hours_reset||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|hours_since_gps_fix||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|mortality_gt||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|seasonal_gt||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|shunt||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In addition the views GPS_TRACKING_SESSION, ARGOS_TRACKING_SESSION, PTT_ENGINEERING_SESSION are which adds the correct track_session.id to the GPS_TRACKING_DATA, ARGOS_TRACKING_DATA and PTT_ENGINEERING_DATA table data.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
'''BIOLOGICAL INFORMATION'''&lt;br /&gt;
&lt;br /&gt;
== INDIVIDUAL ==&lt;br /&gt;
&lt;br /&gt;
Table includes information used to identify an individual&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field	'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ring_number'''||text||PK||NOT NULL||metal ring number&lt;br /&gt;
|-&lt;br /&gt;
|Id||int4||PK||NOT NULL ||auto-insert, unique ID for each individual organism &lt;br /&gt;
|-&lt;br /&gt;
|''NEST_INFO_id''||int4||FK||||link to NEST_INFO, not all specimens are linked to a nest&lt;br /&gt;
|-&lt;br /&gt;
|nest_certainty||int4||||||1 = certain, 0 = not completely certain&lt;br /&gt;
|-&lt;br /&gt;
|species_certainty||int4||||||1 = certain, 0 = not completely certain&lt;br /&gt;
|-&lt;br /&gt;
|ring_number||text||||NOT NULL||metal ring number&lt;br /&gt;
|-&lt;br /&gt;
|color_code||text||||||code for color ring without punctuation&lt;br /&gt;
|-&lt;br /&gt;
|species||text||||NOT NULL||Scientific name (at least genus)&lt;br /&gt;
|-&lt;br /&gt;
|sex||text||||||update if or when known&lt;br /&gt;
|-&lt;br /&gt;
|''FATE_CODEE_id''||textInt4||FK||||Link to FATE_CODE&lt;br /&gt;
|-&lt;br /&gt;
|Remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== FATE_code == &lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|Field	||Type||Key||Constraints||Comments&lt;br /&gt;
|-&lt;br /&gt;
|'''Id'''||'''Int4'''||'''PK'''||||'''auto-insert'''&lt;br /&gt;
|-&lt;br /&gt;
|code ||int4||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|description||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MEASUREMENT ==&lt;br /&gt;
&lt;br /&gt;
Metadata Provided by Sovon is needed to describe how these measurements are taken.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field	'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''id '''||int4||PK||NOT NULL||auto-insert, unique ID for each observation&lt;br /&gt;
|-&lt;br /&gt;
|''ring_number''||text||FK||||link to individual&lt;br /&gt;
|-&lt;br /&gt;
|catch_datetime ||timestamp||||||Local time&lt;br /&gt;
|-&lt;br /&gt;
|release_datetime||timestamp||||||Local time&lt;br /&gt;
|-&lt;br /&gt;
|mass ||float8||||||grams&lt;br /&gt;
|-&lt;br /&gt;
|age ||text||||||AD = adult, JUV = juvenile&lt;br /&gt;
|-&lt;br /&gt;
|wing_length ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_length1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_length2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_height1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_height2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|tarsus_length  ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|total_head||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|observer ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|remarks||text||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Catch_datetime &amp;amp; release_datetime===&lt;br /&gt;
&lt;br /&gt;
During ringing of juveniles only the date was recorded and not the time.  Birds were all released the same day.  Ringing and measuring small chicks in the nest took about 2-5 minutes. Colour ringing and sampling of the larger chicks (from 4 July onwards) took about half an hour (rounding up several chicks and banding, sampling and releasing them together). To avoid leaving fields blank, a standard catch time was noted at 12:00 and a release time of 12:15 before July 4 and 12:30 from July 4 and onwards. ''''comments by Kees Oosterbeek''''&lt;br /&gt;
&lt;br /&gt;
== NEST_INFO ==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|''id''||int4||PK ||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|Species||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||NOT NULL||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||NOT NULL||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|year||Int4||||||Year of breeding season&lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;location&amp;quot;||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|Remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== NEST_OBSERVATION ==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||''''''Comments''''''&lt;br /&gt;
|-&lt;br /&gt;
|''id''||''int4''||PK||NOT NULL ||Auto-insert, unique ID for each observation&lt;br /&gt;
|-&lt;br /&gt;
|''NEST_INFO_id''||''int4''||FK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date||timestamptz ||||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|number_egg||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|number_young||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|pipping||text||||||Activity in egg (peeping or signs of hatching)&lt;br /&gt;
|-&lt;br /&gt;
|attended||text||||||Activity on nest&lt;br /&gt;
|-&lt;br /&gt;
|observer||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Comments:=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Graphical Data Model == &lt;br /&gt;
&lt;br /&gt;
[[Image:Gps_datamodel.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Argos GPS functions = &lt;br /&gt;
&lt;br /&gt;
== get_argosgps_track_speed ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters), time-interval, speed (meter/second) and heading (degrees) for a series of subsequent tracking entries with specific device_info_serial. &lt;br /&gt;
For the first entry in the sequence these values will always be missing because they are computed  as the difference between subsequent rows. &lt;br /&gt;
&lt;br /&gt;
Usage examples :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_argosgps_track_speed(41745, '2008-01-01 00:00:00', '2010-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_speed(41745);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and heading are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. &lt;br /&gt;
The heading is the initial heading. Because PostGIS does not calculate the heading we don't use PostGIS here.&lt;br /&gt;
&lt;br /&gt;
== get_argosgps_track_distance ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) for Argos GPS tracks to arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance(41745, 53.23348333,4.91656)&lt;br /&gt;
&lt;br /&gt;
-- Get distances from nest&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance(41745, (&lt;br /&gt;
  select n.location from gps.nest_info n, gps.track_session s, gps.individual i &lt;br /&gt;
    where i.nest_info_id = n.id &lt;br /&gt;
      and i.ring_number = s.ring_number &lt;br /&gt;
      and s.ptt_id = 41745 limit 1 ))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the distance is calculated with the PostGIS distance_sphere function which uses spherical correction.&lt;br /&gt;
&lt;br /&gt;
== get_argosgps_track_distance_direction ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) and direction (degrees) for Argos GPS tracks from arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance_direction(41745, 53.23348333,4.91656)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- Get distances from nest&lt;br /&gt;
create temporary table nest as&lt;br /&gt;
(   select  n.latitude, n.longitude from gps.nest_info n, gps.track_session s, gps.individual i &lt;br /&gt;
    where i.nest_info_id = n.id &lt;br /&gt;
      and i.ring_number = s.ring_number &lt;br /&gt;
      and s.ptt_id = 41745 limit 1 );&lt;br /&gt;
      &lt;br /&gt;
select * from gps.get_argosgps_track_distance_direction(41745, (select latitude from nest), (select longitude from nest));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Distances and direction are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. The direction is the direction from the given point.&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=Argos_Data_Model&amp;diff=322</id>
		<title>Argos Data Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=Argos_Data_Model&amp;diff=322"/>
				<updated>2010-03-01T12:31:37Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* get_argosgps_track_distance_direction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GPS Data Model == &lt;br /&gt;
&lt;br /&gt;
Last updated January 5, 2010 Bart Heupers - [[ UvAGPS ]] moved to special page&lt;br /&gt;
&lt;br /&gt;
Updated January 22, 2008 Judy Shamoun-Baranes &lt;br /&gt;
&lt;br /&gt;
'''FLYSAFE TRACKING DATABASE'''&lt;br /&gt;
&lt;br /&gt;
The tracking database will include data from several species. Some species are trapped and then monitored during the breeding season while others are trapped during the winter season. Information is collected on each tracked bird, including biometric measurements. These measurements may be collected more than once. During the breeding season information is also collected about the gull breeding colony itself, location of nests, state of breeding (number of eggs and juveniles) and then juveniles themselves are marked and measured (although not tracked).&lt;br /&gt;
&lt;br /&gt;
In addition, PTTs are often tested before they are actually placed on the birds. This information is also important during analysis and particularly to establish accuracy of data. This data should also be stored in the database. Therefore it is important that this information is stored properly in the database&lt;br /&gt;
&lt;br /&gt;
Units and descriptions should be filled in for all measurements&lt;br /&gt;
&lt;br /&gt;
One way of looking at this structure is considering 3 categories of tables: &lt;br /&gt;
&lt;br /&gt;
# '''lookup tables''' (information stored once) &lt;br /&gt;
# '''session tables''' (stored occasionally) &lt;br /&gt;
# '''observations''' – highest frequency of information.&lt;br /&gt;
&lt;br /&gt;
Primary keys are noted by bold italic text. Foreign keys are noted by italic text in the Field column.&lt;br /&gt;
&lt;br /&gt;
Microwave, will under no circumstances provide information about their checksum calculations. If feasible, SARA will duplicate the procedure and include a flag in the representing the microwave filtered data.&lt;br /&gt;
	&lt;br /&gt;
'''TECHNICAL INFORMATION FROM TAGS'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DEVICE_INFO ==&lt;br /&gt;
&lt;br /&gt;
Table including technical information about tag hardware. &lt;br /&gt;
	&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4||PK||NOT NULL||serial number of PTT provided by Argos and used for communication with Argos satellite&lt;br /&gt;
|-&lt;br /&gt;
|serial ||int4||||NOT NULL||serial number of tag from manufacturer&lt;br /&gt;
|-&lt;br /&gt;
|weight ||int4||||NOT NULL||Unit = grams&lt;br /&gt;
|-&lt;br /&gt;
|type ||text||||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|manufacturer ||text||||||Device manufacturer&lt;br /&gt;
|-&lt;br /&gt;
|hexadecimal_id||text||||||Hexadecimal address, unique for each tag&lt;br /&gt;
|-&lt;br /&gt;
|PAN_id||Text||||||Personal area network ground based tags communicates with&lt;br /&gt;
|-&lt;br /&gt;
|Base_station_id||Int4||||||base station ground based tag communicates with&lt;br /&gt;
|-&lt;br /&gt;
|Remarks||text||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== TRACK_SESSION == &lt;br /&gt;
&lt;br /&gt;
This table includes information about each measurement session and enables inclusion of data from new species and also from the test phase of different tags&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''id '''||int4 ||PK||NOT NULL||unique ID for each usage of a PTT so test and bird with same ptt_id are two separate IDs/indexes&lt;br /&gt;
|-&lt;br /&gt;
|''pttid''||int4 ||FK||NOT NULL||Link to DEVICE_INFO table&lt;br /&gt;
|-&lt;br /&gt;
|''ring_number''||text ||FK||||link to individual table – tests do not have a ring_number&lt;br /&gt;
|-&lt;br /&gt;
|start_date ||timestamptz||||||Date/time (Local) when tracking begins&lt;br /&gt;
|-&lt;br /&gt;
|start_latitude ||float8||||NOT NULL||latitude where tracking begins, unit = dec degress&lt;br /&gt;
|-&lt;br /&gt;
|start_longitude ||float8||||NOT NULL||longitude where tracking begins, unit = dec degrees&lt;br /&gt;
|-&lt;br /&gt;
|start_altitude||Float8||||||Unit = m, include when known, important for testing&lt;br /&gt;
|-&lt;br /&gt;
|end_date||timestamptz||||||End of session if known&lt;br /&gt;
|-&lt;br /&gt;
|time_window ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|time_steps ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|location ||geometry||||||postgreSQL geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== GPS_TRACKING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from GPS sensors on PTT/GPS tags&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|'''date_time'''||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|speed ||float8||||||m/s&lt;br /&gt;
|-&lt;br /&gt;
|course||float8||||||degrees&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||float8||||||m&lt;br /&gt;
|-&lt;br /&gt;
|alt_status||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|quality||text||||||Quality information from sensor&lt;br /&gt;
|-&lt;br /&gt;
|user_QC||text||||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|parser_QC||text||||||Data flagged as unacceptable by Microwave parser&lt;br /&gt;
|-&lt;br /&gt;
|location||geometry||||||postgreSQL geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note : &lt;br /&gt;
&lt;br /&gt;
The parser_QC value can be 1, 2,3,4, 99, or 100. If it 1 the data is OK. If it is 2 or 3 or 4 some form of error correction has been &lt;br /&gt;
performed by the Microwave parser. And if it is 100 no error correction was possible. For reliable results it is advised only to use &lt;br /&gt;
records with parser_QC values of 1&lt;br /&gt;
&lt;br /&gt;
== ARGOS_TRACKING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from Argos sensors&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type '''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4 ||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|'''date_time'''||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|fix ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|latitude1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|latitude2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|msgcount ||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|frequency ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|average_ti ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|satellite ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|max_str ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|location1 ||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|location2 ||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== PTT_ENGINEERING_DATA ==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|'''tx_date_time'''||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|'''satellite_id'''||text ||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|ptt_date_time ||timestamp||||||GMT&lt;br /&gt;
|-&lt;br /&gt;
|activity||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|tx_count||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|temperature||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|battery_voltage||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|gps_fix_time||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|satellite_count||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|hours_reset||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|hours_since_gps_fix||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|mortality_gt||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|seasonal_gt||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|shunt||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In addition the views GPS_TRACKING_SESSION, ARGOS_TRACKING_SESSION, PTT_ENGINEERING_SESSION are which adds the correct track_session.id to the GPS_TRACKING_DATA, ARGOS_TRACKING_DATA and PTT_ENGINEERING_DATA table data.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
'''BIOLOGICAL INFORMATION'''&lt;br /&gt;
&lt;br /&gt;
== INDIVIDUAL ==&lt;br /&gt;
&lt;br /&gt;
Table includes information used to identify an individual&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field	'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ring_number'''||text||PK||NOT NULL||metal ring number&lt;br /&gt;
|-&lt;br /&gt;
|Id||int4||PK||NOT NULL ||auto-insert, unique ID for each individual organism &lt;br /&gt;
|-&lt;br /&gt;
|''NEST_INFO_id''||int4||FK||||link to NEST_INFO, not all specimens are linked to a nest&lt;br /&gt;
|-&lt;br /&gt;
|nest_certainty||int4||||||1 = certain, 0 = not completely certain&lt;br /&gt;
|-&lt;br /&gt;
|species_certainty||int4||||||1 = certain, 0 = not completely certain&lt;br /&gt;
|-&lt;br /&gt;
|ring_number||text||||NOT NULL||metal ring number&lt;br /&gt;
|-&lt;br /&gt;
|color_code||text||||||code for color ring without punctuation&lt;br /&gt;
|-&lt;br /&gt;
|species||text||||NOT NULL||Scientific name (at least genus)&lt;br /&gt;
|-&lt;br /&gt;
|sex||text||||||update if or when known&lt;br /&gt;
|-&lt;br /&gt;
|''FATE_CODEE_id''||textInt4||FK||||Link to FATE_CODE&lt;br /&gt;
|-&lt;br /&gt;
|Remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== FATE_code == &lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|Field	||Type||Key||Constraints||Comments&lt;br /&gt;
|-&lt;br /&gt;
|'''Id'''||'''Int4'''||'''PK'''||||'''auto-insert'''&lt;br /&gt;
|-&lt;br /&gt;
|code ||int4||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|description||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MEASUREMENT ==&lt;br /&gt;
&lt;br /&gt;
Metadata Provided by Sovon is needed to describe how these measurements are taken.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field	'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''id '''||int4||PK||NOT NULL||auto-insert, unique ID for each observation&lt;br /&gt;
|-&lt;br /&gt;
|''ring_number''||text||FK||||link to individual&lt;br /&gt;
|-&lt;br /&gt;
|catch_datetime ||timestamp||||||Local time&lt;br /&gt;
|-&lt;br /&gt;
|release_datetime||timestamp||||||Local time&lt;br /&gt;
|-&lt;br /&gt;
|mass ||float8||||||grams&lt;br /&gt;
|-&lt;br /&gt;
|age ||text||||||AD = adult, JUV = juvenile&lt;br /&gt;
|-&lt;br /&gt;
|wing_length ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_length1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_length2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_height1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_height2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|tarsus_length  ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|total_head||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|observer ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|remarks||text||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Catch_datetime &amp;amp; release_datetime===&lt;br /&gt;
&lt;br /&gt;
During ringing of juveniles only the date was recorded and not the time.  Birds were all released the same day.  Ringing and measuring small chicks in the nest took about 2-5 minutes. Colour ringing and sampling of the larger chicks (from 4 July onwards) took about half an hour (rounding up several chicks and banding, sampling and releasing them together). To avoid leaving fields blank, a standard catch time was noted at 12:00 and a release time of 12:15 before July 4 and 12:30 from July 4 and onwards. ''''comments by Kees Oosterbeek''''&lt;br /&gt;
&lt;br /&gt;
== NEST_INFO ==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|''id''||int4||PK ||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|Species||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||NOT NULL||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||NOT NULL||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|year||Int4||||||Year of breeding season&lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;location&amp;quot;||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|Remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== NEST_OBSERVATION ==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||''''''Comments''''''&lt;br /&gt;
|-&lt;br /&gt;
|''id''||''int4''||PK||NOT NULL ||Auto-insert, unique ID for each observation&lt;br /&gt;
|-&lt;br /&gt;
|''NEST_INFO_id''||''int4''||FK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date||timestamptz ||||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|number_egg||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|number_young||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|pipping||text||||||Activity in egg (peeping or signs of hatching)&lt;br /&gt;
|-&lt;br /&gt;
|attended||text||||||Activity on nest&lt;br /&gt;
|-&lt;br /&gt;
|observer||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Comments:=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Graphical Data Model == &lt;br /&gt;
&lt;br /&gt;
[[Image:Gps_datamodel.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Argos GPS functions = &lt;br /&gt;
&lt;br /&gt;
== get_argosgps_track_speed ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters), time-interval, speed (meter/second) and heading (degrees) for a series of subsequent tracking entries with specific device_info_serial. &lt;br /&gt;
For the first entry in the sequence these values will always be missing because they are computed  as the difference between subsequent rows. &lt;br /&gt;
&lt;br /&gt;
Usage examples :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_argosgps_track_speed(41745, '2008-01-01 00:00:00', '2010-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_speed(41745);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and heading are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. &lt;br /&gt;
The heading is the initial heading. Because PostGIS does not calculate the heading we don't use PostGIS here.&lt;br /&gt;
&lt;br /&gt;
== get_argosgps_track_distance ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) for Argos GPS tracks to arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance(41745, 53.23348333,4.91656)&lt;br /&gt;
&lt;br /&gt;
-- Get distances from nest&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance(41745, (&lt;br /&gt;
  select n.location from gps.nest_info n, gps.track_session s, gps.individual i &lt;br /&gt;
    where i.nest_info_id = n.id &lt;br /&gt;
      and i.ring_number = s.ring_number &lt;br /&gt;
      and s.ptt_id = 41745 limit 1 ))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the distance is calculated with the PostGIS distance_sphere function which uses spherical correction.&lt;br /&gt;
&lt;br /&gt;
== get_argosgps_track_distance_direction ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) and direction (degrees) for Argos GPS tracks from arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance_direction(41745, 53.23348333,4.91656)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- Get distances from nest&lt;br /&gt;
create temporary table nest as&lt;br /&gt;
(   select  n.latitude, n.longitude from gps.nest_info n, gps.track_session s, gps.individual i &lt;br /&gt;
    where i.nest_info_id = n.id &lt;br /&gt;
      and i.ring_number = s.ring_number &lt;br /&gt;
      and s.ptt_id = 41745 limit 1 );&lt;br /&gt;
      &lt;br /&gt;
select * from gps.get_argosgps_track_distance(41745, (select latitude from nest), (select longitude from nest));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Distances and direction are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. The direction is the direction from the given point.&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=Argos_Data_Model&amp;diff=321</id>
		<title>Argos Data Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=Argos_Data_Model&amp;diff=321"/>
				<updated>2010-03-01T12:13:27Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* get_argosgps_track_distance_direction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GPS Data Model == &lt;br /&gt;
&lt;br /&gt;
Last updated January 5, 2010 Bart Heupers - [[ UvAGPS ]] moved to special page&lt;br /&gt;
&lt;br /&gt;
Updated January 22, 2008 Judy Shamoun-Baranes &lt;br /&gt;
&lt;br /&gt;
'''FLYSAFE TRACKING DATABASE'''&lt;br /&gt;
&lt;br /&gt;
The tracking database will include data from several species. Some species are trapped and then monitored during the breeding season while others are trapped during the winter season. Information is collected on each tracked bird, including biometric measurements. These measurements may be collected more than once. During the breeding season information is also collected about the gull breeding colony itself, location of nests, state of breeding (number of eggs and juveniles) and then juveniles themselves are marked and measured (although not tracked).&lt;br /&gt;
&lt;br /&gt;
In addition, PTTs are often tested before they are actually placed on the birds. This information is also important during analysis and particularly to establish accuracy of data. This data should also be stored in the database. Therefore it is important that this information is stored properly in the database&lt;br /&gt;
&lt;br /&gt;
Units and descriptions should be filled in for all measurements&lt;br /&gt;
&lt;br /&gt;
One way of looking at this structure is considering 3 categories of tables: &lt;br /&gt;
&lt;br /&gt;
# '''lookup tables''' (information stored once) &lt;br /&gt;
# '''session tables''' (stored occasionally) &lt;br /&gt;
# '''observations''' – highest frequency of information.&lt;br /&gt;
&lt;br /&gt;
Primary keys are noted by bold italic text. Foreign keys are noted by italic text in the Field column.&lt;br /&gt;
&lt;br /&gt;
Microwave, will under no circumstances provide information about their checksum calculations. If feasible, SARA will duplicate the procedure and include a flag in the representing the microwave filtered data.&lt;br /&gt;
	&lt;br /&gt;
'''TECHNICAL INFORMATION FROM TAGS'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DEVICE_INFO ==&lt;br /&gt;
&lt;br /&gt;
Table including technical information about tag hardware. &lt;br /&gt;
	&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4||PK||NOT NULL||serial number of PTT provided by Argos and used for communication with Argos satellite&lt;br /&gt;
|-&lt;br /&gt;
|serial ||int4||||NOT NULL||serial number of tag from manufacturer&lt;br /&gt;
|-&lt;br /&gt;
|weight ||int4||||NOT NULL||Unit = grams&lt;br /&gt;
|-&lt;br /&gt;
|type ||text||||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|manufacturer ||text||||||Device manufacturer&lt;br /&gt;
|-&lt;br /&gt;
|hexadecimal_id||text||||||Hexadecimal address, unique for each tag&lt;br /&gt;
|-&lt;br /&gt;
|PAN_id||Text||||||Personal area network ground based tags communicates with&lt;br /&gt;
|-&lt;br /&gt;
|Base_station_id||Int4||||||base station ground based tag communicates with&lt;br /&gt;
|-&lt;br /&gt;
|Remarks||text||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== TRACK_SESSION == &lt;br /&gt;
&lt;br /&gt;
This table includes information about each measurement session and enables inclusion of data from new species and also from the test phase of different tags&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''id '''||int4 ||PK||NOT NULL||unique ID for each usage of a PTT so test and bird with same ptt_id are two separate IDs/indexes&lt;br /&gt;
|-&lt;br /&gt;
|''pttid''||int4 ||FK||NOT NULL||Link to DEVICE_INFO table&lt;br /&gt;
|-&lt;br /&gt;
|''ring_number''||text ||FK||||link to individual table – tests do not have a ring_number&lt;br /&gt;
|-&lt;br /&gt;
|start_date ||timestamptz||||||Date/time (Local) when tracking begins&lt;br /&gt;
|-&lt;br /&gt;
|start_latitude ||float8||||NOT NULL||latitude where tracking begins, unit = dec degress&lt;br /&gt;
|-&lt;br /&gt;
|start_longitude ||float8||||NOT NULL||longitude where tracking begins, unit = dec degrees&lt;br /&gt;
|-&lt;br /&gt;
|start_altitude||Float8||||||Unit = m, include when known, important for testing&lt;br /&gt;
|-&lt;br /&gt;
|end_date||timestamptz||||||End of session if known&lt;br /&gt;
|-&lt;br /&gt;
|time_window ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|time_steps ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|location ||geometry||||||postgreSQL geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== GPS_TRACKING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from GPS sensors on PTT/GPS tags&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|'''date_time'''||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|speed ||float8||||||m/s&lt;br /&gt;
|-&lt;br /&gt;
|course||float8||||||degrees&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||float8||||||m&lt;br /&gt;
|-&lt;br /&gt;
|alt_status||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|quality||text||||||Quality information from sensor&lt;br /&gt;
|-&lt;br /&gt;
|user_QC||text||||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|parser_QC||text||||||Data flagged as unacceptable by Microwave parser&lt;br /&gt;
|-&lt;br /&gt;
|location||geometry||||||postgreSQL geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note : &lt;br /&gt;
&lt;br /&gt;
The parser_QC value can be 1, 2,3,4, 99, or 100. If it 1 the data is OK. If it is 2 or 3 or 4 some form of error correction has been &lt;br /&gt;
performed by the Microwave parser. And if it is 100 no error correction was possible. For reliable results it is advised only to use &lt;br /&gt;
records with parser_QC values of 1&lt;br /&gt;
&lt;br /&gt;
== ARGOS_TRACKING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from Argos sensors&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type '''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4 ||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|'''date_time'''||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|fix ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|latitude1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|latitude2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|msgcount ||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|frequency ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|average_ti ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|satellite ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|max_str ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|location1 ||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|location2 ||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== PTT_ENGINEERING_DATA ==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|'''tx_date_time'''||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|'''satellite_id'''||text ||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|ptt_date_time ||timestamp||||||GMT&lt;br /&gt;
|-&lt;br /&gt;
|activity||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|tx_count||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|temperature||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|battery_voltage||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|gps_fix_time||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|satellite_count||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|hours_reset||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|hours_since_gps_fix||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|mortality_gt||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|seasonal_gt||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|shunt||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In addition the views GPS_TRACKING_SESSION, ARGOS_TRACKING_SESSION, PTT_ENGINEERING_SESSION are which adds the correct track_session.id to the GPS_TRACKING_DATA, ARGOS_TRACKING_DATA and PTT_ENGINEERING_DATA table data.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
'''BIOLOGICAL INFORMATION'''&lt;br /&gt;
&lt;br /&gt;
== INDIVIDUAL ==&lt;br /&gt;
&lt;br /&gt;
Table includes information used to identify an individual&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field	'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ring_number'''||text||PK||NOT NULL||metal ring number&lt;br /&gt;
|-&lt;br /&gt;
|Id||int4||PK||NOT NULL ||auto-insert, unique ID for each individual organism &lt;br /&gt;
|-&lt;br /&gt;
|''NEST_INFO_id''||int4||FK||||link to NEST_INFO, not all specimens are linked to a nest&lt;br /&gt;
|-&lt;br /&gt;
|nest_certainty||int4||||||1 = certain, 0 = not completely certain&lt;br /&gt;
|-&lt;br /&gt;
|species_certainty||int4||||||1 = certain, 0 = not completely certain&lt;br /&gt;
|-&lt;br /&gt;
|ring_number||text||||NOT NULL||metal ring number&lt;br /&gt;
|-&lt;br /&gt;
|color_code||text||||||code for color ring without punctuation&lt;br /&gt;
|-&lt;br /&gt;
|species||text||||NOT NULL||Scientific name (at least genus)&lt;br /&gt;
|-&lt;br /&gt;
|sex||text||||||update if or when known&lt;br /&gt;
|-&lt;br /&gt;
|''FATE_CODEE_id''||textInt4||FK||||Link to FATE_CODE&lt;br /&gt;
|-&lt;br /&gt;
|Remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== FATE_code == &lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|Field	||Type||Key||Constraints||Comments&lt;br /&gt;
|-&lt;br /&gt;
|'''Id'''||'''Int4'''||'''PK'''||||'''auto-insert'''&lt;br /&gt;
|-&lt;br /&gt;
|code ||int4||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|description||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MEASUREMENT ==&lt;br /&gt;
&lt;br /&gt;
Metadata Provided by Sovon is needed to describe how these measurements are taken.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field	'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''id '''||int4||PK||NOT NULL||auto-insert, unique ID for each observation&lt;br /&gt;
|-&lt;br /&gt;
|''ring_number''||text||FK||||link to individual&lt;br /&gt;
|-&lt;br /&gt;
|catch_datetime ||timestamp||||||Local time&lt;br /&gt;
|-&lt;br /&gt;
|release_datetime||timestamp||||||Local time&lt;br /&gt;
|-&lt;br /&gt;
|mass ||float8||||||grams&lt;br /&gt;
|-&lt;br /&gt;
|age ||text||||||AD = adult, JUV = juvenile&lt;br /&gt;
|-&lt;br /&gt;
|wing_length ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_length1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_length2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_height1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_height2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|tarsus_length  ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|total_head||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|observer ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|remarks||text||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Catch_datetime &amp;amp; release_datetime===&lt;br /&gt;
&lt;br /&gt;
During ringing of juveniles only the date was recorded and not the time.  Birds were all released the same day.  Ringing and measuring small chicks in the nest took about 2-5 minutes. Colour ringing and sampling of the larger chicks (from 4 July onwards) took about half an hour (rounding up several chicks and banding, sampling and releasing them together). To avoid leaving fields blank, a standard catch time was noted at 12:00 and a release time of 12:15 before July 4 and 12:30 from July 4 and onwards. ''''comments by Kees Oosterbeek''''&lt;br /&gt;
&lt;br /&gt;
== NEST_INFO ==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|''id''||int4||PK ||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|Species||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||NOT NULL||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||NOT NULL||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|year||Int4||||||Year of breeding season&lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;location&amp;quot;||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|Remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== NEST_OBSERVATION ==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||''''''Comments''''''&lt;br /&gt;
|-&lt;br /&gt;
|''id''||''int4''||PK||NOT NULL ||Auto-insert, unique ID for each observation&lt;br /&gt;
|-&lt;br /&gt;
|''NEST_INFO_id''||''int4''||FK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date||timestamptz ||||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|number_egg||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|number_young||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|pipping||text||||||Activity in egg (peeping or signs of hatching)&lt;br /&gt;
|-&lt;br /&gt;
|attended||text||||||Activity on nest&lt;br /&gt;
|-&lt;br /&gt;
|observer||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Comments:=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Graphical Data Model == &lt;br /&gt;
&lt;br /&gt;
[[Image:Gps_datamodel.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Argos GPS functions = &lt;br /&gt;
&lt;br /&gt;
== get_argosgps_track_speed ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters), time-interval, speed (meter/second) and heading (degrees) for a series of subsequent tracking entries with specific device_info_serial. &lt;br /&gt;
For the first entry in the sequence these values will always be missing because they are computed  as the difference between subsequent rows. &lt;br /&gt;
&lt;br /&gt;
Usage examples :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_argosgps_track_speed(41745, '2008-01-01 00:00:00', '2010-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_speed(41745);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and heading are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. &lt;br /&gt;
The heading is the initial heading. Because PostGIS does not calculate the heading we don't use PostGIS here.&lt;br /&gt;
&lt;br /&gt;
== get_argosgps_track_distance ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) for Argos GPS tracks to arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance(41745, 53.23348333,4.91656)&lt;br /&gt;
&lt;br /&gt;
-- Get distances from nest&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance(41745, (&lt;br /&gt;
  select n.location from gps.nest_info n, gps.track_session s, gps.individual i &lt;br /&gt;
    where i.nest_info_id = n.id &lt;br /&gt;
      and i.ring_number = s.ring_number &lt;br /&gt;
      and s.ptt_id = 41745 limit 1 ))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the distance is calculated with the PostGIS distance_sphere function which uses spherical correction.&lt;br /&gt;
&lt;br /&gt;
== get_argosgps_track_distance_direction ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) and direction (degrees) for Argos GPS tracks from arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance_direction(41745, 53.23348333,4.91656)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Distances and direction are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. The direction is the direction from the given point.&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=Argos_Data_Model&amp;diff=320</id>
		<title>Argos Data Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=Argos_Data_Model&amp;diff=320"/>
				<updated>2010-03-01T11:59:06Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* get_argosgps_track_distance_direction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GPS Data Model == &lt;br /&gt;
&lt;br /&gt;
Last updated January 5, 2010 Bart Heupers - [[ UvAGPS ]] moved to special page&lt;br /&gt;
&lt;br /&gt;
Updated January 22, 2008 Judy Shamoun-Baranes &lt;br /&gt;
&lt;br /&gt;
'''FLYSAFE TRACKING DATABASE'''&lt;br /&gt;
&lt;br /&gt;
The tracking database will include data from several species. Some species are trapped and then monitored during the breeding season while others are trapped during the winter season. Information is collected on each tracked bird, including biometric measurements. These measurements may be collected more than once. During the breeding season information is also collected about the gull breeding colony itself, location of nests, state of breeding (number of eggs and juveniles) and then juveniles themselves are marked and measured (although not tracked).&lt;br /&gt;
&lt;br /&gt;
In addition, PTTs are often tested before they are actually placed on the birds. This information is also important during analysis and particularly to establish accuracy of data. This data should also be stored in the database. Therefore it is important that this information is stored properly in the database&lt;br /&gt;
&lt;br /&gt;
Units and descriptions should be filled in for all measurements&lt;br /&gt;
&lt;br /&gt;
One way of looking at this structure is considering 3 categories of tables: &lt;br /&gt;
&lt;br /&gt;
# '''lookup tables''' (information stored once) &lt;br /&gt;
# '''session tables''' (stored occasionally) &lt;br /&gt;
# '''observations''' – highest frequency of information.&lt;br /&gt;
&lt;br /&gt;
Primary keys are noted by bold italic text. Foreign keys are noted by italic text in the Field column.&lt;br /&gt;
&lt;br /&gt;
Microwave, will under no circumstances provide information about their checksum calculations. If feasible, SARA will duplicate the procedure and include a flag in the representing the microwave filtered data.&lt;br /&gt;
	&lt;br /&gt;
'''TECHNICAL INFORMATION FROM TAGS'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DEVICE_INFO ==&lt;br /&gt;
&lt;br /&gt;
Table including technical information about tag hardware. &lt;br /&gt;
	&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4||PK||NOT NULL||serial number of PTT provided by Argos and used for communication with Argos satellite&lt;br /&gt;
|-&lt;br /&gt;
|serial ||int4||||NOT NULL||serial number of tag from manufacturer&lt;br /&gt;
|-&lt;br /&gt;
|weight ||int4||||NOT NULL||Unit = grams&lt;br /&gt;
|-&lt;br /&gt;
|type ||text||||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|manufacturer ||text||||||Device manufacturer&lt;br /&gt;
|-&lt;br /&gt;
|hexadecimal_id||text||||||Hexadecimal address, unique for each tag&lt;br /&gt;
|-&lt;br /&gt;
|PAN_id||Text||||||Personal area network ground based tags communicates with&lt;br /&gt;
|-&lt;br /&gt;
|Base_station_id||Int4||||||base station ground based tag communicates with&lt;br /&gt;
|-&lt;br /&gt;
|Remarks||text||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== TRACK_SESSION == &lt;br /&gt;
&lt;br /&gt;
This table includes information about each measurement session and enables inclusion of data from new species and also from the test phase of different tags&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''id '''||int4 ||PK||NOT NULL||unique ID for each usage of a PTT so test and bird with same ptt_id are two separate IDs/indexes&lt;br /&gt;
|-&lt;br /&gt;
|''pttid''||int4 ||FK||NOT NULL||Link to DEVICE_INFO table&lt;br /&gt;
|-&lt;br /&gt;
|''ring_number''||text ||FK||||link to individual table – tests do not have a ring_number&lt;br /&gt;
|-&lt;br /&gt;
|start_date ||timestamptz||||||Date/time (Local) when tracking begins&lt;br /&gt;
|-&lt;br /&gt;
|start_latitude ||float8||||NOT NULL||latitude where tracking begins, unit = dec degress&lt;br /&gt;
|-&lt;br /&gt;
|start_longitude ||float8||||NOT NULL||longitude where tracking begins, unit = dec degrees&lt;br /&gt;
|-&lt;br /&gt;
|start_altitude||Float8||||||Unit = m, include when known, important for testing&lt;br /&gt;
|-&lt;br /&gt;
|end_date||timestamptz||||||End of session if known&lt;br /&gt;
|-&lt;br /&gt;
|time_window ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|time_steps ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|location ||geometry||||||postgreSQL geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== GPS_TRACKING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from GPS sensors on PTT/GPS tags&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|'''date_time'''||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|speed ||float8||||||m/s&lt;br /&gt;
|-&lt;br /&gt;
|course||float8||||||degrees&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||float8||||||m&lt;br /&gt;
|-&lt;br /&gt;
|alt_status||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|quality||text||||||Quality information from sensor&lt;br /&gt;
|-&lt;br /&gt;
|user_QC||text||||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|parser_QC||text||||||Data flagged as unacceptable by Microwave parser&lt;br /&gt;
|-&lt;br /&gt;
|location||geometry||||||postgreSQL geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note : &lt;br /&gt;
&lt;br /&gt;
The parser_QC value can be 1, 2,3,4, 99, or 100. If it 1 the data is OK. If it is 2 or 3 or 4 some form of error correction has been &lt;br /&gt;
performed by the Microwave parser. And if it is 100 no error correction was possible. For reliable results it is advised only to use &lt;br /&gt;
records with parser_QC values of 1&lt;br /&gt;
&lt;br /&gt;
== ARGOS_TRACKING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from Argos sensors&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type '''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4 ||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|'''date_time'''||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|fix ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|latitude1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|latitude2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|msgcount ||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|frequency ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|average_ti ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|satellite ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|max_str ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|location1 ||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|location2 ||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== PTT_ENGINEERING_DATA ==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|'''tx_date_time'''||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|'''satellite_id'''||text ||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|ptt_date_time ||timestamp||||||GMT&lt;br /&gt;
|-&lt;br /&gt;
|activity||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|tx_count||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|temperature||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|battery_voltage||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|gps_fix_time||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|satellite_count||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|hours_reset||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|hours_since_gps_fix||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|mortality_gt||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|seasonal_gt||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|shunt||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In addition the views GPS_TRACKING_SESSION, ARGOS_TRACKING_SESSION, PTT_ENGINEERING_SESSION are which adds the correct track_session.id to the GPS_TRACKING_DATA, ARGOS_TRACKING_DATA and PTT_ENGINEERING_DATA table data.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
'''BIOLOGICAL INFORMATION'''&lt;br /&gt;
&lt;br /&gt;
== INDIVIDUAL ==&lt;br /&gt;
&lt;br /&gt;
Table includes information used to identify an individual&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field	'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ring_number'''||text||PK||NOT NULL||metal ring number&lt;br /&gt;
|-&lt;br /&gt;
|Id||int4||PK||NOT NULL ||auto-insert, unique ID for each individual organism &lt;br /&gt;
|-&lt;br /&gt;
|''NEST_INFO_id''||int4||FK||||link to NEST_INFO, not all specimens are linked to a nest&lt;br /&gt;
|-&lt;br /&gt;
|nest_certainty||int4||||||1 = certain, 0 = not completely certain&lt;br /&gt;
|-&lt;br /&gt;
|species_certainty||int4||||||1 = certain, 0 = not completely certain&lt;br /&gt;
|-&lt;br /&gt;
|ring_number||text||||NOT NULL||metal ring number&lt;br /&gt;
|-&lt;br /&gt;
|color_code||text||||||code for color ring without punctuation&lt;br /&gt;
|-&lt;br /&gt;
|species||text||||NOT NULL||Scientific name (at least genus)&lt;br /&gt;
|-&lt;br /&gt;
|sex||text||||||update if or when known&lt;br /&gt;
|-&lt;br /&gt;
|''FATE_CODEE_id''||textInt4||FK||||Link to FATE_CODE&lt;br /&gt;
|-&lt;br /&gt;
|Remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== FATE_code == &lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|Field	||Type||Key||Constraints||Comments&lt;br /&gt;
|-&lt;br /&gt;
|'''Id'''||'''Int4'''||'''PK'''||||'''auto-insert'''&lt;br /&gt;
|-&lt;br /&gt;
|code ||int4||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|description||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MEASUREMENT ==&lt;br /&gt;
&lt;br /&gt;
Metadata Provided by Sovon is needed to describe how these measurements are taken.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field	'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''id '''||int4||PK||NOT NULL||auto-insert, unique ID for each observation&lt;br /&gt;
|-&lt;br /&gt;
|''ring_number''||text||FK||||link to individual&lt;br /&gt;
|-&lt;br /&gt;
|catch_datetime ||timestamp||||||Local time&lt;br /&gt;
|-&lt;br /&gt;
|release_datetime||timestamp||||||Local time&lt;br /&gt;
|-&lt;br /&gt;
|mass ||float8||||||grams&lt;br /&gt;
|-&lt;br /&gt;
|age ||text||||||AD = adult, JUV = juvenile&lt;br /&gt;
|-&lt;br /&gt;
|wing_length ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_length1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_length2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_height1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_height2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|tarsus_length  ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|total_head||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|observer ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|remarks||text||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Catch_datetime &amp;amp; release_datetime===&lt;br /&gt;
&lt;br /&gt;
During ringing of juveniles only the date was recorded and not the time.  Birds were all released the same day.  Ringing and measuring small chicks in the nest took about 2-5 minutes. Colour ringing and sampling of the larger chicks (from 4 July onwards) took about half an hour (rounding up several chicks and banding, sampling and releasing them together). To avoid leaving fields blank, a standard catch time was noted at 12:00 and a release time of 12:15 before July 4 and 12:30 from July 4 and onwards. ''''comments by Kees Oosterbeek''''&lt;br /&gt;
&lt;br /&gt;
== NEST_INFO ==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|''id''||int4||PK ||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|Species||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||NOT NULL||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||NOT NULL||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|year||Int4||||||Year of breeding season&lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;location&amp;quot;||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|Remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== NEST_OBSERVATION ==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||''''''Comments''''''&lt;br /&gt;
|-&lt;br /&gt;
|''id''||''int4''||PK||NOT NULL ||Auto-insert, unique ID for each observation&lt;br /&gt;
|-&lt;br /&gt;
|''NEST_INFO_id''||''int4''||FK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date||timestamptz ||||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|number_egg||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|number_young||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|pipping||text||||||Activity in egg (peeping or signs of hatching)&lt;br /&gt;
|-&lt;br /&gt;
|attended||text||||||Activity on nest&lt;br /&gt;
|-&lt;br /&gt;
|observer||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Comments:=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Graphical Data Model == &lt;br /&gt;
&lt;br /&gt;
[[Image:Gps_datamodel.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Argos GPS functions = &lt;br /&gt;
&lt;br /&gt;
== get_argosgps_track_speed ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters), time-interval, speed (meter/second) and heading (degrees) for a series of subsequent tracking entries with specific device_info_serial. &lt;br /&gt;
For the first entry in the sequence these values will always be missing because they are computed  as the difference between subsequent rows. &lt;br /&gt;
&lt;br /&gt;
Usage examples :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_argosgps_track_speed(41745, '2008-01-01 00:00:00', '2010-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_speed(41745);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and heading are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. &lt;br /&gt;
The heading is the initial heading. Because PostGIS does not calculate the heading we don't use PostGIS here.&lt;br /&gt;
&lt;br /&gt;
== get_argosgps_track_distance ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) for Argos GPS tracks to arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance(41745, 53.23348333,4.91656)&lt;br /&gt;
&lt;br /&gt;
-- Get distances from nest&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance(41745, (&lt;br /&gt;
  select n.location from gps.nest_info n, gps.track_session s, gps.individual i &lt;br /&gt;
    where i.nest_info_id = n.id &lt;br /&gt;
      and i.ring_number = s.ring_number &lt;br /&gt;
      and s.ptt_id = 41745 limit 1 ))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the distance is calculated with the PostGIS distance_sphere function which uses spherical correction.&lt;br /&gt;
&lt;br /&gt;
== get_argosgps_track_distance_direction ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) and direction (degrees) for Argos GPS tracks from arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance_direction(41745, 53.23348333,4.91656)&lt;br /&gt;
&lt;br /&gt;
-- Get distances and direction to nest&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance_direction(41745, (&lt;br /&gt;
  select n.location from gps.nest_info n, gps.track_session s, gps.individual i &lt;br /&gt;
    where i.nest_info_id = n.id &lt;br /&gt;
      and i.ring_number = s.ring_number &lt;br /&gt;
      and s.ptt_id = 41745 limit 1 ))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and direction are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. The direction is the direction from the given point.&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=319</id>
		<title>UvAGPS</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=319"/>
				<updated>2010-03-01T11:58:34Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* get_uvagps_track_distance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= UvAGPS Data Model =&lt;br /&gt;
&lt;br /&gt;
For different versions of the UvAGPS firmware different tables are used. For firmware version v0.9.3.6 till v1.0.0.X the tables UVA_ENGINEERING_DATA and UVA_TRACKING_DATA are used. But in the new firmware versions 1.0.1.4 till 1.0.2.4 so much information was added  that new tables were introduced. However for the most important tracking tables a view is created so that all similar tracking for all types of firmware can be seen in one view. That is the UVA_TRACKING view. &lt;br /&gt;
&lt;br /&gt;
All tables, views and functions are also in the GPS schema.&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float8||||||Horizontal accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float8||||||Vertical accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||float8||||||m&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration||Float8||||||x axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) movement to right is + and to left is -&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration||Float8||||||y axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) forward movement is + and backwards is -&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration||Float8||||||z axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) upwards movement is + downwards is -&lt;br /&gt;
|-&lt;br /&gt;
|speed ||float8||||||m/s&lt;br /&gt;
|-&lt;br /&gt;
|course||float8||||||Degrees&lt;br /&gt;
|-&lt;br /&gt;
|pressure||float8||||||Pressure sensor (pascal)&lt;br /&gt;
|-&lt;br /&gt;
|temperature||Float8||||||Degrees celcius&lt;br /&gt;
|-&lt;br /&gt;
|solar_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|battery_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|quality||text||||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|  “&amp;quot;location”&amp;quot;||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENGINEERING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Engineering data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|t_syncsts||smallint||||||0: not synced, 1: user synced, 2: Gps synced&lt;br /&gt;
|-&lt;br /&gt;
|t_entzt||smallint||||||0: UCT time,1: TZT time (timezone time)&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentrategps||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratecom||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratepwr||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagesolarpanel||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagebattery||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_chargemode||int2||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainrategps||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratecom||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratepwr||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_esavegpsrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_esavecomrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsnavigationmode||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtimeout||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|eh||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_DEVICE == &lt;br /&gt;
&lt;br /&gt;
To be able to track the different firmware versions for the different devices the UVA_DEVICE table was added.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL ||&lt;br /&gt;
|- &lt;br /&gt;
| firmware_version || text |||| NOT NULL ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_COMM101 == &lt;br /&gt;
&lt;br /&gt;
Communication table indicates status and result of communications with ground stations. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
| date_time || timestamp || PK || NOT NULL || timestamp of start communication&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end || timestamp |||||| timestamp of end communication           &lt;br /&gt;
|-&lt;br /&gt;
| date_time_utc || timestamp |||||| date_time in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end_utc || timestamp |||||| date_time_end in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| action || text|||||| JOINED / RESCHEDULE  ??&lt;br /&gt;
|-&lt;br /&gt;
| bytes_communicated || integer |||||| Number of bytes communicated (total of all bytes per DATA line)  &lt;br /&gt;
|-&lt;br /&gt;
|status || text |||||| READY, TIMEOUT, LOWPOWER, MISSING&lt;br /&gt;
|-&lt;br /&gt;
| network_join_time || integer||||||milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| number_identical_lines || integer |||||| Number identical lines in data block. Gives indication &lt;br /&gt;
|-&lt;br /&gt;
| non_ascii_char || integer |||||| Number of non ascii characters (indicated by question-mark ?)&lt;br /&gt;
|-&lt;br /&gt;
| sts_time || timestamp |||||| derived from S0 hh,mi&lt;br /&gt;
|-&lt;br /&gt;
| timesynced || smallint|||||| TimeSynced (0=not sy:wnced, 1=user set, 2=Gps Synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode || smallint||||||DeviceMode (0-99)&lt;br /&gt;
|-&lt;br /&gt;
| vbat || float |||||| Battery voltage in V (0-~4.200V) &lt;br /&gt;
|-&lt;br /&gt;
|logb || integer |||||| logged bytes, waiting for download (0-4Mbyte)&lt;br /&gt;
|-&lt;br /&gt;
| logp || smallint |||||| Logged percentage (units 0.1%) of memory waiting to be downloaded (0-1000)&lt;br /&gt;
|-&lt;br /&gt;
| gpsii || integer |||||| GpsIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|comii || integer|||||| ComIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| AcceleroIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| User switches, current (0-65535) &lt;br /&gt;
|-&lt;br /&gt;
|last_gps_fix ||timestamp||||||timestamp of last fix&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||Latitude of last fix. Decimal degrees &lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||Longitude of last fix. Decimal degrees&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_SETTINGS101  == &lt;br /&gt;
&lt;br /&gt;
Settings are either from C0-C1-C9 lines or parsed from uplink communication lines &lt;br /&gt;
If C0-C1 is parsed its values are compared with the previous value and if the settings are the &lt;br /&gt;
same no new records needs to be added &lt;br /&gt;
If uplink settings are parsed wait till the last setting has been seen, (DL command or EOF) &lt;br /&gt;
then store all the new settings in one record. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||Derive timestamp from Hh:mi fields in C0 combined with computer timestamp in JOINED line&lt;br /&gt;
|-&lt;br /&gt;
|timesynced || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|timezone_time || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| SpecialUserSwitches &lt;br /&gt;
|-&lt;br /&gt;
|gpsnavmode || smallint|||||| GpsNavMode 0-7&lt;br /&gt;
|-&lt;br /&gt;
|gpsreceivermode || smallint |||||| GpsReceiverNode 0-3&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtime || smallint|||||| GpsFixTime 0-255&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_h || smallint|||||| hours Gps IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_m || smallint|||||| minutes Gps IvalN on &lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln  || integer|||||| GpsIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_h || smallint|||||| hours Gps IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_m || smallint|||||| minutes GpS IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale  || integer|||||| GpsIvalE &lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_h || smallint|||||| hours Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_m || smallint|||||| minutes Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln || integer|||||| ComIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_h || smallint|||||| hours Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_m || smallint|||||| minutes Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale || integer|||||| ComIvalE&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| Accelero measurement interval         &lt;br /&gt;
|-&lt;br /&gt;
|accbn || integer|||||| Accelero number of blocks &lt;br /&gt;
|-&lt;br /&gt;
|accsn || integer|||||| Accelero number of samples (0-65536)&lt;br /&gt;
|-&lt;br /&gt;
|f || smallint||||||Accelero sample frequency  (0=20Hz, 1=10Hz, 2=5Hz, 3=1Hz)&lt;br /&gt;
|-&lt;br /&gt;
|pdp || smallint|||||| PdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|pac||smallint|||||| PaccMsk (10-100)&lt;br /&gt;
|-&lt;br /&gt;
|tdp ||smallint|||||| TdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|tac ||smallint|||||| TaccMsk (30-300)&lt;br /&gt;
|-&lt;br /&gt;
|ga || smallint|||||| Additional Fixes GpsIval mode (3-25) before interval fix is logged&lt;br /&gt;
|-&lt;br /&gt;
|aol || smallint||||||AccMemOffLev (100 - 950) units 0.1%; if Memfull above  this level all Accelero activity will be overruled and switched off untill MemFull &amp;lt; level - 5&lt;br /&gt;
|-&lt;br /&gt;
|eventnum || text|||||| 12 eventnumbers (0-0xff) only printed if not zero, therfore converted to text&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA101 ==&lt;br /&gt;
&lt;br /&gt;
The tracking dat for newer firmware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||integer||||||heigth above sealevel meters&lt;br /&gt;
|-&lt;br /&gt;
|pressure ||integer||||||in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature ||float||||||in celcius degrees&lt;br /&gt;
|-&lt;br /&gt;
|satellites_used ||smallint||||||satellites used for fix &lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime ||float||||||GpsFixTime in seconds &lt;br /&gt;
|-&lt;br /&gt;
|positiondop ||float||||||Position DOP in units&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy || float||||||Horizontal accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy || float||||||Vertical accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|x_speed ||float||||||Speed in x-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|y_speed ||float||||||Speed in y-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|z_speed ||float||||||Speed in z-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|speed_accuracy || float||||||Speed accuracy (m/s) &lt;br /&gt;
|-&lt;br /&gt;
|location || geometry |||||| lat/long as PostGIS geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_ACCELERATION101 == &lt;br /&gt;
&lt;br /&gt;
Acceleration entries if accelerometer was turned on. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|index ||smallint||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration ||smallint||||||acceleration in X-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration ||smallint||||||acceleration in Y-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration ||smallint||||||acceleration in Z-axis (-2666 till 2666)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENERGY101 ==&lt;br /&gt;
&lt;br /&gt;
Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|timesynced ||smallint||||||TimeSynced (0=not synced, 1=user set, 2=Gps synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode ||smallint||||||(0-99)&lt;br /&gt;
|-&lt;br /&gt;
|vsll ||float||||||Solar Voltage during charging in mV (0-~2500)&lt;br /&gt;
|-&lt;br /&gt;
|vbat ||float||||||Battery Voltage in V (0-~4.200)&lt;br /&gt;
|-&lt;br /&gt;
|ssw ||smallint|||||| Solar Cell Switches ... (0-255) fw1022 and up &lt;br /&gt;
|-&lt;br /&gt;
| ||||||||extended fields if special user switch is on &lt;br /&gt;
|-&lt;br /&gt;
|vsoo ||float|||||| Solar voltage open in V (0-~2.500)&lt;br /&gt;
|-&lt;br /&gt;
|vdrf ||float||||||reference voltage Dac in V (0-~2.435)&lt;br /&gt;
|-&lt;br /&gt;
|vchr ||float||||||charge current voltage&lt;br /&gt;
|-&lt;br /&gt;
|g ||smallint|||||| Gps battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|c || smallint||||||Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|m || smallint||||||Charge Mode (0,1,2 Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|pressure || integer|||||| in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature || float|||||| in celcius degrees   &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING == &lt;br /&gt;
&lt;br /&gt;
View to show identical fields for older and newer firmware tracking data&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|altitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|pressure||integer|||||&lt;br /&gt;
|-&lt;br /&gt;
|temperature||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|x_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|y_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|z_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|location||geometry||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_SPEED == &lt;br /&gt;
&lt;br /&gt;
Additional view that computes with the x_speed, y_speed and z_speed components the vnorth, veast and vdown speed components as well as the absolute value speed in meters/second. &lt;br /&gt;
&lt;br /&gt;
In addition to the fields in the UVA_TRACKING view this view adds :&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|vnorth||float||||||- vx * sin(lat) * cos(long) - vy * sin(lat) * sin (long) + vz * cos(lat)&lt;br /&gt;
|-&lt;br /&gt;
|veast||float|||||| - vx * sin(lon) + vy * cos(lon)&lt;br /&gt;
|-&lt;br /&gt;
|vdown||float|||||| - vx * cos(lat) * cos(lon) - vy * cos(lat) * sin(lon) - vz * sin(lat)&lt;br /&gt;
|-&lt;br /&gt;
|speed||float|||||| sqrt(vx^2 + vy^2 + vz^2)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= UvAGPS functions =&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_speed ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters), time-interval, speed (meters/second) and heading (degrees) for a series of subsequent tracking entries with specific device_info_serial.&lt;br /&gt;
For the first entry in the sequence these values will always be missing because they are computed  as the difference between subsequent rows.&lt;br /&gt;
&lt;br /&gt;
Usage examples :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119);&lt;br /&gt;
&lt;br /&gt;
select t.*, a.distance, a.interval, a.speed, a.direction from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00') a join gps.uva_tracking t using(device_info_serial, date_time);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and heading are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. &lt;br /&gt;
The heading is the initial heading. PostGIS does not calculate the heading, so therefore we don't use PostGIS.&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) for UvAGPS tracks to arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, 52.1897017, 6.1996606); &lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, (select location from gps.uva_tracking where device_info_serial = 119 and date_time = '2009-05-07 19:55:08')); &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the distance is calculated with the PostGIS distance_sphere function which uses spherical correction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance_direction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) and direction (degrees) for UvAGPS tracks from arbitrary point in lat/long or geometry location&lt;br /&gt;
&lt;br /&gt;
Example usage: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance_direction(119, 52.1897017, 6.1996606); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and direction are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. The direction is the direction from the given point.&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=Argos_Data_Model&amp;diff=318</id>
		<title>Argos Data Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=Argos_Data_Model&amp;diff=318"/>
				<updated>2010-02-25T16:44:12Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* get_argosgps_track_distance_direction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GPS Data Model == &lt;br /&gt;
&lt;br /&gt;
Last updated January 5, 2010 Bart Heupers - [[ UvAGPS ]] moved to special page&lt;br /&gt;
&lt;br /&gt;
Updated January 22, 2008 Judy Shamoun-Baranes &lt;br /&gt;
&lt;br /&gt;
'''FLYSAFE TRACKING DATABASE'''&lt;br /&gt;
&lt;br /&gt;
The tracking database will include data from several species. Some species are trapped and then monitored during the breeding season while others are trapped during the winter season. Information is collected on each tracked bird, including biometric measurements. These measurements may be collected more than once. During the breeding season information is also collected about the gull breeding colony itself, location of nests, state of breeding (number of eggs and juveniles) and then juveniles themselves are marked and measured (although not tracked).&lt;br /&gt;
&lt;br /&gt;
In addition, PTTs are often tested before they are actually placed on the birds. This information is also important during analysis and particularly to establish accuracy of data. This data should also be stored in the database. Therefore it is important that this information is stored properly in the database&lt;br /&gt;
&lt;br /&gt;
Units and descriptions should be filled in for all measurements&lt;br /&gt;
&lt;br /&gt;
One way of looking at this structure is considering 3 categories of tables: &lt;br /&gt;
&lt;br /&gt;
# '''lookup tables''' (information stored once) &lt;br /&gt;
# '''session tables''' (stored occasionally) &lt;br /&gt;
# '''observations''' – highest frequency of information.&lt;br /&gt;
&lt;br /&gt;
Primary keys are noted by bold italic text. Foreign keys are noted by italic text in the Field column.&lt;br /&gt;
&lt;br /&gt;
Microwave, will under no circumstances provide information about their checksum calculations. If feasible, SARA will duplicate the procedure and include a flag in the representing the microwave filtered data.&lt;br /&gt;
	&lt;br /&gt;
'''TECHNICAL INFORMATION FROM TAGS'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DEVICE_INFO ==&lt;br /&gt;
&lt;br /&gt;
Table including technical information about tag hardware. &lt;br /&gt;
	&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4||PK||NOT NULL||serial number of PTT provided by Argos and used for communication with Argos satellite&lt;br /&gt;
|-&lt;br /&gt;
|serial ||int4||||NOT NULL||serial number of tag from manufacturer&lt;br /&gt;
|-&lt;br /&gt;
|weight ||int4||||NOT NULL||Unit = grams&lt;br /&gt;
|-&lt;br /&gt;
|type ||text||||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|manufacturer ||text||||||Device manufacturer&lt;br /&gt;
|-&lt;br /&gt;
|hexadecimal_id||text||||||Hexadecimal address, unique for each tag&lt;br /&gt;
|-&lt;br /&gt;
|PAN_id||Text||||||Personal area network ground based tags communicates with&lt;br /&gt;
|-&lt;br /&gt;
|Base_station_id||Int4||||||base station ground based tag communicates with&lt;br /&gt;
|-&lt;br /&gt;
|Remarks||text||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== TRACK_SESSION == &lt;br /&gt;
&lt;br /&gt;
This table includes information about each measurement session and enables inclusion of data from new species and also from the test phase of different tags&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''id '''||int4 ||PK||NOT NULL||unique ID for each usage of a PTT so test and bird with same ptt_id are two separate IDs/indexes&lt;br /&gt;
|-&lt;br /&gt;
|''pttid''||int4 ||FK||NOT NULL||Link to DEVICE_INFO table&lt;br /&gt;
|-&lt;br /&gt;
|''ring_number''||text ||FK||||link to individual table – tests do not have a ring_number&lt;br /&gt;
|-&lt;br /&gt;
|start_date ||timestamptz||||||Date/time (Local) when tracking begins&lt;br /&gt;
|-&lt;br /&gt;
|start_latitude ||float8||||NOT NULL||latitude where tracking begins, unit = dec degress&lt;br /&gt;
|-&lt;br /&gt;
|start_longitude ||float8||||NOT NULL||longitude where tracking begins, unit = dec degrees&lt;br /&gt;
|-&lt;br /&gt;
|start_altitude||Float8||||||Unit = m, include when known, important for testing&lt;br /&gt;
|-&lt;br /&gt;
|end_date||timestamptz||||||End of session if known&lt;br /&gt;
|-&lt;br /&gt;
|time_window ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|time_steps ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|location ||geometry||||||postgreSQL geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== GPS_TRACKING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from GPS sensors on PTT/GPS tags&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|'''date_time'''||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|speed ||float8||||||m/s&lt;br /&gt;
|-&lt;br /&gt;
|course||float8||||||degrees&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||float8||||||m&lt;br /&gt;
|-&lt;br /&gt;
|alt_status||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|quality||text||||||Quality information from sensor&lt;br /&gt;
|-&lt;br /&gt;
|user_QC||text||||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|parser_QC||text||||||Data flagged as unacceptable by Microwave parser&lt;br /&gt;
|-&lt;br /&gt;
|location||geometry||||||postgreSQL geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note : &lt;br /&gt;
&lt;br /&gt;
The parser_QC value can be 1, 2,3,4, 99, or 100. If it 1 the data is OK. If it is 2 or 3 or 4 some form of error correction has been &lt;br /&gt;
performed by the Microwave parser. And if it is 100 no error correction was possible. For reliable results it is advised only to use &lt;br /&gt;
records with parser_QC values of 1&lt;br /&gt;
&lt;br /&gt;
== ARGOS_TRACKING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from Argos sensors&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type '''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4 ||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|'''date_time'''||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|fix ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|latitude1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|latitude2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|msgcount ||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|frequency ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|average_ti ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|satellite ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|max_str ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|location1 ||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|location2 ||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== PTT_ENGINEERING_DATA ==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|'''tx_date_time'''||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|'''satellite_id'''||text ||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|ptt_date_time ||timestamp||||||GMT&lt;br /&gt;
|-&lt;br /&gt;
|activity||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|tx_count||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|temperature||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|battery_voltage||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|gps_fix_time||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|satellite_count||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|hours_reset||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|hours_since_gps_fix||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|mortality_gt||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|seasonal_gt||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|shunt||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In addition the views GPS_TRACKING_SESSION, ARGOS_TRACKING_SESSION, PTT_ENGINEERING_SESSION are which adds the correct track_session.id to the GPS_TRACKING_DATA, ARGOS_TRACKING_DATA and PTT_ENGINEERING_DATA table data.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
'''BIOLOGICAL INFORMATION'''&lt;br /&gt;
&lt;br /&gt;
== INDIVIDUAL ==&lt;br /&gt;
&lt;br /&gt;
Table includes information used to identify an individual&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field	'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ring_number'''||text||PK||NOT NULL||metal ring number&lt;br /&gt;
|-&lt;br /&gt;
|Id||int4||PK||NOT NULL ||auto-insert, unique ID for each individual organism &lt;br /&gt;
|-&lt;br /&gt;
|''NEST_INFO_id''||int4||FK||||link to NEST_INFO, not all specimens are linked to a nest&lt;br /&gt;
|-&lt;br /&gt;
|nest_certainty||int4||||||1 = certain, 0 = not completely certain&lt;br /&gt;
|-&lt;br /&gt;
|species_certainty||int4||||||1 = certain, 0 = not completely certain&lt;br /&gt;
|-&lt;br /&gt;
|ring_number||text||||NOT NULL||metal ring number&lt;br /&gt;
|-&lt;br /&gt;
|color_code||text||||||code for color ring without punctuation&lt;br /&gt;
|-&lt;br /&gt;
|species||text||||NOT NULL||Scientific name (at least genus)&lt;br /&gt;
|-&lt;br /&gt;
|sex||text||||||update if or when known&lt;br /&gt;
|-&lt;br /&gt;
|''FATE_CODEE_id''||textInt4||FK||||Link to FATE_CODE&lt;br /&gt;
|-&lt;br /&gt;
|Remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== FATE_code == &lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|Field	||Type||Key||Constraints||Comments&lt;br /&gt;
|-&lt;br /&gt;
|'''Id'''||'''Int4'''||'''PK'''||||'''auto-insert'''&lt;br /&gt;
|-&lt;br /&gt;
|code ||int4||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|description||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MEASUREMENT ==&lt;br /&gt;
&lt;br /&gt;
Metadata Provided by Sovon is needed to describe how these measurements are taken.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field	'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''id '''||int4||PK||NOT NULL||auto-insert, unique ID for each observation&lt;br /&gt;
|-&lt;br /&gt;
|''ring_number''||text||FK||||link to individual&lt;br /&gt;
|-&lt;br /&gt;
|catch_datetime ||timestamp||||||Local time&lt;br /&gt;
|-&lt;br /&gt;
|release_datetime||timestamp||||||Local time&lt;br /&gt;
|-&lt;br /&gt;
|mass ||float8||||||grams&lt;br /&gt;
|-&lt;br /&gt;
|age ||text||||||AD = adult, JUV = juvenile&lt;br /&gt;
|-&lt;br /&gt;
|wing_length ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_length1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_length2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_height1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_height2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|tarsus_length  ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|total_head||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|observer ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|remarks||text||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Catch_datetime &amp;amp; release_datetime===&lt;br /&gt;
&lt;br /&gt;
During ringing of juveniles only the date was recorded and not the time.  Birds were all released the same day.  Ringing and measuring small chicks in the nest took about 2-5 minutes. Colour ringing and sampling of the larger chicks (from 4 July onwards) took about half an hour (rounding up several chicks and banding, sampling and releasing them together). To avoid leaving fields blank, a standard catch time was noted at 12:00 and a release time of 12:15 before July 4 and 12:30 from July 4 and onwards. ''''comments by Kees Oosterbeek''''&lt;br /&gt;
&lt;br /&gt;
== NEST_INFO ==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|''id''||int4||PK ||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|Species||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||NOT NULL||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||NOT NULL||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|year||Int4||||||Year of breeding season&lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;location&amp;quot;||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|Remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== NEST_OBSERVATION ==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||''''''Comments''''''&lt;br /&gt;
|-&lt;br /&gt;
|''id''||''int4''||PK||NOT NULL ||Auto-insert, unique ID for each observation&lt;br /&gt;
|-&lt;br /&gt;
|''NEST_INFO_id''||''int4''||FK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date||timestamptz ||||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|number_egg||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|number_young||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|pipping||text||||||Activity in egg (peeping or signs of hatching)&lt;br /&gt;
|-&lt;br /&gt;
|attended||text||||||Activity on nest&lt;br /&gt;
|-&lt;br /&gt;
|observer||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Comments:=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Graphical Data Model == &lt;br /&gt;
&lt;br /&gt;
[[Image:Gps_datamodel.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Argos GPS functions = &lt;br /&gt;
&lt;br /&gt;
== get_argosgps_track_speed ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters), time-interval, speed (meter/second) and heading (degrees) for a series of subsequent tracking entries with specific device_info_serial. &lt;br /&gt;
For the first entry in the sequence these values will always be missing because they are computed  as the difference between subsequent rows. &lt;br /&gt;
&lt;br /&gt;
Usage examples :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_argosgps_track_speed(41745, '2008-01-01 00:00:00', '2010-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_speed(41745);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and heading are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. &lt;br /&gt;
The heading is the initial heading. Because PostGIS does not calculate the heading we don't use PostGIS here.&lt;br /&gt;
&lt;br /&gt;
== get_argosgps_track_distance ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) for Argos GPS tracks to arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance(41745, 53.23348333,4.91656)&lt;br /&gt;
&lt;br /&gt;
-- Get distances from nest&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance(41745, (&lt;br /&gt;
  select n.location from gps.nest_info n, gps.track_session s, gps.individual i &lt;br /&gt;
    where i.nest_info_id = n.id &lt;br /&gt;
      and i.ring_number = s.ring_number &lt;br /&gt;
      and s.ptt_id = 41745 limit 1 ))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the distance is calculated with the PostGIS distance_sphere function which uses spherical correction.&lt;br /&gt;
&lt;br /&gt;
== get_argosgps_track_distance_direction ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) and direction (degrees) for Argos GPS tracks from arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance_direction(41745, 53.23348333,4.91656)&lt;br /&gt;
&lt;br /&gt;
-- Get distances and direction to nest&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance_direction(41745, (&lt;br /&gt;
  select n.location from gps.nest_info n, gps.track_session s, gps.individual i &lt;br /&gt;
    where i.nest_info_id = n.id &lt;br /&gt;
      and i.ring_number = s.ring_number &lt;br /&gt;
      and s.ptt_id = 41745 limit 1 ))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and direction are calculated with spherical correction with the Haversine formula as described here. The direction is the direction from the given point.&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=Argos_Data_Model&amp;diff=317</id>
		<title>Argos Data Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=Argos_Data_Model&amp;diff=317"/>
				<updated>2010-02-25T16:40:55Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* get_argosgps_track_distance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GPS Data Model == &lt;br /&gt;
&lt;br /&gt;
Last updated January 5, 2010 Bart Heupers - [[ UvAGPS ]] moved to special page&lt;br /&gt;
&lt;br /&gt;
Updated January 22, 2008 Judy Shamoun-Baranes &lt;br /&gt;
&lt;br /&gt;
'''FLYSAFE TRACKING DATABASE'''&lt;br /&gt;
&lt;br /&gt;
The tracking database will include data from several species. Some species are trapped and then monitored during the breeding season while others are trapped during the winter season. Information is collected on each tracked bird, including biometric measurements. These measurements may be collected more than once. During the breeding season information is also collected about the gull breeding colony itself, location of nests, state of breeding (number of eggs and juveniles) and then juveniles themselves are marked and measured (although not tracked).&lt;br /&gt;
&lt;br /&gt;
In addition, PTTs are often tested before they are actually placed on the birds. This information is also important during analysis and particularly to establish accuracy of data. This data should also be stored in the database. Therefore it is important that this information is stored properly in the database&lt;br /&gt;
&lt;br /&gt;
Units and descriptions should be filled in for all measurements&lt;br /&gt;
&lt;br /&gt;
One way of looking at this structure is considering 3 categories of tables: &lt;br /&gt;
&lt;br /&gt;
# '''lookup tables''' (information stored once) &lt;br /&gt;
# '''session tables''' (stored occasionally) &lt;br /&gt;
# '''observations''' – highest frequency of information.&lt;br /&gt;
&lt;br /&gt;
Primary keys are noted by bold italic text. Foreign keys are noted by italic text in the Field column.&lt;br /&gt;
&lt;br /&gt;
Microwave, will under no circumstances provide information about their checksum calculations. If feasible, SARA will duplicate the procedure and include a flag in the representing the microwave filtered data.&lt;br /&gt;
	&lt;br /&gt;
'''TECHNICAL INFORMATION FROM TAGS'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DEVICE_INFO ==&lt;br /&gt;
&lt;br /&gt;
Table including technical information about tag hardware. &lt;br /&gt;
	&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4||PK||NOT NULL||serial number of PTT provided by Argos and used for communication with Argos satellite&lt;br /&gt;
|-&lt;br /&gt;
|serial ||int4||||NOT NULL||serial number of tag from manufacturer&lt;br /&gt;
|-&lt;br /&gt;
|weight ||int4||||NOT NULL||Unit = grams&lt;br /&gt;
|-&lt;br /&gt;
|type ||text||||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|manufacturer ||text||||||Device manufacturer&lt;br /&gt;
|-&lt;br /&gt;
|hexadecimal_id||text||||||Hexadecimal address, unique for each tag&lt;br /&gt;
|-&lt;br /&gt;
|PAN_id||Text||||||Personal area network ground based tags communicates with&lt;br /&gt;
|-&lt;br /&gt;
|Base_station_id||Int4||||||base station ground based tag communicates with&lt;br /&gt;
|-&lt;br /&gt;
|Remarks||text||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== TRACK_SESSION == &lt;br /&gt;
&lt;br /&gt;
This table includes information about each measurement session and enables inclusion of data from new species and also from the test phase of different tags&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''id '''||int4 ||PK||NOT NULL||unique ID for each usage of a PTT so test and bird with same ptt_id are two separate IDs/indexes&lt;br /&gt;
|-&lt;br /&gt;
|''pttid''||int4 ||FK||NOT NULL||Link to DEVICE_INFO table&lt;br /&gt;
|-&lt;br /&gt;
|''ring_number''||text ||FK||||link to individual table – tests do not have a ring_number&lt;br /&gt;
|-&lt;br /&gt;
|start_date ||timestamptz||||||Date/time (Local) when tracking begins&lt;br /&gt;
|-&lt;br /&gt;
|start_latitude ||float8||||NOT NULL||latitude where tracking begins, unit = dec degress&lt;br /&gt;
|-&lt;br /&gt;
|start_longitude ||float8||||NOT NULL||longitude where tracking begins, unit = dec degrees&lt;br /&gt;
|-&lt;br /&gt;
|start_altitude||Float8||||||Unit = m, include when known, important for testing&lt;br /&gt;
|-&lt;br /&gt;
|end_date||timestamptz||||||End of session if known&lt;br /&gt;
|-&lt;br /&gt;
|time_window ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|time_steps ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|location ||geometry||||||postgreSQL geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== GPS_TRACKING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from GPS sensors on PTT/GPS tags&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|'''date_time'''||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|speed ||float8||||||m/s&lt;br /&gt;
|-&lt;br /&gt;
|course||float8||||||degrees&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||float8||||||m&lt;br /&gt;
|-&lt;br /&gt;
|alt_status||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|quality||text||||||Quality information from sensor&lt;br /&gt;
|-&lt;br /&gt;
|user_QC||text||||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|parser_QC||text||||||Data flagged as unacceptable by Microwave parser&lt;br /&gt;
|-&lt;br /&gt;
|location||geometry||||||postgreSQL geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note : &lt;br /&gt;
&lt;br /&gt;
The parser_QC value can be 1, 2,3,4, 99, or 100. If it 1 the data is OK. If it is 2 or 3 or 4 some form of error correction has been &lt;br /&gt;
performed by the Microwave parser. And if it is 100 no error correction was possible. For reliable results it is advised only to use &lt;br /&gt;
records with parser_QC values of 1&lt;br /&gt;
&lt;br /&gt;
== ARGOS_TRACKING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from Argos sensors&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type '''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4 ||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|'''date_time'''||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|fix ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|latitude1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|latitude2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|msgcount ||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|frequency ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|average_ti ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|satellite ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|max_str ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|location1 ||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|location2 ||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== PTT_ENGINEERING_DATA ==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|'''tx_date_time'''||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|'''satellite_id'''||text ||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|ptt_date_time ||timestamp||||||GMT&lt;br /&gt;
|-&lt;br /&gt;
|activity||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|tx_count||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|temperature||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|battery_voltage||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|gps_fix_time||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|satellite_count||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|hours_reset||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|hours_since_gps_fix||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|mortality_gt||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|seasonal_gt||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|shunt||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In addition the views GPS_TRACKING_SESSION, ARGOS_TRACKING_SESSION, PTT_ENGINEERING_SESSION are which adds the correct track_session.id to the GPS_TRACKING_DATA, ARGOS_TRACKING_DATA and PTT_ENGINEERING_DATA table data.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
'''BIOLOGICAL INFORMATION'''&lt;br /&gt;
&lt;br /&gt;
== INDIVIDUAL ==&lt;br /&gt;
&lt;br /&gt;
Table includes information used to identify an individual&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field	'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ring_number'''||text||PK||NOT NULL||metal ring number&lt;br /&gt;
|-&lt;br /&gt;
|Id||int4||PK||NOT NULL ||auto-insert, unique ID for each individual organism &lt;br /&gt;
|-&lt;br /&gt;
|''NEST_INFO_id''||int4||FK||||link to NEST_INFO, not all specimens are linked to a nest&lt;br /&gt;
|-&lt;br /&gt;
|nest_certainty||int4||||||1 = certain, 0 = not completely certain&lt;br /&gt;
|-&lt;br /&gt;
|species_certainty||int4||||||1 = certain, 0 = not completely certain&lt;br /&gt;
|-&lt;br /&gt;
|ring_number||text||||NOT NULL||metal ring number&lt;br /&gt;
|-&lt;br /&gt;
|color_code||text||||||code for color ring without punctuation&lt;br /&gt;
|-&lt;br /&gt;
|species||text||||NOT NULL||Scientific name (at least genus)&lt;br /&gt;
|-&lt;br /&gt;
|sex||text||||||update if or when known&lt;br /&gt;
|-&lt;br /&gt;
|''FATE_CODEE_id''||textInt4||FK||||Link to FATE_CODE&lt;br /&gt;
|-&lt;br /&gt;
|Remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== FATE_code == &lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|Field	||Type||Key||Constraints||Comments&lt;br /&gt;
|-&lt;br /&gt;
|'''Id'''||'''Int4'''||'''PK'''||||'''auto-insert'''&lt;br /&gt;
|-&lt;br /&gt;
|code ||int4||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|description||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MEASUREMENT ==&lt;br /&gt;
&lt;br /&gt;
Metadata Provided by Sovon is needed to describe how these measurements are taken.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field	'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''id '''||int4||PK||NOT NULL||auto-insert, unique ID for each observation&lt;br /&gt;
|-&lt;br /&gt;
|''ring_number''||text||FK||||link to individual&lt;br /&gt;
|-&lt;br /&gt;
|catch_datetime ||timestamp||||||Local time&lt;br /&gt;
|-&lt;br /&gt;
|release_datetime||timestamp||||||Local time&lt;br /&gt;
|-&lt;br /&gt;
|mass ||float8||||||grams&lt;br /&gt;
|-&lt;br /&gt;
|age ||text||||||AD = adult, JUV = juvenile&lt;br /&gt;
|-&lt;br /&gt;
|wing_length ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_length1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_length2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_height1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_height2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|tarsus_length  ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|total_head||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|observer ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|remarks||text||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Catch_datetime &amp;amp; release_datetime===&lt;br /&gt;
&lt;br /&gt;
During ringing of juveniles only the date was recorded and not the time.  Birds were all released the same day.  Ringing and measuring small chicks in the nest took about 2-5 minutes. Colour ringing and sampling of the larger chicks (from 4 July onwards) took about half an hour (rounding up several chicks and banding, sampling and releasing them together). To avoid leaving fields blank, a standard catch time was noted at 12:00 and a release time of 12:15 before July 4 and 12:30 from July 4 and onwards. ''''comments by Kees Oosterbeek''''&lt;br /&gt;
&lt;br /&gt;
== NEST_INFO ==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|''id''||int4||PK ||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|Species||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||NOT NULL||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||NOT NULL||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|year||Int4||||||Year of breeding season&lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;location&amp;quot;||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|Remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== NEST_OBSERVATION ==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||''''''Comments''''''&lt;br /&gt;
|-&lt;br /&gt;
|''id''||''int4''||PK||NOT NULL ||Auto-insert, unique ID for each observation&lt;br /&gt;
|-&lt;br /&gt;
|''NEST_INFO_id''||''int4''||FK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date||timestamptz ||||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|number_egg||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|number_young||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|pipping||text||||||Activity in egg (peeping or signs of hatching)&lt;br /&gt;
|-&lt;br /&gt;
|attended||text||||||Activity on nest&lt;br /&gt;
|-&lt;br /&gt;
|observer||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Comments:=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Graphical Data Model == &lt;br /&gt;
&lt;br /&gt;
[[Image:Gps_datamodel.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Argos GPS functions = &lt;br /&gt;
&lt;br /&gt;
== get_argosgps_track_speed ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters), time-interval, speed (meter/second) and heading (degrees) for a series of subsequent tracking entries with specific device_info_serial. &lt;br /&gt;
For the first entry in the sequence these values will always be missing because they are computed  as the difference between subsequent rows. &lt;br /&gt;
&lt;br /&gt;
Usage examples :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_argosgps_track_speed(41745, '2008-01-01 00:00:00', '2010-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_speed(41745);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and heading are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. &lt;br /&gt;
The heading is the initial heading. Because PostGIS does not calculate the heading we don't use PostGIS here.&lt;br /&gt;
&lt;br /&gt;
== get_argosgps_track_distance ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) for Argos GPS tracks to arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance(41745, 53.23348333,4.91656)&lt;br /&gt;
&lt;br /&gt;
-- Get distances from nest&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance(41745, (&lt;br /&gt;
  select n.location from gps.nest_info n, gps.track_session s, gps.individual i &lt;br /&gt;
    where i.nest_info_id = n.id &lt;br /&gt;
      and i.ring_number = s.ring_number &lt;br /&gt;
      and s.ptt_id = 41745 limit 1 ))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the distance is calculated with the PostGIS distance_sphere function which uses spherical correction.&lt;br /&gt;
&lt;br /&gt;
== get_argosgps_track_distance_direction ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) and direction (degrees) for Argos GPS tracks to arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance_direction(41745, 53.23348333,4.91656)&lt;br /&gt;
&lt;br /&gt;
-- Get distances and direction to nest&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance_direction(41745, (&lt;br /&gt;
  select n.location from gps.nest_info n, gps.track_session s, gps.individual i &lt;br /&gt;
    where i.nest_info_id = n.id &lt;br /&gt;
      and i.ring_number = s.ring_number &lt;br /&gt;
      and s.ptt_id = 41745 limit 1 ))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=ECMWF&amp;diff=316</id>
		<title>ECMWF</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=ECMWF&amp;diff=316"/>
				<updated>2010-01-25T16:44:12Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* ANALYSIS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ECMWF == &lt;br /&gt;
&lt;br /&gt;
Datamodel for the tables in the ECMWF schema. &lt;br /&gt;
&lt;br /&gt;
Data is created by the ECMWF and retrieved from the KNMI ftp site as GRIB files. The original GRIB files can also be  retrieved from the flysafe server from :&lt;br /&gt;
&lt;br /&gt;
[https://flysafe-pps.grid.sara.nl/archive/knmi/ecmwf/ ECMWF Data Archive]&lt;br /&gt;
&lt;br /&gt;
More information about the parameters in these GRIB files can be retrieved from the [http://www.ecmwf.int/services/dissemination/3.1/Products_in_GRIB_code.html ECMWF website].&lt;br /&gt;
&lt;br /&gt;
== INVARIABLE == &lt;br /&gt;
&lt;br /&gt;
The INVARIABLE table contains data that is invariant over time. &lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''LATITUDE''' || degrees * 100 to make this a integer&lt;br /&gt;
|-&lt;br /&gt;
|'''LONGITUDE''' || degrees * 100 to make this a integer&lt;br /&gt;
|-&lt;br /&gt;
|Z || 129 Z Geopotential surface/model orography 				&lt;br /&gt;
|-&lt;br /&gt;
|LSM || 172 LSM	Land sea mask				&lt;br /&gt;
|-&lt;br /&gt;
|LOCATION || Latitude/longitude as GIS location  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The GIS LOCATION is only added to this table. This is because always the same values for latitude and  longitude are used and then if the GIS location is required for the ANALYSIS or FORECAST tables it can be retrieved by joining to this table on the LATITUDE, LONGUTUDE fields.&lt;br /&gt;
&lt;br /&gt;
== FORECAST and UVA_FORECAST == &lt;br /&gt;
&lt;br /&gt;
The FORECAST table contains predicted values in steps of 3 hours till 72 hours ahead. The MODELTS is the timestamp for which this prediction applies. Two times a day new Forecast GRIB files will arrive. The newer FORECAST data that arrives for the same timestamp will overwrite the older data.&lt;br /&gt;
&lt;br /&gt;
The FORECAST (and UVA_FORECAST) table itself is a master table that does not contain any data. The inherited tables &lt;br /&gt;
FORECAST&amp;lt;YEAR&amp;gt;&amp;lt;MONTH&amp;gt; contain the data, but the master FORECAST or UVA_FORECAST table can be used to SELECT the data. &lt;br /&gt;
&lt;br /&gt;
Data till 2009-09 is owned by the UvA and can be accessed by anybody with ECMWF_READ rights by using the FORECAST_UVA table. The FORECAST table itself also references data after 2009-09 that is owned by RNLAF for which special access rights ECMWF_RNLAF_READ are required. &lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''MODELTS'''||Time for which this forecast applies = model run + step hours&lt;br /&gt;
|-&lt;br /&gt;
|'''LATITUDE'''||degrees * 100 to make this a integer&lt;br /&gt;
|-&lt;br /&gt;
|'''LONGITUDE'''||degrees * 100 to make this a integer&lt;br /&gt;
|-&lt;br /&gt;
|STEP||model step (smaller is more recent forecast)&lt;br /&gt;
|-&lt;br /&gt;
|SSRD||169 SSRD	surface solar radiation downwards accumulated			&lt;br /&gt;
|-&lt;br /&gt;
|TP||228 TP	total precipitation accumulated			&lt;br /&gt;
|-&lt;br /&gt;
|SP||134 SP	surface pressure		&lt;br /&gt;
|-&lt;br /&gt;
|BLH||159 BLH	boundary layer height		&lt;br /&gt;
|-&lt;br /&gt;
|TCC||164 TCC	total cloud coverage		&lt;br /&gt;
|-&lt;br /&gt;
|U10||165 10U	10 meters wind U-component		&lt;br /&gt;
|-&lt;br /&gt;
|V10||166 10V	10 meters wind V-component		&lt;br /&gt;
|-&lt;br /&gt;
|T2||167 2T	2 metres air temperature		&lt;br /&gt;
|-&lt;br /&gt;
|D2||168 2D	2 metres dew point temperature		&lt;br /&gt;
|-&lt;br /&gt;
|LCC||186 LCC	low cloud coverage		&lt;br /&gt;
|-&lt;br /&gt;
|''Pressure level 1000''||&lt;br /&gt;
|-&lt;br /&gt;
|T_1000||130 T	temperature	&lt;br /&gt;
|-&lt;br /&gt;
|U_1000||131 U	U-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|V_1000||132 V	V-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|GH_1000||156 GH	geopotential height	&lt;br /&gt;
|-&lt;br /&gt;
|R_1000||157 R	relative humidity	&lt;br /&gt;
|-&lt;br /&gt;
|''Pressure level 925''||&lt;br /&gt;
|-&lt;br /&gt;
|T_925 real||130 T	temperature	&lt;br /&gt;
|-&lt;br /&gt;
|U_925 real||131 U	U-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|V_925 real||132 V	V-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|GH_925 real||156 GH	geopotential height	&lt;br /&gt;
|-&lt;br /&gt;
|R_925 real||157 R	relative humidity	&lt;br /&gt;
|-&lt;br /&gt;
|''Pressure level 850''||&lt;br /&gt;
|-&lt;br /&gt;
|T_850||130 T	temperature	&lt;br /&gt;
|-&lt;br /&gt;
|U_850 real||131 U	U-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|V_850 real||132 V	V-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|GH_850 real||156 GH	geopotential height	&lt;br /&gt;
|-&lt;br /&gt;
|R_850 real||157 R	relative humidity	&lt;br /&gt;
|-&lt;br /&gt;
|''Pressure level 700''||&lt;br /&gt;
|-&lt;br /&gt;
|T_700 real||130 T	temperature	&lt;br /&gt;
|-&lt;br /&gt;
|U_700 real||131 U	U-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|V_700 real||132 V	V-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|GH_700 real||156 GH	geopotential height	&lt;br /&gt;
|-&lt;br /&gt;
|R_700 real||157 R	relative humidity	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ANALYSIS and UVA_ANALYSIS ==&lt;br /&gt;
&lt;br /&gt;
The ANALYSIS and UVA_ANALYSIS table contains values from the Analysis GRIB files at 18, 00, 06 and 12 UTC&lt;br /&gt;
&lt;br /&gt;
Data till 2009-09 is owned by the UvA and can be accessed by anybody with ECMWF_READ rights by using the ANALYSIS_UVA table. The ANALYSIS table itself also references data after 2009-09 that is owned by RNLAF for which special access rights ECMWF_RNLAF_READ are required. &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
{|border=1&lt;br /&gt;
|'''MODELTS'''||Time for which this forecast applies = model run&lt;br /&gt;
|-&lt;br /&gt;
|'''LATITUDE'''||degrees * 100 to make this a integer&lt;br /&gt;
|-&lt;br /&gt;
|'''LONGITUDE'''||degrees * 100 to make this a integer&lt;br /&gt;
|-&lt;br /&gt;
|SP||134 SP	surface pressure		&lt;br /&gt;
|-&lt;br /&gt;
|TCC||164 TCC	total cloud coverage		&lt;br /&gt;
|-&lt;br /&gt;
|U10||165 10U	10 meters wind U-component		&lt;br /&gt;
|-&lt;br /&gt;
|V10||166 10V	10 meters wind V-component		&lt;br /&gt;
|-&lt;br /&gt;
|T2||167 2T	2 metres air temperature		&lt;br /&gt;
|-&lt;br /&gt;
|D2||168 2D	2 metres dew point temperature		&lt;br /&gt;
|-&lt;br /&gt;
|LCC||186 LCC	low cloud coverage		&lt;br /&gt;
|-&lt;br /&gt;
|''Pressure level 1000''||&lt;br /&gt;
|-&lt;br /&gt;
|T_1000||130 T	temperature	&lt;br /&gt;
|-&lt;br /&gt;
|U_1000||131 U	U-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|V_1000||132 V	V-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|GH_1000||156 GH	geopotential height	&lt;br /&gt;
|-&lt;br /&gt;
|R_1000||157 R	relative humidity	&lt;br /&gt;
|-&lt;br /&gt;
|Pressure level 925||&lt;br /&gt;
|-&lt;br /&gt;
|T_925||130 T	temperature	&lt;br /&gt;
|-&lt;br /&gt;
|U_925||131 U	U-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|V_925||132 V	V-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|GH_925||156 GH	geopotential height	&lt;br /&gt;
|-&lt;br /&gt;
|R_925||157 R	relative humidity	&lt;br /&gt;
|-&lt;br /&gt;
|Pressure level 850||&lt;br /&gt;
|-&lt;br /&gt;
|T_850||130 T	temperature	&lt;br /&gt;
|-&lt;br /&gt;
|U_850||131 U	U-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|V_850||132 V	V-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|GH_850||156 GH	geopotential height	&lt;br /&gt;
|-&lt;br /&gt;
|R_850||157 R	relative humidity	&lt;br /&gt;
|-&lt;br /&gt;
|Pressure level 700||&lt;br /&gt;
|-&lt;br /&gt;
|T_700||130 T	temperature	&lt;br /&gt;
|-&lt;br /&gt;
|U_700||131 U	U-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|V_700||132 V	V-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|GH_700||156 GH	geopotential height	&lt;br /&gt;
|-&lt;br /&gt;
|R_700||157 R	relative humidity&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== COMBINED == &lt;br /&gt;
&lt;br /&gt;
If you want to use Analysis data if available for a timestimp but otherwise Forecast, the COMBINED VIEW can be used. If a ANALYSIS value is available for a timestamp and latitude/longitude the ANALYSIS value will be used, otherwise the FORECAST value is given.&lt;br /&gt;
&lt;br /&gt;
== Historical data == &lt;br /&gt;
&lt;br /&gt;
In addition ongoing process of adding ECMWF data since November 11 2007, a historical data set has been loaded.  That historical dataset is stored in additional inherited tables FORECASTHISTORY and&lt;br /&gt;
ANALYSISHISTORY which inherit from FORECAST and ANALYSIS respectively. &lt;br /&gt;
&lt;br /&gt;
The FORECASTHISTORY does not always contain TP (228 TP total precipitation accumulated).  Instead of this it contains the following values :&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|LSP||142 LSP Large scale precipitation&lt;br /&gt;
|-&lt;br /&gt;
|CP||143 CP Convective precipitation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The historical dat sets span the following periods and locations &lt;br /&gt;
&lt;br /&gt;
{|border=1 &lt;br /&gt;
|'''Start'''||'''End'''||'''Area'''||'''Grid'''&lt;br /&gt;
|-&lt;br /&gt;
|2007-01-01||2007-11-15||62degN 10degW 335degN 20degE||0.25x0.25deg&lt;br /&gt;
|-&lt;br /&gt;
|2003-02-15||2003-06-15||62degN 10degW 335degN 20degE||0.5x0.5deg&lt;br /&gt;
|-&lt;br /&gt;
|2005-01-01||2006-12-31||62degN 10degW 335degN 20degE||0.5x0.5deg&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Helpful Functions == &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following functions have been defined in Postgres to select the nearest gridpoint in spacetime for the ECMWF analysis and forecast tables. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are '''ecmwf.forecast_nearest''' and '''ecmwf.analysis_nearest''' and they take a latitude, longitude and timestamp as parameter. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They can be used in the following way:&lt;br /&gt;
&lt;br /&gt;
  select * from ecmwf.forecast_nearest( 52.35983, 5.615, timestamp '2008-05-19 13:34:00');&lt;br /&gt;
   &lt;br /&gt;
  select * from ecmwf.analysis_nearest( 52.35983, 5.615, timestamp '2008-05-19 13:34:00');&lt;br /&gt;
&lt;br /&gt;
These function can for example be used in a join as follows :&lt;br /&gt;
&lt;br /&gt;
  SELECT g.ptt_id&lt;br /&gt;
       , g.date_time&lt;br /&gt;
       , g.latitude&lt;br /&gt;
       , g.longitude&lt;br /&gt;
       , g.speed&lt;br /&gt;
       , g.course&lt;br /&gt;
       , g.altitude&lt;br /&gt;
       , (ecmwf.forecast_nearest( g.latitude, g.longitude,g.date_time)).*&lt;br /&gt;
  FROM gps.gps_tracking_data g&lt;br /&gt;
     , gps.individual i&lt;br /&gt;
     , gps.track_session t&lt;br /&gt;
  WHERE g.ptt_id = t.ptt_id &lt;br /&gt;
    AND g.date_time &amp;gt;= t.start_date &lt;br /&gt;
    AND i.ring_number = t.ring_number &lt;br /&gt;
    AND g.parser_qc = 1 &lt;br /&gt;
    AND g.ptt_id = 41745 &lt;br /&gt;
    AND g.latitude &amp;lt;&amp;gt; 0&lt;br /&gt;
  ORDER BY g.date_time;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Although these functions were converted to PLPgSQL to speed them up, a faster ways to retrieve the same data is with (thanks to Floris Sluiters): &lt;br /&gt;
&lt;br /&gt;
  SELECT ptt_id, date_time, latitude, longitude, speed, course, altitude, (x::ecmwf.forecast).*&lt;br /&gt;
  FROM (SELECT &lt;br /&gt;
       g.*&lt;br /&gt;
       ,((SELECT f &lt;br /&gt;
            FROM ecmwf.forecast f&lt;br /&gt;
           WHERE f.latitude = round(g.latitude * 100 / 25)::integer * 25&lt;br /&gt;
             AND f.longitude =  round(g.longitude * 100 / 25)::integer * 25&lt;br /&gt;
             AND f.modelts = TIMESTAMP 'epoch' + round(EXTRACT(EPOCH FROM g.date_time) &lt;br /&gt;
                 / (60*60*3))::integer * INTERVAL '3 hours' limit 1)::ecmwf.forecast) as x &lt;br /&gt;
        FROM   gps.gps_tracking_data g&lt;br /&gt;
             , gps.individual i&lt;br /&gt;
             , gps.track_session t&lt;br /&gt;
        WHERE g.ptt_id = t.ptt_id &lt;br /&gt;
          AND g.date_time &amp;gt;= t.start_date &lt;br /&gt;
          AND i.ring_number = t.ring_number &lt;br /&gt;
          AND g.parser_qc = 1 &lt;br /&gt;
          AND g.ptt_id = 41745&lt;br /&gt;
          AND g.latitude &amp;lt;&amp;gt; 0&lt;br /&gt;
          ORDER BY g.date_time) t&lt;br /&gt;
&lt;br /&gt;
=== Interpolation ===&lt;br /&gt;
&lt;br /&gt;
The following functions are added so thast simple linear interpolation for a specific point in space and time can be done in Postgres. &lt;br /&gt;
&lt;br /&gt;
These are '''ecmwf.forecast_interpolate''' and '''ecmwf.analysis_interpolate''' and they take a latitude, longitude and timestamp as parameter. &lt;br /&gt;
&lt;br /&gt;
They can be used in the same way:&lt;br /&gt;
&lt;br /&gt;
  select * from ecmwf.forecast_interpolate( 52.35983, 5.615, timestamp '2008-05-19 13:34:00');&lt;br /&gt;
   &lt;br /&gt;
  select * from ecmwf.analysis_interpolate( 52.35983, 5.615, timestamp '2008-05-19 13:34:00');&lt;br /&gt;
&lt;br /&gt;
And they can also be used in joins as above. These functions select the 8 surrounding points in latitude, longitude and date_time and interpolate linear in latitude, longitude and date_time successively. The '''interpolate''' functions are much slower then the '''nearest''' functions.&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=ECMWF&amp;diff=315</id>
		<title>ECMWF</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=ECMWF&amp;diff=315"/>
				<updated>2010-01-25T16:42:25Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* FORECAST */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ECMWF == &lt;br /&gt;
&lt;br /&gt;
Datamodel for the tables in the ECMWF schema. &lt;br /&gt;
&lt;br /&gt;
Data is created by the ECMWF and retrieved from the KNMI ftp site as GRIB files. The original GRIB files can also be  retrieved from the flysafe server from :&lt;br /&gt;
&lt;br /&gt;
[https://flysafe-pps.grid.sara.nl/archive/knmi/ecmwf/ ECMWF Data Archive]&lt;br /&gt;
&lt;br /&gt;
More information about the parameters in these GRIB files can be retrieved from the [http://www.ecmwf.int/services/dissemination/3.1/Products_in_GRIB_code.html ECMWF website].&lt;br /&gt;
&lt;br /&gt;
== INVARIABLE == &lt;br /&gt;
&lt;br /&gt;
The INVARIABLE table contains data that is invariant over time. &lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''LATITUDE''' || degrees * 100 to make this a integer&lt;br /&gt;
|-&lt;br /&gt;
|'''LONGITUDE''' || degrees * 100 to make this a integer&lt;br /&gt;
|-&lt;br /&gt;
|Z || 129 Z Geopotential surface/model orography 				&lt;br /&gt;
|-&lt;br /&gt;
|LSM || 172 LSM	Land sea mask				&lt;br /&gt;
|-&lt;br /&gt;
|LOCATION || Latitude/longitude as GIS location  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The GIS LOCATION is only added to this table. This is because always the same values for latitude and  longitude are used and then if the GIS location is required for the ANALYSIS or FORECAST tables it can be retrieved by joining to this table on the LATITUDE, LONGUTUDE fields.&lt;br /&gt;
&lt;br /&gt;
== FORECAST and UVA_FORECAST == &lt;br /&gt;
&lt;br /&gt;
The FORECAST table contains predicted values in steps of 3 hours till 72 hours ahead. The MODELTS is the timestamp for which this prediction applies. Two times a day new Forecast GRIB files will arrive. The newer FORECAST data that arrives for the same timestamp will overwrite the older data.&lt;br /&gt;
&lt;br /&gt;
The FORECAST (and UVA_FORECAST) table itself is a master table that does not contain any data. The inherited tables &lt;br /&gt;
FORECAST&amp;lt;YEAR&amp;gt;&amp;lt;MONTH&amp;gt; contain the data, but the master FORECAST or UVA_FORECAST table can be used to SELECT the data. &lt;br /&gt;
&lt;br /&gt;
Data till 2009-09 is owned by the UvA and can be accessed by anybody with ECMWF_READ rights by using the FORECAST_UVA table. The FORECAST table itself also references data after 2009-09 that is owned by RNLAF for which special access rights ECMWF_RNLAF_READ are required. &lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''MODELTS'''||Time for which this forecast applies = model run + step hours&lt;br /&gt;
|-&lt;br /&gt;
|'''LATITUDE'''||degrees * 100 to make this a integer&lt;br /&gt;
|-&lt;br /&gt;
|'''LONGITUDE'''||degrees * 100 to make this a integer&lt;br /&gt;
|-&lt;br /&gt;
|STEP||model step (smaller is more recent forecast)&lt;br /&gt;
|-&lt;br /&gt;
|SSRD||169 SSRD	surface solar radiation downwards accumulated			&lt;br /&gt;
|-&lt;br /&gt;
|TP||228 TP	total precipitation accumulated			&lt;br /&gt;
|-&lt;br /&gt;
|SP||134 SP	surface pressure		&lt;br /&gt;
|-&lt;br /&gt;
|BLH||159 BLH	boundary layer height		&lt;br /&gt;
|-&lt;br /&gt;
|TCC||164 TCC	total cloud coverage		&lt;br /&gt;
|-&lt;br /&gt;
|U10||165 10U	10 meters wind U-component		&lt;br /&gt;
|-&lt;br /&gt;
|V10||166 10V	10 meters wind V-component		&lt;br /&gt;
|-&lt;br /&gt;
|T2||167 2T	2 metres air temperature		&lt;br /&gt;
|-&lt;br /&gt;
|D2||168 2D	2 metres dew point temperature		&lt;br /&gt;
|-&lt;br /&gt;
|LCC||186 LCC	low cloud coverage		&lt;br /&gt;
|-&lt;br /&gt;
|''Pressure level 1000''||&lt;br /&gt;
|-&lt;br /&gt;
|T_1000||130 T	temperature	&lt;br /&gt;
|-&lt;br /&gt;
|U_1000||131 U	U-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|V_1000||132 V	V-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|GH_1000||156 GH	geopotential height	&lt;br /&gt;
|-&lt;br /&gt;
|R_1000||157 R	relative humidity	&lt;br /&gt;
|-&lt;br /&gt;
|''Pressure level 925''||&lt;br /&gt;
|-&lt;br /&gt;
|T_925 real||130 T	temperature	&lt;br /&gt;
|-&lt;br /&gt;
|U_925 real||131 U	U-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|V_925 real||132 V	V-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|GH_925 real||156 GH	geopotential height	&lt;br /&gt;
|-&lt;br /&gt;
|R_925 real||157 R	relative humidity	&lt;br /&gt;
|-&lt;br /&gt;
|''Pressure level 850''||&lt;br /&gt;
|-&lt;br /&gt;
|T_850||130 T	temperature	&lt;br /&gt;
|-&lt;br /&gt;
|U_850 real||131 U	U-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|V_850 real||132 V	V-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|GH_850 real||156 GH	geopotential height	&lt;br /&gt;
|-&lt;br /&gt;
|R_850 real||157 R	relative humidity	&lt;br /&gt;
|-&lt;br /&gt;
|''Pressure level 700''||&lt;br /&gt;
|-&lt;br /&gt;
|T_700 real||130 T	temperature	&lt;br /&gt;
|-&lt;br /&gt;
|U_700 real||131 U	U-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|V_700 real||132 V	V-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|GH_700 real||156 GH	geopotential height	&lt;br /&gt;
|-&lt;br /&gt;
|R_700 real||157 R	relative humidity	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ANALYSIS ==&lt;br /&gt;
&lt;br /&gt;
The ANALYSIS table contains values from the Analysis GRIB files at 18, 00, 06 and 12 UTC&lt;br /&gt;
 &lt;br /&gt;
{|border=1&lt;br /&gt;
|'''MODELTS'''||Time for which this forecast applies = model run&lt;br /&gt;
|-&lt;br /&gt;
|'''LATITUDE'''||degrees * 100 to make this a integer&lt;br /&gt;
|-&lt;br /&gt;
|'''LONGITUDE'''||degrees * 100 to make this a integer&lt;br /&gt;
|-&lt;br /&gt;
|SP||134 SP	surface pressure		&lt;br /&gt;
|-&lt;br /&gt;
|TCC||164 TCC	total cloud coverage		&lt;br /&gt;
|-&lt;br /&gt;
|U10||165 10U	10 meters wind U-component		&lt;br /&gt;
|-&lt;br /&gt;
|V10||166 10V	10 meters wind V-component		&lt;br /&gt;
|-&lt;br /&gt;
|T2||167 2T	2 metres air temperature		&lt;br /&gt;
|-&lt;br /&gt;
|D2||168 2D	2 metres dew point temperature		&lt;br /&gt;
|-&lt;br /&gt;
|LCC||186 LCC	low cloud coverage		&lt;br /&gt;
|-&lt;br /&gt;
|''Pressure level 1000''||&lt;br /&gt;
|-&lt;br /&gt;
|T_1000||130 T	temperature	&lt;br /&gt;
|-&lt;br /&gt;
|U_1000||131 U	U-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|V_1000||132 V	V-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|GH_1000||156 GH	geopotential height	&lt;br /&gt;
|-&lt;br /&gt;
|R_1000||157 R	relative humidity	&lt;br /&gt;
|-&lt;br /&gt;
|Pressure level 925||&lt;br /&gt;
|-&lt;br /&gt;
|T_925||130 T	temperature	&lt;br /&gt;
|-&lt;br /&gt;
|U_925||131 U	U-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|V_925||132 V	V-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|GH_925||156 GH	geopotential height	&lt;br /&gt;
|-&lt;br /&gt;
|R_925||157 R	relative humidity	&lt;br /&gt;
|-&lt;br /&gt;
|Pressure level 850||&lt;br /&gt;
|-&lt;br /&gt;
|T_850||130 T	temperature	&lt;br /&gt;
|-&lt;br /&gt;
|U_850||131 U	U-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|V_850||132 V	V-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|GH_850||156 GH	geopotential height	&lt;br /&gt;
|-&lt;br /&gt;
|R_850||157 R	relative humidity	&lt;br /&gt;
|-&lt;br /&gt;
|Pressure level 700||&lt;br /&gt;
|-&lt;br /&gt;
|T_700||130 T	temperature	&lt;br /&gt;
|-&lt;br /&gt;
|U_700||131 U	U-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|V_700||132 V	V-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|GH_700||156 GH	geopotential height	&lt;br /&gt;
|-&lt;br /&gt;
|R_700||157 R	relative humidity&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== COMBINED == &lt;br /&gt;
&lt;br /&gt;
If you want to use Analysis data if available for a timestimp but otherwise Forecast, the COMBINED VIEW can be used. If a ANALYSIS value is available for a timestamp and latitude/longitude the ANALYSIS value will be used, otherwise the FORECAST value is given.&lt;br /&gt;
&lt;br /&gt;
== Historical data == &lt;br /&gt;
&lt;br /&gt;
In addition ongoing process of adding ECMWF data since November 11 2007, a historical data set has been loaded.  That historical dataset is stored in additional inherited tables FORECASTHISTORY and&lt;br /&gt;
ANALYSISHISTORY which inherit from FORECAST and ANALYSIS respectively. &lt;br /&gt;
&lt;br /&gt;
The FORECASTHISTORY does not always contain TP (228 TP total precipitation accumulated).  Instead of this it contains the following values :&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|LSP||142 LSP Large scale precipitation&lt;br /&gt;
|-&lt;br /&gt;
|CP||143 CP Convective precipitation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The historical dat sets span the following periods and locations &lt;br /&gt;
&lt;br /&gt;
{|border=1 &lt;br /&gt;
|'''Start'''||'''End'''||'''Area'''||'''Grid'''&lt;br /&gt;
|-&lt;br /&gt;
|2007-01-01||2007-11-15||62degN 10degW 335degN 20degE||0.25x0.25deg&lt;br /&gt;
|-&lt;br /&gt;
|2003-02-15||2003-06-15||62degN 10degW 335degN 20degE||0.5x0.5deg&lt;br /&gt;
|-&lt;br /&gt;
|2005-01-01||2006-12-31||62degN 10degW 335degN 20degE||0.5x0.5deg&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Helpful Functions == &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following functions have been defined in Postgres to select the nearest gridpoint in spacetime for the ECMWF analysis and forecast tables. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are '''ecmwf.forecast_nearest''' and '''ecmwf.analysis_nearest''' and they take a latitude, longitude and timestamp as parameter. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They can be used in the following way:&lt;br /&gt;
&lt;br /&gt;
  select * from ecmwf.forecast_nearest( 52.35983, 5.615, timestamp '2008-05-19 13:34:00');&lt;br /&gt;
   &lt;br /&gt;
  select * from ecmwf.analysis_nearest( 52.35983, 5.615, timestamp '2008-05-19 13:34:00');&lt;br /&gt;
&lt;br /&gt;
These function can for example be used in a join as follows :&lt;br /&gt;
&lt;br /&gt;
  SELECT g.ptt_id&lt;br /&gt;
       , g.date_time&lt;br /&gt;
       , g.latitude&lt;br /&gt;
       , g.longitude&lt;br /&gt;
       , g.speed&lt;br /&gt;
       , g.course&lt;br /&gt;
       , g.altitude&lt;br /&gt;
       , (ecmwf.forecast_nearest( g.latitude, g.longitude,g.date_time)).*&lt;br /&gt;
  FROM gps.gps_tracking_data g&lt;br /&gt;
     , gps.individual i&lt;br /&gt;
     , gps.track_session t&lt;br /&gt;
  WHERE g.ptt_id = t.ptt_id &lt;br /&gt;
    AND g.date_time &amp;gt;= t.start_date &lt;br /&gt;
    AND i.ring_number = t.ring_number &lt;br /&gt;
    AND g.parser_qc = 1 &lt;br /&gt;
    AND g.ptt_id = 41745 &lt;br /&gt;
    AND g.latitude &amp;lt;&amp;gt; 0&lt;br /&gt;
  ORDER BY g.date_time;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Although these functions were converted to PLPgSQL to speed them up, a faster ways to retrieve the same data is with (thanks to Floris Sluiters): &lt;br /&gt;
&lt;br /&gt;
  SELECT ptt_id, date_time, latitude, longitude, speed, course, altitude, (x::ecmwf.forecast).*&lt;br /&gt;
  FROM (SELECT &lt;br /&gt;
       g.*&lt;br /&gt;
       ,((SELECT f &lt;br /&gt;
            FROM ecmwf.forecast f&lt;br /&gt;
           WHERE f.latitude = round(g.latitude * 100 / 25)::integer * 25&lt;br /&gt;
             AND f.longitude =  round(g.longitude * 100 / 25)::integer * 25&lt;br /&gt;
             AND f.modelts = TIMESTAMP 'epoch' + round(EXTRACT(EPOCH FROM g.date_time) &lt;br /&gt;
                 / (60*60*3))::integer * INTERVAL '3 hours' limit 1)::ecmwf.forecast) as x &lt;br /&gt;
        FROM   gps.gps_tracking_data g&lt;br /&gt;
             , gps.individual i&lt;br /&gt;
             , gps.track_session t&lt;br /&gt;
        WHERE g.ptt_id = t.ptt_id &lt;br /&gt;
          AND g.date_time &amp;gt;= t.start_date &lt;br /&gt;
          AND i.ring_number = t.ring_number &lt;br /&gt;
          AND g.parser_qc = 1 &lt;br /&gt;
          AND g.ptt_id = 41745&lt;br /&gt;
          AND g.latitude &amp;lt;&amp;gt; 0&lt;br /&gt;
          ORDER BY g.date_time) t&lt;br /&gt;
&lt;br /&gt;
=== Interpolation ===&lt;br /&gt;
&lt;br /&gt;
The following functions are added so thast simple linear interpolation for a specific point in space and time can be done in Postgres. &lt;br /&gt;
&lt;br /&gt;
These are '''ecmwf.forecast_interpolate''' and '''ecmwf.analysis_interpolate''' and they take a latitude, longitude and timestamp as parameter. &lt;br /&gt;
&lt;br /&gt;
They can be used in the same way:&lt;br /&gt;
&lt;br /&gt;
  select * from ecmwf.forecast_interpolate( 52.35983, 5.615, timestamp '2008-05-19 13:34:00');&lt;br /&gt;
   &lt;br /&gt;
  select * from ecmwf.analysis_interpolate( 52.35983, 5.615, timestamp '2008-05-19 13:34:00');&lt;br /&gt;
&lt;br /&gt;
And they can also be used in joins as above. These functions select the 8 surrounding points in latitude, longitude and date_time and interpolate linear in latitude, longitude and date_time successively. The '''interpolate''' functions are much slower then the '''nearest''' functions.&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=314</id>
		<title>UvAGPS</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=UvAGPS&amp;diff=314"/>
				<updated>2010-01-22T10:19:49Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* get_uvagps_track_distance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= UvAGPS Data Model =&lt;br /&gt;
&lt;br /&gt;
For different versions of the UvAGPS firmware different tables are used. For firmware version v0.9.3.6 till v1.0.0.X the tables UVA_ENGINEERING_DATA and UVA_TRACKING_DATA are used. But in the new firmware versions 1.0.1.4 till 1.0.2.4 so much information was added  that new tables were introduced. However for the most important tracking tables a view is created so that all similar tracking for all types of firmware can be seen in one view. That is the UVA_TRACKING view. &lt;br /&gt;
&lt;br /&gt;
All tables, views and functions are also in the GPS schema.&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float8||||||Horizontal accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float8||||||Vertical accuracy (m)&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||float8||||||m&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration||Float8||||||x axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) movement to right is + and to left is -&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration||Float8||||||y axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) forward movement is + and backwards is -&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration||Float8||||||z axis acceleration (m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;2) upwards movement is + downwards is -&lt;br /&gt;
|-&lt;br /&gt;
|speed ||float8||||||m/s&lt;br /&gt;
|-&lt;br /&gt;
|course||float8||||||Degrees&lt;br /&gt;
|-&lt;br /&gt;
|pressure||float8||||||Pressure sensor (pascal)&lt;br /&gt;
|-&lt;br /&gt;
|temperature||Float8||||||Degrees celcius&lt;br /&gt;
|-&lt;br /&gt;
|solar_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|battery_voltage||Float8||||||V&lt;br /&gt;
|-&lt;br /&gt;
|quality||text||||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|  “&amp;quot;location”&amp;quot;||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENGINEERING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Engineering data from UvA GPS tags for older firmware&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|t_syncsts||smallint||||||0: not synced, 1: user synced, 2: Gps synced&lt;br /&gt;
|-&lt;br /&gt;
|t_entzt||smallint||||||0: UCT time,1: TZT time (timezone time)&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentrategps||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratecom||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|gzp_currentratepwr||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagesolarpanel||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_voltagebattery||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|sbm_chargemode||int2||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainrategps||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratecom||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|egzp_mainratepwr||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smg_esavegpsrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_on||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_off||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|smz_esavecomrate||integer||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsnavigationmode||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtimeout||smallint||||||&lt;br /&gt;
|-&lt;br /&gt;
|eh||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_DEVICE == &lt;br /&gt;
&lt;br /&gt;
To be able to track the different firmware versions for the different devices the UVA_DEVICE table was added.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL ||&lt;br /&gt;
|- &lt;br /&gt;
| firmware_version || text |||| NOT NULL ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_COMM101 == &lt;br /&gt;
&lt;br /&gt;
Communication table indicates status and result of communications with ground stations. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| device_info_serial || integer || PK || NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
| date_time || timestamp || PK || NOT NULL || timestamp of start communication&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end || timestamp |||||| timestamp of end communication           &lt;br /&gt;
|-&lt;br /&gt;
| date_time_utc || timestamp |||||| date_time in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| date_time_end_utc || timestamp |||||| date_time_end in utc (if available)&lt;br /&gt;
|-&lt;br /&gt;
| action || text|||||| JOINED / RESCHEDULE  ??&lt;br /&gt;
|-&lt;br /&gt;
| bytes_communicated || integer |||||| Number of bytes communicated (total of all bytes per DATA line)  &lt;br /&gt;
|-&lt;br /&gt;
|status || text |||||| READY, TIMEOUT, LOWPOWER, MISSING&lt;br /&gt;
|-&lt;br /&gt;
| network_join_time || integer||||||milliseconds&lt;br /&gt;
|-&lt;br /&gt;
| number_identical_lines || integer |||||| Number identical lines in data block. Gives indication &lt;br /&gt;
|-&lt;br /&gt;
| non_ascii_char || integer |||||| Number of non ascii characters (indicated by question-mark ?)&lt;br /&gt;
|-&lt;br /&gt;
| sts_time || timestamp |||||| derived from S0 hh,mi&lt;br /&gt;
|-&lt;br /&gt;
| timesynced || smallint|||||| TimeSynced (0=not sy:wnced, 1=user set, 2=Gps Synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode || smallint||||||DeviceMode (0-99)&lt;br /&gt;
|-&lt;br /&gt;
| vbat || float |||||| Battery voltage in V (0-~4.200V) &lt;br /&gt;
|-&lt;br /&gt;
|logb || integer |||||| logged bytes, waiting for download (0-4Mbyte)&lt;br /&gt;
|-&lt;br /&gt;
| logp || smallint |||||| Logged percentage (units 0.1%) of memory waiting to be downloaded (0-1000)&lt;br /&gt;
|-&lt;br /&gt;
| gpsii || integer |||||| GpsIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|comii || integer|||||| ComIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| AcceleroIval, current (0-65535)&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| User switches, current (0-65535) &lt;br /&gt;
|-&lt;br /&gt;
|last_gps_fix ||timestamp||||||timestamp of last fix&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||Latitude of last fix. Decimal degrees &lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||Longitude of last fix. Decimal degrees&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_SETTINGS101  == &lt;br /&gt;
&lt;br /&gt;
Settings are either from C0-C1-C9 lines or parsed from uplink communication lines &lt;br /&gt;
If C0-C1 is parsed its values are compared with the previous value and if the settings are the &lt;br /&gt;
same no new records needs to be added &lt;br /&gt;
If uplink settings are parsed wait till the last setting has been seen, (DL command or EOF) &lt;br /&gt;
then store all the new settings in one record. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||Derive timestamp from Hh:mi fields in C0 combined with computer timestamp in JOINED line&lt;br /&gt;
|-&lt;br /&gt;
|timesynced || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|timezone_time || smallint ||||||&lt;br /&gt;
|-&lt;br /&gt;
|swddd || integer|||||| SpecialUserSwitches &lt;br /&gt;
|-&lt;br /&gt;
|gpsnavmode || smallint|||||| GpsNavMode 0-7&lt;br /&gt;
|-&lt;br /&gt;
|gpsreceivermode || smallint |||||| GpsReceiverNode 0-3&lt;br /&gt;
|-&lt;br /&gt;
|gpsfixtime || smallint|||||| GpsFixTime 0-255&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_h || smallint|||||| hours Gps IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln_on_m || smallint|||||| minutes Gps IvalN on &lt;br /&gt;
|-&lt;br /&gt;
|gps_ivaln  || integer|||||| GpsIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_h || smallint|||||| hours Gps IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale_on_m || smallint|||||| minutes GpS IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|gps_ivale  || integer|||||| GpsIvalE &lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_h || smallint|||||| hours Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln_on_m || smallint|||||| minutes Com IvalN on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivaln || integer|||||| ComIvalN (0-65530)&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_h || smallint|||||| hours Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale_on_m || smallint|||||| minutes Com IvalE on&lt;br /&gt;
|-&lt;br /&gt;
|com_ivale || integer|||||| ComIvalE&lt;br /&gt;
|-&lt;br /&gt;
|accii || integer|||||| Accelero measurement interval         &lt;br /&gt;
|-&lt;br /&gt;
|accbn || integer|||||| Accelero number of blocks &lt;br /&gt;
|-&lt;br /&gt;
|accsn || integer|||||| Accelero number of samples (0-65536)&lt;br /&gt;
|-&lt;br /&gt;
|f || smallint||||||Accelero sample frequency  (0=20Hz, 1=10Hz, 2=5Hz, 3=1Hz)&lt;br /&gt;
|-&lt;br /&gt;
|pdp || smallint|||||| PdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|pac||smallint|||||| PaccMsk (10-100)&lt;br /&gt;
|-&lt;br /&gt;
|tdp ||smallint|||||| TdopMsk (3-250)&lt;br /&gt;
|-&lt;br /&gt;
|tac ||smallint|||||| TaccMsk (30-300)&lt;br /&gt;
|-&lt;br /&gt;
|ga || smallint|||||| Additional Fixes GpsIval mode (3-25) before interval fix is logged&lt;br /&gt;
|-&lt;br /&gt;
|aol || smallint||||||AccMemOffLev (100 - 950) units 0.1%; if Memfull above  this level all Accelero activity will be overruled and switched off untill MemFull &amp;lt; level - 5&lt;br /&gt;
|-&lt;br /&gt;
|eventnum || text|||||| 12 eventnumbers (0-0xff) only printed if not zero, therfore converted to text&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_DATA101 ==&lt;br /&gt;
&lt;br /&gt;
The tracking dat for newer firmware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude ||float||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||integer||||||heigth above sealevel meters&lt;br /&gt;
|-&lt;br /&gt;
|pressure ||integer||||||in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature ||float||||||in celcius degrees&lt;br /&gt;
|-&lt;br /&gt;
|satellites_used ||smallint||||||satellites used for fix &lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime ||float||||||GpsFixTime in seconds &lt;br /&gt;
|-&lt;br /&gt;
|positiondop ||float||||||Position DOP in units&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy || float||||||Horizontal accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy || float||||||Vertical accuracy (units of meter)&lt;br /&gt;
|-&lt;br /&gt;
|x_speed ||float||||||Speed in x-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|y_speed ||float||||||Speed in y-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|z_speed ||float||||||Speed in z-axis (m/s)&lt;br /&gt;
|-&lt;br /&gt;
|speed_accuracy || float||||||Speed accuracy (m/s) &lt;br /&gt;
|-&lt;br /&gt;
|location || geometry |||||| lat/long as PostGIS geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_ACCELERATION101 == &lt;br /&gt;
&lt;br /&gt;
Acceleration entries if accelerometer was turned on. Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|index ||smallint||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|x_acceleration ||smallint||||||acceleration in X-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|y_acceleration ||smallint||||||acceleration in Y-axis (-2666 till 2666)&lt;br /&gt;
|-&lt;br /&gt;
|z_acceleration ||smallint||||||acceleration in Z-axis (-2666 till 2666)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_ENERGY101 ==&lt;br /&gt;
&lt;br /&gt;
Only for newer firmware.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|timesynced ||smallint||||||TimeSynced (0=not synced, 1=user set, 2=Gps synced)&lt;br /&gt;
|-&lt;br /&gt;
|devicemode ||smallint||||||(0-99)&lt;br /&gt;
|-&lt;br /&gt;
|vsll ||float||||||Solar Voltage during charging in mV (0-~2500)&lt;br /&gt;
|-&lt;br /&gt;
|vbat ||float||||||Battery Voltage in V (0-~4.200)&lt;br /&gt;
|-&lt;br /&gt;
|ssw ||smallint|||||| Solar Cell Switches ... (0-255) fw1022 and up &lt;br /&gt;
|-&lt;br /&gt;
| ||||||||extended fields if special user switch is on &lt;br /&gt;
|-&lt;br /&gt;
|vsoo ||float|||||| Solar voltage open in V (0-~2.500)&lt;br /&gt;
|-&lt;br /&gt;
|vdrf ||float||||||reference voltage Dac in V (0-~2.435)&lt;br /&gt;
|-&lt;br /&gt;
|vchr ||float||||||charge current voltage&lt;br /&gt;
|-&lt;br /&gt;
|g ||smallint|||||| Gps battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|c || smallint||||||Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|m || smallint||||||Charge Mode (0,1,2 Com battery threshold OK&lt;br /&gt;
|-&lt;br /&gt;
|pressure || integer|||||| in pascal (1mBar = 100Pa, 1pressuremeter = ~12Pa)&lt;br /&gt;
|-&lt;br /&gt;
|temperature || float|||||| in celcius degrees   &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING == &lt;br /&gt;
&lt;br /&gt;
View to show identical fields for older and newer firmware tracking data&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|device_info_serial||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date_time||timestamp||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|altitude||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|pressure||integer|||||&lt;br /&gt;
|-&lt;br /&gt;
|temperature||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|h_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|v_accuracy||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|x_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|y_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|z_speed||float||||||meters/second&lt;br /&gt;
|-&lt;br /&gt;
|gps_fixtime||float||||||&lt;br /&gt;
|-&lt;br /&gt;
|location||geometry||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UVA_TRACKING_SPEED == &lt;br /&gt;
&lt;br /&gt;
Additional view that computes with the x_speed, y_speed and z_speed components the vnorth, veast and vdown speed components as well as the absolute value speed in meters/second. &lt;br /&gt;
&lt;br /&gt;
In addition to the fields in the UVA_TRACKING view this view adds :&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|vnorth||float||||||- vx * sin(lat) * cos(long) - vy * sin(lat) * sin (long) + vz * cos(lat)&lt;br /&gt;
|-&lt;br /&gt;
|veast||float|||||| - vx * sin(lon) + vy * cos(lon)&lt;br /&gt;
|-&lt;br /&gt;
|vdown||float|||||| - vx * cos(lat) * cos(lon) - vy * cos(lat) * sin(lon) - vz * sin(lat)&lt;br /&gt;
|-&lt;br /&gt;
|speed||float|||||| sqrt(vx^2 + vy^2 + vz^2)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= UvAGPS functions =&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_speed ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters), time-interval, speed (meters/second) and heading (degrees) for a series of subsequent tracking entries with specific device_info_serial.&lt;br /&gt;
For the first entry in the sequence these values will always be missing because they are computed  as the difference between subsequent rows.&lt;br /&gt;
&lt;br /&gt;
Usage examples :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_speed(119);&lt;br /&gt;
&lt;br /&gt;
select t.*, a.distance, a.interval, a.speed, a.direction from gps.get_uvagps_track_speed(119, '2008-01-01 00:00:00', '2010-01-01 00:00:00') a join gps.uva_tracking t using(device_info_serial, date_time);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and heading are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. &lt;br /&gt;
The heading is the initial heading. PostGIS does not calculate the heading, so therefore we don't use PostGIS.&lt;br /&gt;
&lt;br /&gt;
== get_uvagps_track_distance ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) for UvAGPS tracks to arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, 52.1897017, 6.1996606); &lt;br /&gt;
&lt;br /&gt;
select * from gps.get_uvagps_track_distance(119, (select location from gps.uva_tracking where device_info_serial = 119 and date_time = '2009-05-07 19:55:08')); &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here the distance is calculated with the PostGIS distance_sphere function which uses spherical correction.&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=Argos_Data_Model&amp;diff=313</id>
		<title>Argos Data Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=Argos_Data_Model&amp;diff=313"/>
				<updated>2010-01-22T10:19:23Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* get_argosgps_track_distance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GPS Data Model == &lt;br /&gt;
&lt;br /&gt;
Last updated January 5, 2010 Bart Heupers - [[ UvAGPS ]] moved to special page&lt;br /&gt;
&lt;br /&gt;
Updated January 22, 2008 Judy Shamoun-Baranes &lt;br /&gt;
&lt;br /&gt;
'''FLYSAFE TRACKING DATABASE'''&lt;br /&gt;
&lt;br /&gt;
The tracking database will include data from several species. Some species are trapped and then monitored during the breeding season while others are trapped during the winter season. Information is collected on each tracked bird, including biometric measurements. These measurements may be collected more than once. During the breeding season information is also collected about the gull breeding colony itself, location of nests, state of breeding (number of eggs and juveniles) and then juveniles themselves are marked and measured (although not tracked).&lt;br /&gt;
&lt;br /&gt;
In addition, PTTs are often tested before they are actually placed on the birds. This information is also important during analysis and particularly to establish accuracy of data. This data should also be stored in the database. Therefore it is important that this information is stored properly in the database&lt;br /&gt;
&lt;br /&gt;
Units and descriptions should be filled in for all measurements&lt;br /&gt;
&lt;br /&gt;
One way of looking at this structure is considering 3 categories of tables: &lt;br /&gt;
&lt;br /&gt;
# '''lookup tables''' (information stored once) &lt;br /&gt;
# '''session tables''' (stored occasionally) &lt;br /&gt;
# '''observations''' – highest frequency of information.&lt;br /&gt;
&lt;br /&gt;
Primary keys are noted by bold italic text. Foreign keys are noted by italic text in the Field column.&lt;br /&gt;
&lt;br /&gt;
Microwave, will under no circumstances provide information about their checksum calculations. If feasible, SARA will duplicate the procedure and include a flag in the representing the microwave filtered data.&lt;br /&gt;
	&lt;br /&gt;
'''TECHNICAL INFORMATION FROM TAGS'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DEVICE_INFO ==&lt;br /&gt;
&lt;br /&gt;
Table including technical information about tag hardware. &lt;br /&gt;
	&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4||PK||NOT NULL||serial number of PTT provided by Argos and used for communication with Argos satellite&lt;br /&gt;
|-&lt;br /&gt;
|serial ||int4||||NOT NULL||serial number of tag from manufacturer&lt;br /&gt;
|-&lt;br /&gt;
|weight ||int4||||NOT NULL||Unit = grams&lt;br /&gt;
|-&lt;br /&gt;
|type ||text||||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|manufacturer ||text||||||Device manufacturer&lt;br /&gt;
|-&lt;br /&gt;
|hexadecimal_id||text||||||Hexadecimal address, unique for each tag&lt;br /&gt;
|-&lt;br /&gt;
|PAN_id||Text||||||Personal area network ground based tags communicates with&lt;br /&gt;
|-&lt;br /&gt;
|Base_station_id||Int4||||||base station ground based tag communicates with&lt;br /&gt;
|-&lt;br /&gt;
|Remarks||text||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== TRACK_SESSION == &lt;br /&gt;
&lt;br /&gt;
This table includes information about each measurement session and enables inclusion of data from new species and also from the test phase of different tags&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''id '''||int4 ||PK||NOT NULL||unique ID for each usage of a PTT so test and bird with same ptt_id are two separate IDs/indexes&lt;br /&gt;
|-&lt;br /&gt;
|''pttid''||int4 ||FK||NOT NULL||Link to DEVICE_INFO table&lt;br /&gt;
|-&lt;br /&gt;
|''ring_number''||text ||FK||||link to individual table – tests do not have a ring_number&lt;br /&gt;
|-&lt;br /&gt;
|start_date ||timestamptz||||||Date/time (Local) when tracking begins&lt;br /&gt;
|-&lt;br /&gt;
|start_latitude ||float8||||NOT NULL||latitude where tracking begins, unit = dec degress&lt;br /&gt;
|-&lt;br /&gt;
|start_longitude ||float8||||NOT NULL||longitude where tracking begins, unit = dec degrees&lt;br /&gt;
|-&lt;br /&gt;
|start_altitude||Float8||||||Unit = m, include when known, important for testing&lt;br /&gt;
|-&lt;br /&gt;
|end_date||timestamptz||||||End of session if known&lt;br /&gt;
|-&lt;br /&gt;
|time_window ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|time_steps ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|location ||geometry||||||postgreSQL geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== GPS_TRACKING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from GPS sensors on PTT/GPS tags&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|'''date_time'''||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|speed ||float8||||||m/s&lt;br /&gt;
|-&lt;br /&gt;
|course||float8||||||degrees&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||float8||||||m&lt;br /&gt;
|-&lt;br /&gt;
|alt_status||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|quality||text||||||Quality information from sensor&lt;br /&gt;
|-&lt;br /&gt;
|user_QC||text||||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|parser_QC||text||||||Data flagged as unacceptable by Microwave parser&lt;br /&gt;
|-&lt;br /&gt;
|location||geometry||||||postgreSQL geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note : &lt;br /&gt;
&lt;br /&gt;
The parser_QC value can be 1, 2,3,4, 99, or 100. If it 1 the data is OK. If it is 2 or 3 or 4 some form of error correction has been &lt;br /&gt;
performed by the Microwave parser. And if it is 100 no error correction was possible. For reliable results it is advised only to use &lt;br /&gt;
records with parser_QC values of 1&lt;br /&gt;
&lt;br /&gt;
== ARGOS_TRACKING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from Argos sensors&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type '''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4 ||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|'''date_time'''||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|fix ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|latitude1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|latitude2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|msgcount ||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|frequency ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|average_ti ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|satellite ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|max_str ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|location1 ||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|location2 ||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== PTT_ENGINEERING_DATA ==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|'''tx_date_time'''||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|'''satellite_id'''||text ||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|ptt_date_time ||timestamp||||||GMT&lt;br /&gt;
|-&lt;br /&gt;
|activity||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|tx_count||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|temperature||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|battery_voltage||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|gps_fix_time||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|satellite_count||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|hours_reset||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|hours_since_gps_fix||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|mortality_gt||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|seasonal_gt||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|shunt||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In addition the views GPS_TRACKING_SESSION, ARGOS_TRACKING_SESSION, PTT_ENGINEERING_SESSION are which adds the correct track_session.id to the GPS_TRACKING_DATA, ARGOS_TRACKING_DATA and PTT_ENGINEERING_DATA table data.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
'''BIOLOGICAL INFORMATION'''&lt;br /&gt;
&lt;br /&gt;
== INDIVIDUAL ==&lt;br /&gt;
&lt;br /&gt;
Table includes information used to identify an individual&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field	'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ring_number'''||text||PK||NOT NULL||metal ring number&lt;br /&gt;
|-&lt;br /&gt;
|Id||int4||PK||NOT NULL ||auto-insert, unique ID for each individual organism &lt;br /&gt;
|-&lt;br /&gt;
|''NEST_INFO_id''||int4||FK||||link to NEST_INFO, not all specimens are linked to a nest&lt;br /&gt;
|-&lt;br /&gt;
|nest_certainty||int4||||||1 = certain, 0 = not completely certain&lt;br /&gt;
|-&lt;br /&gt;
|species_certainty||int4||||||1 = certain, 0 = not completely certain&lt;br /&gt;
|-&lt;br /&gt;
|ring_number||text||||NOT NULL||metal ring number&lt;br /&gt;
|-&lt;br /&gt;
|color_code||text||||||code for color ring without punctuation&lt;br /&gt;
|-&lt;br /&gt;
|species||text||||NOT NULL||Scientific name (at least genus)&lt;br /&gt;
|-&lt;br /&gt;
|sex||text||||||update if or when known&lt;br /&gt;
|-&lt;br /&gt;
|''FATE_CODEE_id''||textInt4||FK||||Link to FATE_CODE&lt;br /&gt;
|-&lt;br /&gt;
|Remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== FATE_code == &lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|Field	||Type||Key||Constraints||Comments&lt;br /&gt;
|-&lt;br /&gt;
|'''Id'''||'''Int4'''||'''PK'''||||'''auto-insert'''&lt;br /&gt;
|-&lt;br /&gt;
|code ||int4||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|description||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MEASUREMENT ==&lt;br /&gt;
&lt;br /&gt;
Metadata Provided by Sovon is needed to describe how these measurements are taken.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field	'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''id '''||int4||PK||NOT NULL||auto-insert, unique ID for each observation&lt;br /&gt;
|-&lt;br /&gt;
|''ring_number''||text||FK||||link to individual&lt;br /&gt;
|-&lt;br /&gt;
|catch_datetime ||timestamp||||||Local time&lt;br /&gt;
|-&lt;br /&gt;
|release_datetime||timestamp||||||Local time&lt;br /&gt;
|-&lt;br /&gt;
|mass ||float8||||||grams&lt;br /&gt;
|-&lt;br /&gt;
|age ||text||||||AD = adult, JUV = juvenile&lt;br /&gt;
|-&lt;br /&gt;
|wing_length ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_length1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_length2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_height1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_height2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|tarsus_length  ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|total_head||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|observer ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|remarks||text||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Catch_datetime &amp;amp; release_datetime===&lt;br /&gt;
&lt;br /&gt;
During ringing of juveniles only the date was recorded and not the time.  Birds were all released the same day.  Ringing and measuring small chicks in the nest took about 2-5 minutes. Colour ringing and sampling of the larger chicks (from 4 July onwards) took about half an hour (rounding up several chicks and banding, sampling and releasing them together). To avoid leaving fields blank, a standard catch time was noted at 12:00 and a release time of 12:15 before July 4 and 12:30 from July 4 and onwards. ''''comments by Kees Oosterbeek''''&lt;br /&gt;
&lt;br /&gt;
== NEST_INFO ==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|''id''||int4||PK ||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|Species||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||NOT NULL||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||NOT NULL||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|year||Int4||||||Year of breeding season&lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;location&amp;quot;||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|Remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== NEST_OBSERVATION ==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||''''''Comments''''''&lt;br /&gt;
|-&lt;br /&gt;
|''id''||''int4''||PK||NOT NULL ||Auto-insert, unique ID for each observation&lt;br /&gt;
|-&lt;br /&gt;
|''NEST_INFO_id''||''int4''||FK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date||timestamptz ||||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|number_egg||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|number_young||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|pipping||text||||||Activity in egg (peeping or signs of hatching)&lt;br /&gt;
|-&lt;br /&gt;
|attended||text||||||Activity on nest&lt;br /&gt;
|-&lt;br /&gt;
|observer||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Comments:=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Graphical Data Model == &lt;br /&gt;
&lt;br /&gt;
[[Image:Gps_datamodel.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Argos GPS functions = &lt;br /&gt;
&lt;br /&gt;
== get_argosgps_track_speed ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters), time-interval, speed (meter/second) and heading (degrees) for a series of subsequent tracking entries with specific device_info_serial. &lt;br /&gt;
For the first entry in the sequence these values will always be missing because they are computed  as the difference between subsequent rows. &lt;br /&gt;
&lt;br /&gt;
Usage examples :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_argosgps_track_speed(41745, '2008-01-01 00:00:00', '2010-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_speed(41745);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and heading are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. &lt;br /&gt;
The heading is the initial heading. Because PostGIS does not calculate the heading we don't use PostGIS here.&lt;br /&gt;
&lt;br /&gt;
== get_argosgps_track_distance ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) for Argos GPS tracks to arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance(41745, 53.23348333,4.91656)&lt;br /&gt;
&lt;br /&gt;
-- Get distances from nest&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance(41745, (&lt;br /&gt;
  select n.location from gps.nest_info n, gps.track_session s, gps.individual i &lt;br /&gt;
    where i.nest_info_id = n.id &lt;br /&gt;
      and i.ring_number = s.ring_number &lt;br /&gt;
      and s.ptt_id = 41745 limit 1 ))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the distance is calculated with the PostGIS distance_sphere function which uses spherical correction.&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=Argos_Data_Model&amp;diff=312</id>
		<title>Argos Data Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=Argos_Data_Model&amp;diff=312"/>
				<updated>2010-01-22T10:09:44Z</updated>
		
		<summary type="html">&lt;p&gt;Bart: /* get_argosgps_track_speed */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GPS Data Model == &lt;br /&gt;
&lt;br /&gt;
Last updated January 5, 2010 Bart Heupers - [[ UvAGPS ]] moved to special page&lt;br /&gt;
&lt;br /&gt;
Updated January 22, 2008 Judy Shamoun-Baranes &lt;br /&gt;
&lt;br /&gt;
'''FLYSAFE TRACKING DATABASE'''&lt;br /&gt;
&lt;br /&gt;
The tracking database will include data from several species. Some species are trapped and then monitored during the breeding season while others are trapped during the winter season. Information is collected on each tracked bird, including biometric measurements. These measurements may be collected more than once. During the breeding season information is also collected about the gull breeding colony itself, location of nests, state of breeding (number of eggs and juveniles) and then juveniles themselves are marked and measured (although not tracked).&lt;br /&gt;
&lt;br /&gt;
In addition, PTTs are often tested before they are actually placed on the birds. This information is also important during analysis and particularly to establish accuracy of data. This data should also be stored in the database. Therefore it is important that this information is stored properly in the database&lt;br /&gt;
&lt;br /&gt;
Units and descriptions should be filled in for all measurements&lt;br /&gt;
&lt;br /&gt;
One way of looking at this structure is considering 3 categories of tables: &lt;br /&gt;
&lt;br /&gt;
# '''lookup tables''' (information stored once) &lt;br /&gt;
# '''session tables''' (stored occasionally) &lt;br /&gt;
# '''observations''' – highest frequency of information.&lt;br /&gt;
&lt;br /&gt;
Primary keys are noted by bold italic text. Foreign keys are noted by italic text in the Field column.&lt;br /&gt;
&lt;br /&gt;
Microwave, will under no circumstances provide information about their checksum calculations. If feasible, SARA will duplicate the procedure and include a flag in the representing the microwave filtered data.&lt;br /&gt;
	&lt;br /&gt;
'''TECHNICAL INFORMATION FROM TAGS'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DEVICE_INFO ==&lt;br /&gt;
&lt;br /&gt;
Table including technical information about tag hardware. &lt;br /&gt;
	&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4||PK||NOT NULL||serial number of PTT provided by Argos and used for communication with Argos satellite&lt;br /&gt;
|-&lt;br /&gt;
|serial ||int4||||NOT NULL||serial number of tag from manufacturer&lt;br /&gt;
|-&lt;br /&gt;
|weight ||int4||||NOT NULL||Unit = grams&lt;br /&gt;
|-&lt;br /&gt;
|type ||text||||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|manufacturer ||text||||||Device manufacturer&lt;br /&gt;
|-&lt;br /&gt;
|hexadecimal_id||text||||||Hexadecimal address, unique for each tag&lt;br /&gt;
|-&lt;br /&gt;
|PAN_id||Text||||||Personal area network ground based tags communicates with&lt;br /&gt;
|-&lt;br /&gt;
|Base_station_id||Int4||||||base station ground based tag communicates with&lt;br /&gt;
|-&lt;br /&gt;
|Remarks||text||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== TRACK_SESSION == &lt;br /&gt;
&lt;br /&gt;
This table includes information about each measurement session and enables inclusion of data from new species and also from the test phase of different tags&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''id '''||int4 ||PK||NOT NULL||unique ID for each usage of a PTT so test and bird with same ptt_id are two separate IDs/indexes&lt;br /&gt;
|-&lt;br /&gt;
|''pttid''||int4 ||FK||NOT NULL||Link to DEVICE_INFO table&lt;br /&gt;
|-&lt;br /&gt;
|''ring_number''||text ||FK||||link to individual table – tests do not have a ring_number&lt;br /&gt;
|-&lt;br /&gt;
|start_date ||timestamptz||||||Date/time (Local) when tracking begins&lt;br /&gt;
|-&lt;br /&gt;
|start_latitude ||float8||||NOT NULL||latitude where tracking begins, unit = dec degress&lt;br /&gt;
|-&lt;br /&gt;
|start_longitude ||float8||||NOT NULL||longitude where tracking begins, unit = dec degrees&lt;br /&gt;
|-&lt;br /&gt;
|start_altitude||Float8||||||Unit = m, include when known, important for testing&lt;br /&gt;
|-&lt;br /&gt;
|end_date||timestamptz||||||End of session if known&lt;br /&gt;
|-&lt;br /&gt;
|time_window ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|time_steps ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|location ||geometry||||||postgreSQL geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== GPS_TRACKING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from GPS sensors on PTT/GPS tags&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|'''date_time'''||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|speed ||float8||||||m/s&lt;br /&gt;
|-&lt;br /&gt;
|course||float8||||||degrees&lt;br /&gt;
|-&lt;br /&gt;
|altitude ||float8||||||m&lt;br /&gt;
|-&lt;br /&gt;
|alt_status||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|quality||text||||||Quality information from sensor&lt;br /&gt;
|-&lt;br /&gt;
|user_QC||text||||||Data flagged as unacceptable by user&lt;br /&gt;
|-&lt;br /&gt;
|parser_QC||text||||||Data flagged as unacceptable by Microwave parser&lt;br /&gt;
|-&lt;br /&gt;
|location||geometry||||||postgreSQL geometry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note : &lt;br /&gt;
&lt;br /&gt;
The parser_QC value can be 1, 2,3,4, 99, or 100. If it 1 the data is OK. If it is 2 or 3 or 4 some form of error correction has been &lt;br /&gt;
performed by the Microwave parser. And if it is 100 no error correction was possible. For reliable results it is advised only to use &lt;br /&gt;
records with parser_QC values of 1&lt;br /&gt;
&lt;br /&gt;
== ARGOS_TRACKING_DATA ==&lt;br /&gt;
&lt;br /&gt;
Tracking data from Argos sensors&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type '''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4 ||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|'''date_time'''||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|fix ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|latitude1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|latitude2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|longitude2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|msgcount ||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|frequency ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|average_ti ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|satellite ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|max_str ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|location1 ||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|location2 ||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== PTT_ENGINEERING_DATA ==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ptt_id'''||int4||PK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|'''tx_date_time'''||timestamp||PK||NOT NULL||GMT&lt;br /&gt;
|-&lt;br /&gt;
|'''satellite_id'''||text ||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|ptt_date_time ||timestamp||||||GMT&lt;br /&gt;
|-&lt;br /&gt;
|activity||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|tx_count||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|temperature||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|battery_voltage||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|gps_fix_time||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|satellite_count||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|hours_reset||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|hours_since_gps_fix||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|mortality_gt||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|seasonal_gt||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|shunt||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In addition the views GPS_TRACKING_SESSION, ARGOS_TRACKING_SESSION, PTT_ENGINEERING_SESSION are which adds the correct track_session.id to the GPS_TRACKING_DATA, ARGOS_TRACKING_DATA and PTT_ENGINEERING_DATA table data.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
'''BIOLOGICAL INFORMATION'''&lt;br /&gt;
&lt;br /&gt;
== INDIVIDUAL ==&lt;br /&gt;
&lt;br /&gt;
Table includes information used to identify an individual&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field	'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''ring_number'''||text||PK||NOT NULL||metal ring number&lt;br /&gt;
|-&lt;br /&gt;
|Id||int4||PK||NOT NULL ||auto-insert, unique ID for each individual organism &lt;br /&gt;
|-&lt;br /&gt;
|''NEST_INFO_id''||int4||FK||||link to NEST_INFO, not all specimens are linked to a nest&lt;br /&gt;
|-&lt;br /&gt;
|nest_certainty||int4||||||1 = certain, 0 = not completely certain&lt;br /&gt;
|-&lt;br /&gt;
|species_certainty||int4||||||1 = certain, 0 = not completely certain&lt;br /&gt;
|-&lt;br /&gt;
|ring_number||text||||NOT NULL||metal ring number&lt;br /&gt;
|-&lt;br /&gt;
|color_code||text||||||code for color ring without punctuation&lt;br /&gt;
|-&lt;br /&gt;
|species||text||||NOT NULL||Scientific name (at least genus)&lt;br /&gt;
|-&lt;br /&gt;
|sex||text||||||update if or when known&lt;br /&gt;
|-&lt;br /&gt;
|''FATE_CODEE_id''||textInt4||FK||||Link to FATE_CODE&lt;br /&gt;
|-&lt;br /&gt;
|Remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== FATE_code == &lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|Field	||Type||Key||Constraints||Comments&lt;br /&gt;
|-&lt;br /&gt;
|'''Id'''||'''Int4'''||'''PK'''||||'''auto-insert'''&lt;br /&gt;
|-&lt;br /&gt;
|code ||int4||PK||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|description||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MEASUREMENT ==&lt;br /&gt;
&lt;br /&gt;
Metadata Provided by Sovon is needed to describe how these measurements are taken.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field	'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|'''id '''||int4||PK||NOT NULL||auto-insert, unique ID for each observation&lt;br /&gt;
|-&lt;br /&gt;
|''ring_number''||text||FK||||link to individual&lt;br /&gt;
|-&lt;br /&gt;
|catch_datetime ||timestamp||||||Local time&lt;br /&gt;
|-&lt;br /&gt;
|release_datetime||timestamp||||||Local time&lt;br /&gt;
|-&lt;br /&gt;
|mass ||float8||||||grams&lt;br /&gt;
|-&lt;br /&gt;
|age ||text||||||AD = adult, JUV = juvenile&lt;br /&gt;
|-&lt;br /&gt;
|wing_length ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_length1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_length2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_height1 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|bill_height2 ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|tarsus_length  ||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|total_head||float8||||||&lt;br /&gt;
|-&lt;br /&gt;
|observer ||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|remarks||text||||||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Catch_datetime &amp;amp; release_datetime===&lt;br /&gt;
&lt;br /&gt;
During ringing of juveniles only the date was recorded and not the time.  Birds were all released the same day.  Ringing and measuring small chicks in the nest took about 2-5 minutes. Colour ringing and sampling of the larger chicks (from 4 July onwards) took about half an hour (rounding up several chicks and banding, sampling and releasing them together). To avoid leaving fields blank, a standard catch time was noted at 12:00 and a release time of 12:15 before July 4 and 12:30 from July 4 and onwards. ''''comments by Kees Oosterbeek''''&lt;br /&gt;
&lt;br /&gt;
== NEST_INFO ==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|''id''||int4||PK ||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|Species||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|latitude||float8||||NOT NULL||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|longitude||float8||||NOT NULL||Decimal degrees&lt;br /&gt;
|-&lt;br /&gt;
|year||Int4||||||Year of breeding season&lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;location&amp;quot;||geometry||||||postgreSQL geometry&lt;br /&gt;
|-&lt;br /&gt;
|Remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== NEST_OBSERVATION ==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''Field'''||'''Type'''||'''Key'''||'''Constraints'''||''''''Comments''''''&lt;br /&gt;
|-&lt;br /&gt;
|''id''||''int4''||PK||NOT NULL ||Auto-insert, unique ID for each observation&lt;br /&gt;
|-&lt;br /&gt;
|''NEST_INFO_id''||''int4''||FK||NOT NULL ||&lt;br /&gt;
|-&lt;br /&gt;
|date||timestamptz ||||NOT NULL||&lt;br /&gt;
|-&lt;br /&gt;
|number_egg||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|number_young||int4||||||&lt;br /&gt;
|-&lt;br /&gt;
|pipping||text||||||Activity in egg (peeping or signs of hatching)&lt;br /&gt;
|-&lt;br /&gt;
|attended||text||||||Activity on nest&lt;br /&gt;
|-&lt;br /&gt;
|observer||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|remarks||text||||||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Comments:=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Graphical Data Model == &lt;br /&gt;
&lt;br /&gt;
[[Image:Gps_datamodel.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Argos GPS functions = &lt;br /&gt;
&lt;br /&gt;
== get_argosgps_track_speed ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters), time-interval, speed (meter/second) and heading (degrees) for a series of subsequent tracking entries with specific device_info_serial. &lt;br /&gt;
For the first entry in the sequence these values will always be missing because they are computed  as the difference between subsequent rows. &lt;br /&gt;
&lt;br /&gt;
Usage examples :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select * from gps.get_argosgps_track_speed(41745, '2008-01-01 00:00:00', '2010-01-01 00:00:00');&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_speed(41745);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distances and heading are calculated with spherical correction with the Haversine formula as described [http://http://www.movable-type.co.uk/scripts/latlong.html here]. &lt;br /&gt;
The heading is the initial heading. Because PostGIS does not calculate the heading we don't use PostGIS here.&lt;br /&gt;
&lt;br /&gt;
== get_argosgps_track_distance ==&lt;br /&gt;
&lt;br /&gt;
Compute distance (meters) for Argos GPS tracks to arbitrary point in lat/long or geometry location &lt;br /&gt;
&lt;br /&gt;
Example usage :&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance(41745, 53.23348333,4.91656)&lt;br /&gt;
&lt;br /&gt;
-- Get distances from nest&lt;br /&gt;
&lt;br /&gt;
select * from gps.get_argosgps_track_distance(41745, (&lt;br /&gt;
  select n.location from gps.nest_info n, gps.track_session s, gps.individual i &lt;br /&gt;
    where i.nest_info_id = n.id &lt;br /&gt;
      and i.ring_number = s.ring_number &lt;br /&gt;
      and s.ptt_id = 41745 limit 1 ))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the distance is calculated with the PostGIS distance_sphere function whuch uses spherical correction.&lt;/div&gt;</summary>
		<author><name>Bart</name></author>	</entry>

	</feed>