Fig3_2017a.m and functions rgb.m, suncycle.m, distWB.m contain the matlab code used to generate figure 3A. It calculates 10000 tracks of migratory birds departing on the 26th September 2017 (day 43 in code), using ERA40 wind data at 925mbar altitude (stored in MeteoMatrix2017_925.mat). The coast line used in the figure is loaded from coast.mat, coast2.mat, and coast3.mat which are subsets of lines.shp file of http://openstreetmapdata.com/. Some parts of the code are commented out because they are not needed for the figure, but were used for the analysis of other seasons/days.