# To add a new markdown cell, type '# %% [markdown]'
# %% [markdown]
# # Ice Drift Correction using the online interface to Polarstern data
#
# This example illustrated steps to convert GPS positions from MOSAiC field data into local (x, y) coordinates. The translation and rotation correction of the drifting ice floe during MOSAiC is based on the position of the GPS1 antenna of Polarstern and the true heading data from the ships gyro heading. The data is automatically downloaded for the required period from the REST interface of dashboard.awi.de, thus an internet connection is required.
#
# This solution is equivalent to the FloeNavi solution when the ship was moored at the same location at the ice floe. The origin of the (x, y) coordinate reference system will be at the position of the Polarstern GPS antenna and the x-axis will be defined by the ships orientation.
# %%
importsys
# Allow to find icedrift
# NOTE: this only works if `floenavi` (this module) and `icedrift` are cloned to the same directory
# The reference station is defined either by one geographic position plus the true heading of the x-axis, or by two positions with the true heading between both station defining the true heading of the x-axis. The floenavi master solution provided data for the first option in a file format that can be directly used to initialize the data class.
# Create a data container for the GPS data to be converted into the local (x, y) coordinates to determine the temporal coverage required for the Polarstern data extraction.