ELRMileages.get_conn_mileages

ELRMileages.get_conn_mileages(start_elr, end_elr, update=False, pickle_mileage_file=False, data_dir=None, verbose=False)

Get a connection point between two ELR-and-mileage pairs.

Namely, find the end and start mileages for the start and end ELRs, respectively.

Note

This function may not be able find the connection for every pair of ELRs. See the Example 2 below.

Parameters
  • start_elr (str) – start ELR

  • end_elr (str) – end ELR

  • update (bool) – whether to do an update check (for the package data), defaults to False

  • pickle_mileage_file (bool) – whether to save the data as a pickle file, defaults to False

  • data_dir (str or None) – name of a folder where the pickle file is to be saved, defaults to None

  • verbose (bool or int) – whether to print relevant information in console, defaults to False

Returns

connection ELR and mileages between the given start_elr and end_elr

Return type

tuple

Example 1:

>>> from pyrcs.line_data import ELRMileages

>>> em = ELRMileages()

>>> conn = em.get_conn_mileages(start_elr='NAY', end_elr='LTN2')
>>> (s_dest_mlg, c_elr, c_orig_mlg, c_dest_mlg, e_orig_mlg) = conn

>>> print(s_dest_mlg)
5.1606
>>> print(c_elr)
NOL
>>> print(c_orig_mlg)
5.1606
>>> print(c_dest_mlg)
0.0638
>>> print(e_orig_mlg)
123.1320

Example 2:

>>> from pyrcs.line_data import ELRMileages

>>> em = ELRMileages()

>>> conn = em.get_conn_mileages('MAC3', 'DBP1')

>>> print(conn)
('', '', '', '', '')