% Preamble
\documentclass[a4paper,10pt]{article}
\usepackage[margin = 2cm]{geometry}
\usepackage[osf]{mathpazo} % palatino
\usepackage[round]{natbib} % author-year citations
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{parskip} 
\usepackage{amsmath}
\usepackage{textcomp} % for parts per mille symbol  
\usepackage{pdflscape} % landscape   
\usepackage[multidot]{grffile} % deal with weird image issue where it can't cope if names have "." in them

\pagenumbering{arabic}    

% -------------------------------------------------------------------------------------------------------
% some custom commands

% Add support for highlighting
\usepackage{color}
\newcommand{\hilight}[1]{\colorbox{yellow}{#1}}

% figure numbering override
\renewcommand*{\thefigure}{S\arabic{figure}} % make Fig S1 not Fig 1
\renewcommand*{\thetable}{S\arabic{table}} % make Table S1 not Table 1

% -------------------------------------------------------------------------------------------------------

% Title page information
\title{Supplemental Information from:\\
\textit{Reconstructing the last known movements of one of Nature's giants}}
% 90 characters max

\author{Clive N. Trueman, Andrew L. Jackson, Katharyn S. Chadwick,\\ 
Ellen J. Coombs, Sarah Magozzi, Richard C. Sabin\\
and Natalie Cooper}

\date{}


%\vfill


% End of preamble

\begin{document}
%\modulolinenumbers[1]   % Line numbering on every line

\maketitle

\parindent = 1.5em
\addtolength{\parskip}{.3em}

\newpage

% table s1
\centering
\begin{table}
  \begin{tabular}{|p{8cm}|c|c|c|} 
    \hline
    & \multicolumn{3}{|c|}{\textbf{Behavioural state}} \\
    \hline
    \textbf{Parameters} & \textbf{Foraging} & \textbf{Migrating north} & \textbf{Migrating south}\\
    \hline
    Behavioural phase one (1095 days) & Jan - Dec & NA & NA\\
    \hline
    Behavioural phase two (1278 days) & June - Oct & April - May & Nov - March\\
    \hline
    Pregnancy, nursing, return (447 days) & Jan - Dec & NA & NA\\
    \hline
    Post nursing migration (100 days) & NA & Jan - June & NA\\
    \hline
    Minimum sea surface temperature ($^{\circ}$C) & 3 & 3 & 3\\
    \hline
    Maximum sea surface temperature ($^{\circ}$C) & 25 & 25 & 25\\
    \hline
    Maximum daily distance traveled (km)$^{*}$ & $N(\mu=50, \sigma=25)$ & $N(\mu=150, \sigma=75)$ & $N(\mu=150, \sigma=75)$\\
    \hline
    Plankton biomass threshold for remaining to forage (units) & 50 & NA & NA\\
    \hline
  \end{tabular}
  \caption{Model parameters for agent-based model of whale movement. 
  See Figure \ref{figs5} and text for more details. 
  $^{*}$During behavioural phase one, mean maximum daily distance traveled is set to 20km.}
  \label{tables1}
\end{table}

\newpage
% figure s1
\begin{figure}[!htbp]
  \centering
  \includegraphics[width = \linewidth]{figures/Figure-S1-periodograms.png}
  \caption{Fourier analysis of $\delta^{15}$N (A, B) and $\delta^{13}$C (C, D) values of the full (A, C) and behavioural phase two only (B, D) components of the baleen plate. Inset values are the highest frequency spectral densities (in cm), excluding the values at the edge of the baleen (i.e. 80cm), and at the sharp increase of $\delta^{13}$C seen at 60cm. Periodic fluctuation with a distance of 13.5cm along the baleen plate is consistently recovered, but is weaker or absent in behavioural phase two.} 
  \label{figs1}
\end{figure}
 
% figure s2
\begin{figure}[!htbp]
  \centering
  \includegraphics[width = \linewidth]{figures/Figure-S2-cross-cor.png}
  \caption{Cross correlation between $\delta^{13}$C and $\delta^{15}$N values for the three behavioural phases, showing limited covariation in behavioural phases one and three, but strong negative covariance in behavioural phase two with a periodicity of around 13cm.
  }
  \label{figs2}
\end{figure}
 
% figure s3
\begin{figure}[!htbp]
    \centering
    \begin{subfigure}[t]{0.45\textwidth}
        \centering
        \includegraphics[width=\linewidth]{figures/Figure-S3-plankton-d13C-map.png} 
    \end{subfigure}
    \hfill
    \begin{subfigure}[t]{0.45\textwidth}
        \centering
        \includegraphics[width=\linewidth]{figures/Figure-S3-plankton-d15N-map.png} 
    \end{subfigure}
    \caption{Spatial model (isoscape) of model-simulated biomass, using weighted annual average $\delta^{13}$C (left) and $\delta^{15}$N (right) values from particulate organic matter (POM). $\delta^{13}$C values are from \cite{magozzi2017using} and $\delta^{15}$N from \cite{schmittner2016complementary} and C.J. Somes (\textit{pers. comm.}).} 
    \label{figs3}
\end{figure}

% figure s4 
  \begin{figure}[!htbp]
    \centering
      \includegraphics[width=\linewidth]{figures/Figure-S4-regions-d13C.png}
      \caption{$\delta^{13}$C values expected in baleen plates for whales simulated with resident foraging models (i.e. restricting movements to broad regions) for west UK/Irish shelf (West Ireland), Norwegian/Barents Sea (Norwegian Sea), Canaries/west Azores (Canaries), Mid-Atlantic ridge (Mid-Atlantic), and the Cape Verde/Mauritanian upwelling area (Cape Verde/Mauritania), over a simulated two year period with daily resolution and 30 replicate simulations for each region. 
      Simulated $\delta^{13}$C values are six month moving average values for the time series of simulated plankton $\delta^{13}$C values in that location.}
      \label{figs4}
  \end{figure}

% figure s5   
\newpage

\begin{landscape}

  \vspace{-1cm}
\begin{figure}[!htbp]
  \centering
  \includegraphics[trim = {3cm 0 0 0}, clip]{figures/flow-diagram-model.pdf}
  %\vspace{-1.2cm}
  \linespread{0.8}
  \caption{
  Schematic structure of the agent-based model used to generate hypothetical movement tracks. 
  At the start of each simulation, max and min sea surface temperature (SST) and food availability thresholds are fixed for all individuals. Behavioural states are defined \textit{a priori} based on day of the year. Maximum movement distances under each behavioural state are defined for each individual based on a random sample from a Gaussian distribution. The model runs with a daily time step. Current location and day of simulation is noted, and the behavioural state defined. Environmental conditions (SST, food availability and depth) are sensed in the current and eight adjacent 1$^{\circ}$ grid cells. The probability of movement is sampled from a binomial distribution defined according to behavioural state and environmental conditions in the current location. The direction of movement is sampled based on discrete probabilities associated to each of the eight adjacent 1$^{\circ}$ cells, defined according to behavioural state and environmental conditions. Finally the distance moved is sampled from a Poisson distribution conditional on the maximum distance defined for each individual. The new location is then assigned from a linear vector originating at the current location with magnitude defined as the distance moved and direction as 45$^{\circ}$ increments reflecting the relative orientation of each of the eight potential adjacent cells.}
  \label{figs5}
\end{figure}

\end{landscape}

\newpage

% figure s6
  \begin{figure}[!htbp]
    \centering
      \includegraphics[width=\linewidth]{figures/Figure-S6-r2.png}
      \caption{Histogram of $r^2$ values from linear regressions comparing model simulation $\delta^{13}$C values to those of the real data (Figure 1).} % check legend
      \label{figs6}
  \end{figure}

% figure s7
    \begin{figure}[!htbp]
    \centering
      \includegraphics[width=\linewidth]{figures/Figure-S7-boxplots.png}
      \caption{Boxplots showing the maximum and standard devation of latitudinal positions of simulated whales taken from the top 10\%, and bottom 10\%, of movement model simulations.} 
      \label{figs7}
  \end{figure}

% figure s8
\begin{landscape}
    \begin{figure}[!htbp]
    \centering
      \includegraphics[width=\linewidth]{figures/Figure-S8-kernals.png}
      \caption{Kernal density plots showing the positions of simulated whales taken from the top 10\%, and bottom 10\%, of movement model simulations. 
      High densities are in yellow, low densities are in blue.}
      \label{figs8}
  \end{figure}
\end{landscape}

% References
\bibliographystyle{refs}
\bibliography{blue-whale-abbreviations}

\end{document}