offspect.examples.correct_coords

calculate_cog(cf)[source]

calculate the center of gravity for each hemisphere

calculate_translation(hotspots=None)[source]

calculate the correction translation and scaling :type hotspots: Optional[List[List[float]]] :param hotspots: a list of the hotspot coordinates, one for each hemisphere. The correct hemisphere for each coordinate is determined automatically by its x coordinat. The order is therefore irrelevant. Each hotspot is a list of x, y, z coordinates. If this argument is left undefined or set to None (default), the function will calculate a translation to identity, i.e. one that will keep the coordinates unchanged. :type hotspots: List[List[float]]

Returns

  • translation (List[List[float]]) – the translation for each hemisphere

  • .. admonition:: Rationale – For each hemisphere, we did usually perform a fast estimation of the hotspot. This hotspot was used as seed coordinate for a mapping. But it is not known whether the grid was centered on the hotspot, or in case it was, whether the mapping had to be aborted. Therefore, it can not be know for sure just by looking at all coordinates from a mapping, where the origin was. It is therefore necessary for the user to set the hotspot.

rescale_coords(attrs, scaling_factor=1.0)[source]

scale the coordinates of this trace by a scaling factor

translate_coords(attrs, translation=[[0.0, 0.0, 0.0], [0.0, 0.0, 0.0]])[source]

move the coordinates of this trace by a translation