SELKIELogger  1.0.0
SELKIELogger.Specs.LocatorSpec Class Reference

LocatorSpec: String representation of location monitoring settings. More...

Public Member Functions

def __init__ (self, s)
 Split string into components defining location warning settings. More...
 
def check (self, s)
 Check whether locator is within warning threshold or not, based on the data in s More...
 
def __str__ (self)
 
def __repr__ (self)
 

Static Public Member Functions

def haversine (lat1, lon1, lat2, lon2)
 Haversine distance formula, from Wikipedia. More...
 

Public Attributes

 latChan
 ChannelSpec() identifying source of latitude data.
 
 lonChan
 ChannelSpec() identifying source of longitude data.
 
 refLat
 Reference latitude (decimal degrees)
 
 refLon
 Reference longitude (decimal degrees)
 
 threshold
 Warning Distance (m)
 
 name
 Name for this locator (used in reporting)
 

Detailed Description

LocatorSpec: String representation of location monitoring settings.

Definition at line 90 of file Specs.py.

Constructor & Destructor Documentation

◆ __init__()

def SELKIELogger.Specs.LocatorSpec.__init__ (   self,
  s 
)

Split string into components defining location warning settings.

Values are validated to the extent possible without device and source specific information String is a set of comma separated values in this order:

  • Latitude ChannelSpec()
  • Longitude ChannelSpec()
  • Reference Latitude
  • Reference Longitude
  • Warning threshold distance (m)
  • [Optional] Name
    Parameters
    sString in required format.

Definition at line 95 of file Specs.py.

Member Function Documentation

◆ __repr__()

def SELKIELogger.Specs.LocatorSpec.__repr__ (   self)
Returns
Parseable representation

Definition at line 187 of file Specs.py.

◆ __str__()

def SELKIELogger.Specs.LocatorSpec.__str__ (   self)
Returns
Correctly formatted string

Definition at line 183 of file Specs.py.

◆ check()

def SELKIELogger.Specs.LocatorSpec.check (   self,
  s 
)

Check whether locator is within warning threshold or not, based on the data in s

In returned tuple, alert is True if position is unknown or further from the reference position than the warning threshold distance. The distance from the reference point in metres is returned along with the current position in decimal degrees.

Parameters
sState dataframe
Returns
Tuple of form (alert, distance, (lat, lon))

Definition at line 158 of file Specs.py.

◆ haversine()

def SELKIELogger.Specs.LocatorSpec.haversine (   lat1,
  lon1,
  lat2,
  lon2 
)
static

Haversine distance formula, from Wikipedia.

Parameters
lat1Latitude 1 (decimal degrees)
lon1Longitude 1 (decimal degrees)
lat2Latitude 2 (decimal degrees)
lon2Latitude 2 (decimal degrees)
Returns
Distance from 1 -> 2 in metres

Definition at line 135 of file Specs.py.


The documentation for this class was generated from the following file: