ptrail.utilities package

Submodules

ptrail.utilities.DistanceCalculator module

DistanceCalculator module contains various types of distance formulas that can be used to calculate distance between 2 points on the surface of earth depending on the CRS being used.

Authors: Salman Haidri, Yaksh J Haranwala
class ptrail.utilities.DistanceCalculator.FormulaLog[source]

Bases: object

static bearing_calculation(lat1, lon1, lat2, lon2)[source]

Calculates bearing between 2 points. Bearing can be defined as direction or an angle, between the north-south line of earth or meridian and the line connecting the target and the reference point.

Parameters
  • lat1 – The latitude value of point 1.

  • lon1 – The longitude value of point 1.

  • lat2 – The latitude value of point 2.

  • lon2 – The longitude value of point 2.

Returns

Bearing between 2 points

Return type

float

static haversine_distance(lat1, lon1, lat2, lon2)[source]

The haversine formula calculates the great-circle distance between 2 points. The great-circle distance is the shortest distance over the earth’s surface.

Parameters
  • lat1 (float) – The latitude value of point 1.

  • lon1 (float) – The longitude value of point 1.

  • lat2 (float) – The latitude value of point 2.

  • lon2 (float) – The longitude value of point 2.

Returns

The great-circle distance between the 2 points.

Return type

float

ptrail.utilities.constants module

Contains all the default constants needed for initialization. All the constant are of the type string.

ptrail.utilities.conversions module

The conversions modules contains various available methods that can be used to convert given data into another format.

Authors: Yaksh J Haranwala, Salman Haidri
class ptrail.utilities.conversions.Conversions[source]

Bases: object

static convert_directions_to_degree_lat_lon(data, latitude: str, longitude: str)[source]

Convert the latitude and longitude format from degrees (NSEW) to float values. This is used for datasets like the Atlantic Hurricane dataset where the coordinates are not given as float values but are instead given as degrees.

References

“Arina De Jesus Amador Monteiro Sanches. “Uma Arquitetura E Imple-menta ̧c ̃ao Do M ́odulo De Pr ́e-processamento Para Biblioteca Pymove”.Bachelor’s thesis. Universidade Federal Do Cear ́a, 2019”

ptrail.utilities.exceptions module

This file contains all the custom designed exception headers. There is nothing here but the exception headers and pass written inside them. The purpose of the file is to store all exceptions in one place.

Authors: Yaksh J Haranwala, Salman Haidri
exception ptrail.utilities.exceptions.DataTypeMismatchException[source]

Bases: Exception

exception ptrail.utilities.exceptions.DateTimeFormatInvalid[source]

Bases: Exception

exception ptrail.utilities.exceptions.MandatoryColumnException[source]

Bases: Exception

exception ptrail.utilities.exceptions.MissingColumnsException[source]

Bases: Exception

exception ptrail.utilities.exceptions.MissingTrajIDException[source]

Bases: Exception

exception ptrail.utilities.exceptions.NoHeadersException[source]

Bases: Exception

exception ptrail.utilities.exceptions.NotAllowedError[source]

Bases: Exception

Module contents