# A Data Processing Framework for Polar Performance Diagrams
## 3 The hrosailing Framework
### Computation of Isochrones  
While established isochrone algorithms only consider the weather conditions in the starting point, we include an algorithm to the hrosailing framework which also considers the changing weather conditions along the way. In order to compute isochrone points (in mercator projection) we need to find the distance \(s_{*}\) we need to travel from our starting position in direction \(w\) such that the total time taken equals a given constant \(c\), i.e., \(t(s_{*})=c\). Then the isochrone point is \(B=A+s_{*}w\). Note that \(t(s)\) and \(t^{\prime}(s)=\frac{dt}{ds}(s)\) can be computed as described in Section 3.6 by solving (1). The computation of the isochrone point can be done approximately by Algorithm 1 using stepwise affine approximations:```
0:\(A,w,c\) as described above \(m\) a lower bound on the number of sample points used \(B\) such that \(t(|B-A|)\approx c\) and \(B\) is in direction \(w\) from \(A\) \(t,steps\gets 0,0\) stepsize \(\leftarrow\frac{\mathbb{C}}{m}\)\(\triangleright\) heuristic for an initial value whilesteps\(<m\)do \(s\gets s+stepsize\) \(t\gets t+stepsize\cdot t^{\prime}(s)\) \(steps\gets steps+1\) if\(t>=c\)then\(\triangleright\) reset values and restart with smaller step size \(stepsize\leftarrow\) stepsize \(steps/m\) \(s,t,steps\gets 0,0,0\) endif endwhile \(s_{*}\gets s-\frac{t-c}{t(s)}\)\(\triangleright\) Small correction of the last step \(B\gets A+s_{*}\cdot w\)
```

**Algorithm 1** Compute Isochrones

## 4 The hrosailing Package

We introduce the Python package hrosailing, which is an implementation of the hrosailing framework described in Section 3. In contrast to professional software such as Expedition (see [27]) or ADRENA (see [28]), the hrosailing package is an open-access project, published under the Apache 2.0 License [29]. It is written-object oriented in a modular manner, so many components can be customised if needed. All suitable computations are logged automatically to check the quality of certain operations or possible error sources later on. ### How to Install

The recommended way to install hrosailing is with pip:

pip install hrosailing

Users can also clone or fork the corresponding github repository [30]. In this repository users can also find a comprehensive documentation including several examples. If you notice any bugs or unwanted behaviour, please do not hesitate to submit an issue on our github page or contact us directly. Also contact us if you want to suggest further extensions or participate in the future development of the framework and/or package. ### Dependencies and Compatibility

The hrosailing package has the following dependencies:

1. Python 3.7, 3.8 or 3.9 has to be installed;
2. Python package NumPy compatible with version 1.21.2;
3. Python package SciPy compatible with version 1.7.1;
4. Python package Matplotlib compatible with version 3.4.3;
5. Python package pymnea2 compatible with version 1.18.0 (only when working with NMEAFileHandler). Earlier or later versions possibly also work, but have not been tested. The package contains methods for compatibility with

1. files containing NMEA sentences;
2. csv files of polar diagrams in formats used by the ORC and OpenCPN respectively, as well as other established formats;3. NumPy arrays. All plotting methods can be configured using various Matplotlib keywords and methods. ### Example of Use

#### 4.3.1 PolarPipeline

A first polar diagram can be obtained from real-world data with little effort. From that, refinements and customisations can be used to improve the quality of the result.