Package ais :: Module waterlevel
[hide private]
[frames] | no frames]

Module waterlevel

source code

Autogenerated python functions to serialize/deserialize binary messages.

Generated by: ./aisxmlbinmsg2py.py

Need to then wrap these functions with the outer AIS packet and then convert the whole binary blob to a NMEA string. Those functions are not currently provided in this file.

serialize: python to ais binary deserialize: ais binary to python

The generated code uses translators.py, binary.py, and aisstring.py which should be packaged with the resulting files.


Requires:

Author: xmlbinmsg

Version: 4791

Status: under development

License: Generated code has no license

Classes [hide private]
  Testwaterlevel
Use testvalue tag text from each type to build test case the waterlevel message

Functions [hide private]
BitVector encode(params, validate=False)
Create a waterlevel binary message payload to pack into an AIS Msg waterlevel.
dict decode(bv, validate=False)
Unpack a waterlevel message
  decodedac(bv, validate=False)
  decodefid(bv, validate=False)
  decodeefid(bv, validate=False)
  decodetimetag_month(bv, validate=False)
  decodetimetag_day(bv, validate=False)
  decodetimetag_hour(bv, validate=False)
  decodetimetag_min(bv, validate=False)
  decodetimetag_sec(bv, validate=False)
  decodestationid(bv, validate=False)
  decodestationloc_longitude(bv, validate=False)
  decodestationloc_latitude(bv, validate=False)
  decodewaterlevel(bv, validate=False)
  decodedatum(bv, validate=False)
  decodesigma(bv, validate=False)
  decodeo(bv, validate=False)
  decodelevelinferred(bv, validate=False)
  decodeflat_tolerance_exceeded(bv, validate=False)
  decoderate_tolerance_exceeded(bv, validate=False)
  decodetemp_tolerance_exceeded(bv, validate=False)
  decodeexpected_height_exceeded(bv, validate=False)
  decodelink_down(bv, validate=False)
  decodetimeLastMeasured_month(bv, validate=False)
  decodetimeLastMeasured_day(bv, validate=False)
  decodetimeLastMeasured_hour(bv, validate=False)
  decodetimeLastMeasured_min(bv, validate=False)
  decodetimeLastMeasured_sec(bv, validate=False)
stdout printFields(params, out=sys.stdout, format='std')
Print a waterlevel message to stdout.
dict testParams()
Return a params file base on the testvalue tags.

Variables [hide private]
  __date__ = '2006-12-20'
Date of last svn commit
  TrueBV = <BitVector.BitVector object at 0x2230b90>
Why always rebuild the True bit? This should speed things up a bunch
  FalseBV = <BitVector.BitVector object at 0x2230c10>
Why always rebuild the False bit? This should speed things up a bunch
  typeChoices = 'binary', 'nmeapayload', 'nmea'
  msgDict = {'dac': '366', 'fid': '1', 'efid': '12', 'timetag_mo...
  bitLen = len(bits)
  bits = bits+ BitVector(size= (6-(bitLen % 6)))

Function Details [hide private]

encode(params, validate=False)

source code 

Create a waterlevel binary message payload to pack into an AIS Msg waterlevel.

Fields in params:
  • dac(uint): Designated Area Code (field automatically set to "366")
  • fid(uint): Functional Identifier (field automatically set to "1")
  • efid(uint): extended functional identifier (field automatically set to "12")
  • timetag_month(uint): Time the measurement represents month 1..12
  • timetag_day(uint): Time the measurement represents day of the month 1..31
  • timetag_hour(uint): Time the measurement represents UTC hours 0..23
  • timetag_min(uint): Time the measurement represents minutes
  • timetag_sec(uint): Time the measurement represents seconds
  • stationid(aisstr6): Character identifier of the station. Usually a number.
  • stationloc_longitude(decimal): Location of the sensor taking the water level measurement or position of prediction East West location
  • stationloc_latitude(decimal): Location of the sensor taking the water level measurement or position of prediction North South location
  • waterlevel(int): Water level in centimeters
  • datum(uint): What reference datum applies to the value
  • sigma(float): Standard deviation of 1 second samples used to compute the water level height
  • o(uint): Count of number of samples that fall outside a 3-sigma band about the mean
  • levelinferred(bool): indicates that the water level value has been inferred
  • flat_tolerance_exceeded(bool): flat tolerance limit was exceeded. Need better descr
  • rate_tolerance_exceeded(bool): rate of change tolerance limit was exceeded
  • temp_tolerance_exceeded(bool): temperature difference tolerance limit was exceeded
  • expected_height_exceeded(bool): either the maximum or minimum expected water level height limit was exceeded
  • link_down(bool): Unable to communicate with the tide system. All data invalid
  • timeLastMeasured_month(uint): Time since last measured value was available month 1..12
  • timeLastMeasured_day(uint): Time since last measured value was available day of the month 1..31
  • timeLastMeasured_hour(uint): Time since last measured value was available UTC hours 0..23
  • timeLastMeasured_min(uint): Time since last measured value was available minutes
  • timeLastMeasured_sec(uint): Time since last measured value was available seconds
Parameters:
  • params - Dictionary of field names/values. Throws a ValueError exception if required is missing
  • validate - Set to true to cause checking to occur. Runs slower. FIX: not implemented.
Returns: BitVector
encoded binary message (for binary messages, this needs to be wrapped in a msg 8

Note: The returned bits may not be 6 bit aligned. It is up to you to pad out the bits.

decode(bv, validate=False)

source code 

Unpack a waterlevel message

Fields in params:
  • dac(uint): Designated Area Code (field automatically set to "366")
  • fid(uint): Functional Identifier (field automatically set to "1")
  • efid(uint): extended functional identifier (field automatically set to "12")
  • timetag_month(uint): Time the measurement represents month 1..12
  • timetag_day(uint): Time the measurement represents day of the month 1..31
  • timetag_hour(uint): Time the measurement represents UTC hours 0..23
  • timetag_min(uint): Time the measurement represents minutes
  • timetag_sec(uint): Time the measurement represents seconds
  • stationid(aisstr6): Character identifier of the station. Usually a number.
  • stationloc_longitude(decimal): Location of the sensor taking the water level measurement or position of prediction East West location
  • stationloc_latitude(decimal): Location of the sensor taking the water level measurement or position of prediction North South location
  • waterlevel(int): Water level in centimeters
  • datum(uint): What reference datum applies to the value
  • sigma(float): Standard deviation of 1 second samples used to compute the water level height
  • o(uint): Count of number of samples that fall outside a 3-sigma band about the mean
  • levelinferred(bool): indicates that the water level value has been inferred
  • flat_tolerance_exceeded(bool): flat tolerance limit was exceeded. Need better descr
  • rate_tolerance_exceeded(bool): rate of change tolerance limit was exceeded
  • temp_tolerance_exceeded(bool): temperature difference tolerance limit was exceeded
  • expected_height_exceeded(bool): either the maximum or minimum expected water level height limit was exceeded
  • link_down(bool): Unable to communicate with the tide system. All data invalid
  • timeLastMeasured_month(uint): Time since last measured value was available month 1..12
  • timeLastMeasured_day(uint): Time since last measured value was available day of the month 1..31
  • timeLastMeasured_hour(uint): Time since last measured value was available UTC hours 0..23
  • timeLastMeasured_min(uint): Time since last measured value was available minutes
  • timeLastMeasured_sec(uint): Time since last measured value was available seconds
Parameters:
  • bv (BitVector) - Bits defining a message
  • validate - Set to true to cause checking to occur. Runs slower. FIX: not implemented.
Returns: dict
params

decodedac(bv, validate=False)

source code 
None

decodefid(bv, validate=False)

source code 
None

decodeefid(bv, validate=False)

source code 
None

decodetimetag_month(bv, validate=False)

source code 
None

decodetimetag_day(bv, validate=False)

source code 
None

decodetimetag_hour(bv, validate=False)

source code 
None

decodetimetag_min(bv, validate=False)

source code 
None

decodetimetag_sec(bv, validate=False)

source code 
None

decodestationid(bv, validate=False)

source code 
None

decodestationloc_longitude(bv, validate=False)

source code 
None

decodestationloc_latitude(bv, validate=False)

source code 
None

decodewaterlevel(bv, validate=False)

source code 
None

decodedatum(bv, validate=False)

source code 
None

decodesigma(bv, validate=False)

source code 
None

decodeo(bv, validate=False)

source code 
None

decodelevelinferred(bv, validate=False)

source code 
None

decodeflat_tolerance_exceeded(bv, validate=False)

source code 
None

decoderate_tolerance_exceeded(bv, validate=False)

source code 
None

decodetemp_tolerance_exceeded(bv, validate=False)

source code 
None

decodeexpected_height_exceeded(bv, validate=False)

source code 
None

decodelink_down(bv, validate=False)

source code 
None

decodetimeLastMeasured_month(bv, validate=False)

source code 
None

decodetimeLastMeasured_day(bv, validate=False)

source code 
None

decodetimeLastMeasured_hour(bv, validate=False)

source code 
None

decodetimeLastMeasured_min(bv, validate=False)

source code 
None

decodetimeLastMeasured_sec(bv, validate=False)

source code 
None

printFields(params, out=sys.stdout, format='std')

source code 

Print a waterlevel message to stdout.

Fields in params:
  • dac(uint): Designated Area Code (field automatically set to "366")
  • fid(uint): Functional Identifier (field automatically set to "1")
  • efid(uint): extended functional identifier (field automatically set to "12")
  • timetag_month(uint): Time the measurement represents month 1..12
  • timetag_day(uint): Time the measurement represents day of the month 1..31
  • timetag_hour(uint): Time the measurement represents UTC hours 0..23
  • timetag_min(uint): Time the measurement represents minutes
  • timetag_sec(uint): Time the measurement represents seconds
  • stationid(aisstr6): Character identifier of the station. Usually a number.
  • stationloc_longitude(decimal): Location of the sensor taking the water level measurement or position of prediction East West location
  • stationloc_latitude(decimal): Location of the sensor taking the water level measurement or position of prediction North South location
  • waterlevel(int): Water level in centimeters
  • datum(uint): What reference datum applies to the value
  • sigma(float): Standard deviation of 1 second samples used to compute the water level height
  • o(uint): Count of number of samples that fall outside a 3-sigma band about the mean
  • levelinferred(bool): indicates that the water level value has been inferred
  • flat_tolerance_exceeded(bool): flat tolerance limit was exceeded. Need better descr
  • rate_tolerance_exceeded(bool): rate of change tolerance limit was exceeded
  • temp_tolerance_exceeded(bool): temperature difference tolerance limit was exceeded
  • expected_height_exceeded(bool): either the maximum or minimum expected water level height limit was exceeded
  • link_down(bool): Unable to communicate with the tide system. All data invalid
  • timeLastMeasured_month(uint): Time since last measured value was available month 1..12
  • timeLastMeasured_day(uint): Time since last measured value was available day of the month 1..31
  • timeLastMeasured_hour(uint): Time since last measured value was available UTC hours 0..23
  • timeLastMeasured_min(uint): Time since last measured value was available minutes
  • timeLastMeasured_sec(uint): Time since last measured value was available seconds
Parameters:
  • params - Dictionary of field names/values.
  • out - File like object to write to
Returns: stdout
text to out

testParams()

source code 
Return a params file base on the testvalue tags.
Returns: dict
params based on testvalue tags

Variables Details [hide private]

__date__

Date of last svn commit
Value:
'2006-12-20'                                                           
      

TrueBV

Why always rebuild the True bit? This should speed things up a bunch
Value:
<BitVector.BitVector object at 0x2230b90>                              
      

FalseBV

Why always rebuild the False bit? This should speed things up a bunch
Value:
<BitVector.BitVector object at 0x2230c10>                              
      

typeChoices

None
Value:
'binary', 'nmeapayload', 'nmea'                                        
      

msgDict

None
Value:
{'dac': '366', 'fid': '1', 'efid': '12', 'timetag_month': options.time
tag_monthField, 'timetag_day': options.timetag_dayField, 'timetag_hour
': options.timetag_hourField, 'timetag_min': options.timetag_minField,
 'timetag_sec': options.timetag_secField, 'stationid': options.station
idField, 'stationloc_longitude': options.stationloc_longitudeField, 's
tationloc_latitude': options.stationloc_latitudeField, 'waterlevel': o
ptions.waterlevelField, 'datum': options.datumField, 'sigma': options.
sigmaField, 'o': options.oField, 'levelinferred': options.levelinferre
...                                                                    
      

bitLen

None
Value:
len(bits)                                                              
      

bits

None
Value:
bits+ BitVector(size= (6-(bitLen % 6)))