compare_dict_data

HSTB.kluster.fqpr_vessel.compare_dict_data(dict_one, dict_two)

Compare two dictionary objects to determine how identical they are. data_two is the new data, so we do some checks to see if it is relevant or if we need to keep it. Expect the dicts to be like:

{sensor_name1: {utc timestamp1: value, utc timestamp2: value, …},

sensor_name2: {utc timestamp1: value, utc timestamp2: value, …}, …}

Return a check that has attributes matching each check performed:
  • identical_offsets = offsets match between the two data

  • identical_angles = mounting 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.)

  • new_waterline = found a new waterline value in dict_two (the new data) that does not match data_one. Return

    this in case we want to retain this value regardless of the other checks

Parameters
  • dict_one (dict) – base dict to compare against

  • dict_two (dict) – new dict to compare with

Returns

  • bool – identical_offsets check value

  • bool – identical_angles check value

  • bool – identical_tpu check value

  • bool – data_matches check value

  • float – new waterline value found