HALEM

This page lists all functions and classes available in the halem module.

Module contents

class halem.BaseRoadmap(number_of_neighbor_layers, vship, WD_min, WVPI, repeat=False, WWL=20, LWL=80, ukc=1.5, optimization_type=None, nodes_index=None, *args, **kwargs)[source]

Bases: ABC, NodeReduction

Absctract Base class for the Roadmap.

Pre-processing function for the HALEM optimizations. In this fucntion the hydrodynamic model and the vessel properties are transformed into weights for the Time dependend Dijkstra function.

number_of_neighbor_layers: number of neigbouring layers for which edges are

created. increasing this number results in a higher directional resolution.

vship: (N (rows) * M (columns)) numpy array that indicates the sailing velocity

in deep water. For which N is the number of discretisations in the load factor, and M is the number of discretisations in the dynamic sailing velocity. For the optimization type cost and co2 N must be larger or equal to 2.

WD_min: numpy array with the draft of the vessel.

Numpy array has the shape of the number of discretisations in the dynamic sailing velocity

WVPI: Numpy array with the total weight of the vessel.

WWL: Width over Water Line of the vessel in meters

LWL: Length over Water Line of the vessel in meters

ukc: Minimal needed under keel clearance in meters.

repeat: Indicator if the roadmap can be repeated (True / False)

True for hydrodynamic models based on a tidal analysis

optimization_type: list of optimization types.

Excluding one or more not needed optimization types can significantly decrease the size of the preprocessing file

nodes_index: Numpy array that contains the indices of the nodes of the reduced

hydrodynamic model. nodes_index is the output of Roadmap.nodes_index. This option allows you to skip the node reduction step if this is already done.

calc_weights_time(edge, i, j, vship, WD_min, WVPI, self_f, compute_cost, compute_co2, number_of_neighbor_layers)[source]

Function that retruns the weight of an arc

static compute_co2(travel_time, speed)[source]

Default cost function for co2.

static compute_cost(travel_time, speed)[source]

Default cost function for price.

static fifo_maker(y, N1)[source]

Makes a FIFO time series from a Non-FIFO time series y: Time series N1: Mask file of the time series

abstract load()[source]
load_hydrodynamic()[source]
static nodes_on_land(nodes, u, v, WD)[source]

Standard function that returns itself

parse()[source]
halem.HALEM_co2(start, stop, t0, vmax, Roadmap)[source]

Implementation of the function HALEM_func() for the least pollutant route.

start: (lon, lat) coordinates of the start location stop: (lon, lat) coordinates of the destination location t0: string that indcates the departure time

(‘day’/’month’/’year’ ‘hour’:’minute’:’seconds’)

vmax: (N (rows) * M (columns)) numpy array that indicates the sailing velocity in deep water.

For which N is the number of discretisations in the load factor, and M is the number of discretisations in the dynamic sailing velocity

For the optimization type cost and co2 N must be larger or equal to 2.

Roadmap: Preprocessing file that contains the hydrodynamic properties.

halem.HALEM_cost(start, stop, t0, vmax, Roadmap)[source]

Implementation of the function HALEM_func() for the cheapest route.

start: (lon, lat) coordinates of the start location stop: (lon, lat) coordinates of the destination location t0: string that indcates the departure time

(‘day’/’month’/’year’ ‘hour’:’minute’:’seconds’)

vmax: (N (rows) * M (columns)) numpy array that indicates the sailing velocity in deep water.

For which N is the number of discretisations in the load factor, and M is the number of discretisations in the dynamic sailing velocity

For the optimization type cost and co2 N must be larger or equal to 2.

Roadmap: Preprocessing file that contains the hydrodynamic properties.

halem.HALEM_func(start, stop, t0, vmax, Roadmap, costfunction)[source]

Base of the functions HALEM_time, HALEM_cost, HALEM_space, HALEM_co2. This function takes the pre-processing file, start location, stop location, departure time, and sailing velocity and returns the optimized route.

start: (lon, lat) coordinates of the start location stop: (lon, lat) coordinates of the destination location t0: string that indcates the departure time

(‘day’/’month’/’year’ ‘hour’:’minute’:’seconds’)

vmax: (N (rows) * M (columns)) numpy array that indicates the sailing velocity in deep water.

For which N is the number of discretisations in the load factor, and M is the number of discretisations in the dynamic sailing velocity

For the optimization type cost and co2 N must be larger or equal to 2.

Roadmap: Preprocessing file that contains the hydrodynamic properties. costfunction Costfunction of the route optimization.

Roadmap.weight_time returns fastest route Roadmap.weight_space returns shortest route Roadmap.weight_cost returns cheapest route Roadmap.weight_co2 retruns least pollutant route

halem.HALEM_space(start, stop, t0, vmax, Roadmap)[source]

Implementation of the function HALEM_func() for the shortest route.

start: (lon, lat) coordinates of the start location stop: (lon, lat) coordinates of the destination location t0: string that indcates the departure time

(‘day’/’month’/’year’ ‘hour’:’minute’:’seconds’)

vmax: (N (rows) * M (columns)) numpy array that indicates the sailing velocity in deep water.

For which N is the number of discretisations in the load factor, and M is the number of discretisations in the dynamic sailing velocity

For the optimization type cost and co2 N must be larger or equal to 2.

Roadmap: Preprocessing file that contains the hydrodynamic properties.

halem.HALEM_time(start, stop, t0, vmax, Roadmap)[source]

Implementation of the function HALEM_func() for the fastest route.

start: (lon, lat) coordinates of the start location stop: (lon, lat) coordinates of the destination location t0: string that indcates the departure time

(‘day’/’month’/’year’ ‘hour’:’minute’:’seconds’)

vmax: (N (rows) * M (columns)) numpy array that indicates the sailing velocity in deep water.

For which N is the number of discretisations in the load factor, and M is the number of discretisations in the dynamic sailing velocity

For the optimization type cost and co2 N must be larger or equal to 2.

Roadmap: Preprocessing file that contains the hydrodynamic properties.

halem.plot_timeseries(path, time, Roadmap, Color='r', range_CP=5)[source]

This function can plot the time series for the route and shows a contourplot of the unsaiable areas of that route.

path: lon, lat coordinates of the route.

This is in the format of the output from halem.HALEM_func[0]

time: time series of the path.

This is in the format of the output from halem.HALEM_func[1]

Roadmap: Roadmap that is used to calculate the route. Color: Color of the plot of the time series.

Type sting, with matplotlib color