set_calstate_marker

set_calstate_marker(calstate, marker)[source]

Return a copy of a calstate, modified so that TimeStampedData objects in the final leaf node are annotated with the given marker object.

Technical details:

CalFroms are flyweight objects, so two identical CalFroms have the same hash. Identical hashes stop the IntervalTree union function from working as expected: IntervalTrees are based on sets, and as such adding two lists of CalFrom with identical hashes results in just one CalFrom list in the final IntervalTree, when we actually wanted the duplicate to be added.

This function is used to ensure that CalState arithmetic works as expected. By changing the TimeStampedData marker and thus making the hashes different, 'identical' calibrations can indeed be duplicated in the IntervalTree union operation, and subsequently operated on in a merge_equals step.

Parameters:
  • calstate -- The calstate to modify.

  • marker -- The object to annotate calstates with.

Returns:

New IntervalCalState representing the annotated calibration state.