Features.fetch_habds_and_wilds

Features.fetch_habds_and_wilds(update=False, pickle_it=False, data_dir=None, verbose=False)

Fetch codes of HABDs and WILDs from local backup.

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

  • pickle_it (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

data of hot axle box detectors (HABDs) and wheel impact load detectors (WILDs), and date of when the data was last updated

Return type

dict

Example:

>>> from pyrcs.other_assets import Features

>>> features = Features()

>>> # hw_codes_dat = features.fetch_habds_and_wilds(update=True, verbose=True)
>>> hw_codes_dat = features.fetch_habds_and_wilds()

>>> type(hw_codes_dat)
dict
>>> list(hw_codes_dat.keys())
['HABD and WILD', 'Last updated date']

>>> print(features.HabdWildKey)
HABD and WILD

>>> hw_codes = hw_codes_dat[features.HabdWildKey]

>>> type(hw_codes)
dict
>>> list(hw_codes.keys())
['HABD', 'WILD']

>>> habd = hw_codes['HABD']
>>> habd.head()
    ELR  ...                                              Notes
0  BAG2  ...
1  BAG2  ...  installed 29 September 1997, later adjusted to...
2  BAG2  ...                             previously at 74m 51ch
3  BAG2  ...                          removed 29 September 1997
4  BAG2  ...            present in 1969, later moved to 89m 0ch
[5 rows x 5 columns]

>>> wild = hw_codes['WILD']
>>> wild.head()
    ELR  ...                                Notes
0  AYR3  ...
1  BAG2  ...
2  BML1  ...
3  BML1  ...
4  CGJ3  ...  moved to 183m 68ch 8 September 2018
[5 rows x 5 columns]