VesselFile

class HSTB.kluster.fqpr_vessel.VesselFile(filepath=None)

Bases: object

Class to manage the vessel configuration file (.kfc) for Kluster. Holds the tpu parameters and lever arm information for each system in the project. Stored in a nested dictionary that looks like this: serial number1: {sensor_name1: {utc timestamp1: value, utc timestamp2: value, …}, …

Methods Summary

open(filepath)

Open from a Vessel File json instance (vessel configuration file (.kfc))

return_data(serial_number, starttime, endtime)

Get the vessel file timstamped entries that fall within the provided starttime/endtime.

save([filepath])

Save the internal vessel file data to a json file

update(serial_number, data[, carry_over_tpu])

Call to update the internal vessel settings data (still must call save to write to disk).

Methods Documentation

open(filepath)

Open from a Vessel File json instance (vessel configuration file (.kfc))

Parameters

filepath (str) – absolute file path to the vessel file

return_data(serial_number, starttime, endtime)

Get the vessel file timstamped entries that fall within the provided starttime/endtime.

Parameters
  • serial_number (str) – system identifier for the primary system (serial number of the sonar)

  • starttime (int) – integer utc timestamp in seconds

  • endtime (int) – integer utc timestamp in seconds

Returns

dictionary of the vessel file entries that fall within the provided time

Return type

dict

save(filepath=None)

Save the internal vessel file data to a json file

Parameters

filepath (Optional[str]) – absolute file path to the newly created vessel file

update(serial_number, data, carry_over_tpu=True)

Call to update the internal vessel settings data (still must call save to write to disk). If the data provided does not match the internal data, will overwrite the internal data. Will do the following additional tasks: compare the provided data and the internal data and determine if:

identical_offsets = offsets and angles match between the two data identical_tpu = tpu parameters match between the two data data_matches = the two data have values that exactly match (can match even if the keys are different, happens when timestamps (the keys) do not match but the data does.) populate the optional and tpu parameters in the new data with the latest existing entry compare all entries and only retain the earliest entry if you find two entries that match exactly

Parameters
  • serial_number (str) – system identifier for the primary system (serial number of the sonar)

  • data (dict) – dictionary with the offsets, angles and tpu parameters for the new data to add to the vessel file

  • carry_over_tpu (bool) – if True, will use the latest existing tpu parameters to populate the newly provided data