Basic API Documentation

This is probably all that will be needed to be accessed from “outside”

Coordinate objects

Three types of objects are used to represent coordinates: tuples, which are assumed to be a row/column pair, UTMCoord, and LatLongCoord. At the moment the assumption is that all Coordinate-representing objects use NAD83, though this can be easily changed. Generally, any function requiring coordinates will accept any of these three types of coordinate objects.

class UTMCoord(easting, northing, zone_number, zone_letter)

Initializes an object representing UTM coordinates of a point

Parameters:
  • easting (float) – Easting value of the coordinate
  • northing (float) – Northing value of the coordinate
  • zone (int) – The zone number of the coordinate
  • zone_letter – The zone letter of the coordinate (future versions may accept “North” or “South” as well)
class LatLongCoord(lat, long)

Initializes an object representing a point by latitude and longitude

Parameters:
  • latitude (float) – Latitude value (values north of the equator are positive, values south are negative)
  • longitude (float) – Longitude value (values east of the prime meridian are positive, values west are negative)

Elevation Map Objects and Methods

loadElevationMap(file, maxSlope = 15, planet = "Earth", NWCorner = None, SECorner = None, desiredRes = None,
no_val = -10000)

Returns a EnvironmentalModel object from a (preferably geoTIFF) file. Parameters from NWCorner and onwards are for downscaling or cropping the geoTIFF file.

ActivityPoint

The ActivityPoint object represents points of interest for the explorer, likely spots for observation or data collection. It’s possible that future versions of Pextant may have extensions of ActivityPoint.

class ActivityPoint(coordinates, duration = 0, uuid = None)

Initialize an ActivityPoint representing a waypoint.

Parameters:
  • coordinates – A tuple representing the location of the waypoint
  • duration (float) – The amount of time spent at the ActivityPoint, in seconds.
  • uuid (string) – A uuid value for the activityPoint
setCoordinates(coordinates)

Sets the coordinates of the ActivityPoint to a new value. This can be a row/column tuple, a UTMCoord, or a LatLongCoord Object.

setDuration(duration)

Sets the duration of the activityPoint.

PathFinder

class PathFinder(explorer_model, environmental_model)

Initialize a PathFinder Object used to calculate and analyse paths.

Parameters:
  • explorer_model – An ExplorerModel object representing the explorer
  • environmental_model – An EnvironmentalModel object representing the map
aStarSearch(start, end, optimize_on)

Returns a path through the start node and the end node using the A* search algorithm.

Parameters:
  • start – An ActivityPoint object, and the starting point of the search.
  • end – Also an ActivityPoint object
  • optimize_on – A string denoting what factor to optimize on, such as “Energy” or “Time”
fieldDStarSearch(start, end, optimize_on, numTestPoints = 11)

Returns a path through the start node and the end node using the Field D* algorithm. Longer processing time than A*, but allows for more than the 8 cardinal directions, resulting in more “fluid” paths.

Parameters:
  • start – An ActivityPoint object, and the starting point of the search.
  • end – Also an ActivityPoint object
  • optimize_on – A string denoting what factor to optimize on, such as “Energy” or “Time”
  • numTestPoints (int) – A number used in the costFunction calculations. Higher values will involve more accuracy but increased time.
aStarCompletePath(optimize_on, activityPoints, returnType = "JSON", fileName = None)

Returns a path through all of the ActivityPoint objects in exploration_objectives in order. The path takes the form of a long list of row/column tuples. Currently runs with the A* search algorithm.

Parameters:
  • optimize_on – Determine what factor to optimize on (can be “Energy”, “Time”, or “Distance”)
  • activityPoitns – A list of activityPoint objects representing the places to visit, in order
  • returnType – A string representing the format of the path to be returned. Options are ‘tuple’, ‘JSON’, and ‘csv’
  • fileName – The optional name of the file to be written to
fieldDStarCompletePath(optimize_on, waypoints, returnType = "JSON", fileName = None, numtestPoints = 11)

Similar to aStarCompletePath, except uses the field D* algorithm. Currently still under development.