Spatiotemporal computations in the insect celestial compass

Domain: earth_science
Published: 2025-03-22
Editorial outcome: minor_revision

Abstract
Obtaining a geocentric directional reference from a celestial compass requires compensation for the sun’s movement during the day (relative to the observer), which depends on the earth’s rotation, time of year and the observer’s latitude. We examine how insects could solve this problem, assuming they have clock neurons that represent time as a sinusoidal oscillation, and taking into account the neuroanatomy of the insect celestial compass pathway. We show how this circuit could exploit trigonometric identities to perform the required spatiotemporal calculations. Our basic model assumes a constant change in sun azimuth (the ‘hour angle’), which is recentred on solar noon for changing day lengths. In a more complete model, the time of year is represented by an oscillation with an annual period, and the latitude is estimated from the inclination of the geomagnetic field. Evaluating these models in simulated migration and foraging behaviours shows the hour angle may be sufficient.

Introduction
Using the sun (or equivalent celestial cues) as a compass requires a compensation mechanism for its movement during the day. Taking inspiration from insects, engineers have implemented various forms of celestial compass for use in robot navigation. Typically, the robot’s deployment has been short enough (less than an hour) for the sun’s movement to be neglected1,2. For longer deployment, a system clock, global positioning system (GPS) and an accurate model of the solar ephemeris can be used to time-compensate the compass3. However, typical use cases for a robot celestial compass would be situations where GPS is unavailable (remote locations, or compromised satellite systems). Insects use their celestial compass to navigate in deserts4,5 and across oceans6,7, but it is implausible to suppose they have either an absolute time reference or a precise look-up table for the solar ephemeris. Here, we propose plausible neural mechanisms by which insects could use their internal sense of time to predict the sun’s position, transforming the measured azimuth of the sun into a geocentric heading reference.

Internal clocks (processes that track time or external rhythms) are widespread in biology. Insects are known to have clock input to multiple circuits8,9. More specifically, clock inputs from antennae10–14 or the accessory medulla of the optic lobes15–19 (Fig. 1a) affect celestial compass function. The proteins timeless (Tim) and period (Per) are involved in the encoding of time in insects20. Additionally, cryptochrome (Cry) proteins act as photoreceptor inputs to the clock mechanism, tuning the Per and Tim mRNA oscillations to light-darkness rhythms11–13 (also type 2 Cry (Cry2) oscillations in monarch butterflies). As Fig. 1b shows, the oscillation phases of Cry2 and Tim proteins differ by six hours, suggesting that these two signals might respectively encode the sine and cosine functions of an angle changing with constant rate of 15° per hour21 (Fig. 1c) to complete a circle every day, like the hour hand of a clock (Fig. 1d).

Inside the insect brain, time is represented by clock neurons8,9 whose activity depends on the mRNA levels of the proteins described above (although their exact relationship is unclear). Clock neuron activity expresses an endogenous oscillation with periods that can vary from daily to annual20. Approximately half of the clock neurons in the insect brain rely on the blue light sensitive type 1 Cry (Cry1)19. The only clock neurons that intersect the celestial compass pathway of fruit flies (Drosophila melanogaster) before it reaches the navigation-specific circuits of central complex (CX)16,22 are DN1pB23. The current assumption is that these neurons allow the celestial compass to compensate for the moving sun by predicting the sun’s course during the day23. However, the mechanism that allows this compensation and transforms the retinotopic position of the sun into a geocentric compass is still unknown.

Some proposed mechanisms to compensate a celestial compass for the sun’s movement do not require a clock. These suggest the calibration of the celestial with other compasses24, use the sun’s elevation to estimate its speed of motion25, or assess the rotation of the skylight polarisation pattern to detect the true north26. Others conceptually examine the effects of mappings from different forms of clock input to the estimated sun’s position, but without discussing possible biological implementations27. One mechanism examined in Massy et al. (2023)27 is time-averaging, which has been linked to properties of clock proteins found in the butterfly antennas21. As already mentioned, the levels of these proteins express a sinusoidal pattern during the day, representing an arrow that encodes time. Schlizerman et al. (2016)21 use this signal to estimate the sun’s movement as a constant speed of 15° per hour (the speed at which the earth rotates around its axis) and assume that the clock resets at sunrise. However, this produces a directional drift in the compass reference as the length of the day (and hence the time of sunrise) changes; the clock would need to be synchronised to solar noon to provide a stable reference point. Furthermore, depending on the time of year or location on earth, the observed movement of the sun can deviate significantly from a constant speed (Fig. 1e).

We present a neurally plausible mechanism by which a clock signal carried by DN1pB neurons could be used to correct the insect’s celestial compass. We propose two alternative models to generate the DN1pB clock signal. Our hour-angle model uses the time of the day to predict the earth’s rotation around its spin axis relative to the sun and adapts to changing day length. Our complete model also uses the time of year and the geomagnetic inclination (detectable by some insects28,29) to calculate the exact course of the sun during the day. Our results suggest that the hour-angle model is sufficient to support the behaviour of migrating and central-place foraging insects, assuming they have evolved to use an appropriate variant for the northern or southern hemisphere or the equatorial region. However, the complete model can adapt to any location, including change from clockwise (CW) to counter-clockwise (CCW) movement of the sun, and produces more accurate navigation. Some insects may require such accuracy, and the model may also have value for a localisation technology independent of GPS.

Results
The hour-angle model
The hour angle (ω) describes the earth’s rotation around its axis relative to the sun as a constant rate of 15° per hour. By convention, the hour angle is the longitudinal difference between the observer and the subsolar point (location on earth where the sun is at its zenith). It is zero when the sun is closest to the observer’s zenith (solar noon), at which point the sun azimuth indicates south (assuming the observer is in the northern hemisphere). If the time of day is measured from sunrise (zeitgeber time, tz = t − tsr, from the German for ‘time-giver’), the hour angle is given by
ω(tz) = (tz / TL − 0.5) * 15°, (1)
where TL = tss − tsr is the day length, computed as the difference between the sunrise (tsr) and sunset (tss) times in hours. Supplementary Text S1 describes a possible neural implementation of equation (1), given the neural encoding of the zeitgeber time and day length separately.

Given their six-hour phase difference (equivalent to 90° hour-angle difference; see Fig. 1b), Tim and Cry2 proteins could encode the (negative) sine and cosine of the hour angle as its east-most (ωE) and north-most (ωN) components (Fig. 1c). The period of these sinusoids is determined by the temporal difference between two consecutive sunrises30. Their phase is determined by the day length (TL), which ensures that the sinusoids are centred at solar noon (see Supplementary Fig. S1). Using both (east-most and north-most) components creates an arrow that rotates with time CW, like the hour hand of a clock (Fig. 1d, blue arrow). Negating the north-most component (ωN = −ωN; flipping the vertical vector in Fig. 1d) implements a CCW hour angle model, which works in the southern hemisphere. Near the equator, the sun moves almost vertically (crossing the zenith) from east to west. In this case, a zero north-most component (ωN = 0; no vertical vector in Fig. 1d) would be more accurate and avoids any assumption regarding CW or CCW sun movement. These three versions of the hour angle model allow for a reasonable approximation of the solar azimuth for different locations on earth. A complete compensation mechanism should consider more factors (Fig. 1e).

Estimating the day length
The blue-light sensitive Cry1 proteins detected in Danaus plexippus monarch butterflies (equivalent to the Cry proteins of D. melanogaster fruit fly) synchronise the clocks to the light-dark rhythm11,12,19. We suggest that two kinds of synchronisation co-occur. The first synchronises the zeitgeber time (tz) with the sunrise, resetting it to zero, while the second shifts the hour angle relative to tz, as described in equation (1), so that it is zero at solar noon. The required shift relative to solar noon depends on the day length (TL), which we assume is a continuously updated estimate based on the changing level of skylight irradiance.

We assume the protein level Cry1(t) = a * Isky(t), where a is a scaling factor (gain) and Isky is the overall blue irradiance in the sky (see Fig. 2a). We then propose that the day length (TL) can be calculated as a function of Cry1, so
dTL / dt = (Cry1(t) + β * TL) / τL, (2)
where τL is a time-constant, and β is a constant input. Parameters a, β, and τL can be optimised to fit equation (2) to the actual day length (values summarised in Supplementary Table S1). Figure 2b demonstrates the precision of this fit, where we simulate the estimated TL and plot it over the actual day length, assuming continuous light exposure during the day.

We also tested how interrupted light exposure, as might be experienced by central-place foraging insects, affected the estimates of TL (it might also affect synchronisation of tz, but we do not consider that here). We simulated species with different average foraging durations, from one to eight hours per day; foraging each day could vary around this average and occur any time from sunrise to sunset. Parameters needed to be optimised to fit the different average foraging durations (summarised in Supplementary Table S1): shorter foraging durations require longer time constants (τL) and higher gains (a) to transform the sky irradiance into Cry1. Using these optimised parameters, Fig. 2c shows that the higher level of skylight irradiance measured (for the same average exposure time) during the summer (compared to winter) suffices to estimate the day length for central-place foragers. A consistent daily foraging duration and time window would result in smoother estimates. In Supplementary Text S2 and Supplementary Fig. S2, we explain how a neural filtering process could further reduce the high-frequency oscillations in this estimate.

Integration with compass neurons
The calcium level of dorsal (DNs) and lateral (LNs) clock neurons in the brain of D. melanogaster changes over the day19,31. This can be described by sinusoidal functions similar to protein levels in Fig. 1b. A pair of DNs (DN1pB) target the TuBu1 neurons and provide clock information to the celestial compass pathway8,9,32 in each hemisphere19,23. We hypothesise that the calcium level of DN1pB neurons predicts the solar azimuth (α) and corresponds to the east-most (ωE) and north-most (ωN) components of the hour angle. There are other clock neurons innervating the ellipsoid body (EB) and fan-shape body (FB) of the CX, but we would argue that time compensation should occur before the celestial compass integrates with other compasses (such as wind or visual landmarks) in the EPG neurons of the EB. The DN1pB neurons are, so far, the only reported neurons to target the celestial compass pathway upstream of the EB in D. melanogaster19. Although they receive limited direct input from sensory-driven clocks in the antennae or retina (see Fig. 3a and Supplementary Table S2, generated using data from the FlyWire database33), they receive input from these via multiple interneurons, which might have a role in shaping their response into a smooth sinusoid (Supplementary Text S2).

Previous computational modelling studies provide a good approximation of how the TuBu1 neurons can encode the solar azimuth25,34. In D. melanogaster, polarised light is detected from the dorsal rim area and travels to the anterior optic tubercle (AOTu) through the retina and the medulla (Fig. 3a)35,36. Colour information is detected from the remaining dorsal area in the eye. It travels through the dorsal retina and medulla to AOTu and the TuBu1 neurons, where it probably integrates with polarisation information to estimate the retinotopic solar azimuth (α0). As described above, TuBu1 neurons are also terminals for the DN1pB neurons8,9,23,32. Thus, we assume that the time-based solar azimuth prediction is combined with the retinotopic solar azimuth estimate at the axons of TuBu1 neurons, transforming it into a geocentric compass in the anterior bulb.

There are two types of TuBu1 neurons: TuBu1a, which targets ER4m ring neurons, and TuBu1b, which target both ER4m and ER5 neurons (see Supplementary Table S3). Calcium recordings of TuBu1 neurons suggest that the two hemispheres independently encode the (retinotopic) solar azimuth in a spatial sinusoidal pattern of activity36. For our proposed mechanism of time compensation to work, we need to assume that the TuBu1a and TuBu1b populations express a 90° shift in the represented direction of the sun (see Fig. 3b). We also assume that DN1pB targets the TuBu1a population and the DN1pB targets the TuBu1b population. Finally, we assume the responses of the TuBu1 populations are added together to encode the animal’s heading in the responses of the ER4m population.

The above process implements a crucial trigonometric identity that transforms the solar azimuth into a geocentric compass in the ring neurons, described as
ER4mn = sin(α) * sin(α0 − ϕn) + cos(α) * cos(α0 − ϕn) (3)
= cos(α − α0 + ϕn),
where α = α(t) = ω(t) is the prediction of solar azimuth based on time (DN1pB neurons), α0 − ϕn is the estimation of the retinotopic solar azimuth (TuBu1 neurons), and ϕn is the retinotopic direction of a TuBu1 neuron. The above equation suggests that ER4m ring neurons encode the angular difference between the observed (celestial compass) and predicted (clock neurons) solar azimuth, indicating the animal’s heading relative to north.

Complete time compensation
The earth’s spin axis is not aligned with the earth’s orbit around the sun, causing seasonal shifts in day length and the observed course of the sun across the sky (Fig. 1e). To accurately compute the sun’s location at a given time, we need to know the longitudes and latitudes of both the subsolar point and the observer3. The latitude of the subsolar point is also known as the solar declination (δ; Fig. 4a), which is maximum at 23.45° (the angle of earth’s spin axis from a vertical axis) in June, minimum at −23.45° in December, and zero in March and September. This oscillating angle with an annual period can be described by its sine and cosine components (Fig. 4b). We assume that a different pair of clock neurons encode these two components. The first component (δN) raises the hour-angle oscillation during summer and lowers it in winter, emulating the longer or shorter days of the year (Fig. 4c) in the northern hemisphere (the relationships would be reversed for the southern hemisphere). Because the solar declination is an angle, we need a second component (δQ) to ensure balanced and stable trigonometric computations. Note that solar declination differs from day length (TL), as the latter also depends on the geometric latitude of the observer. Interestingly, knowing any two of the day length, solar declination and observer’s latitude, we can estimate the third one (see Supplementary Text S3).

Another way we can estimate the geometric latitude of the observer is by measuring the geomagnetic inclination (or magnetic dip, μ), which is the vertical component of the earth’s magnetic field and (approximately) depends on the geometric latitude (ϕ) at that point (Fig. 4d)37. Monarch butterflies can detect magnetic inclination28,29, although the existence of this sense in other insects is yet to be established and its pathway to the brain unknown. We assume that another pair of neurons encode the sine (ϕN) and cosine (ϕQ) of the insect’s latitude as a function of magnetic inclination (Fig. 4e). ϕN is positive in the northern hemisphere and negative in the southern. Thus, we hypothesise that ϕN is multiplied with the north-most component of hour-angle oscillation (ωN) to flip it when the insect is in the southern hemisphere and transform its rotation from CW to CCW (Fig. 4f). The role of the other term (ϕQ) is to ensure stable trigonometric computations.

The above information is sufficient to accurately estimate the expected solar azimuth at a specific location and time3. A possible circuit by which these variables could influence the activity of the DN1pB pair so that they now encode the solar azimuth (α) rather than the hour angle (ω) is illustrated in Fig. 4g, while the values of αN and αE for different combinations of magnetic inclination, solar declination and hour angles are plotted in Supplementary Fig. S3. We refer to this as the ‘complete model’ of the sun’s movement and compare it to the ‘hour-angle model’ in the following simulations of insect navigation.

Central-place foraging experiment
To demonstrate the effectiveness of our time-compensated compass, we simulated a foraging experiment for insects such as bees and ants who forage throughout the day to a familiar food site but can take long breaks between foraging trips (spent in their home’s darkness). The simulated insects initially perform a random walk searching for food just after sunrise, followed by single return trips to the food location (stored as a vector memory) every hour until sunset. We then tested how an insect using CX navigation would perform in this task with different model compass inputs: (a) without time compensation, (b) using the hour-angle or (c) the complete model. The CX model we used is a modified version of a well-established path integration model38, which also incorporates vector memories of prominent locations39. We then use our proposed compass model as the input heading of the CX with 20% noise. Figure 5a–c show example foraging routes produced by the three models during a single day.

Overall, no matter which compass model the insect used, it could return home quite accurately during individual foraging excursions (Fig. 5d, green boxes). The sun’s movement during a short excursion (a few minutes in this simulation) is not enough to cause noticeable errors in the continuous integration of the home vector. However, longer foraging durations increase the error without time compensation, and also significantly affect the performance with the hour-angle model (as opposed to the complete model), as its error increases linearly with time (Fig. 5e). More significantly, insects without time compensation could not accurately revisit a known food site (Fig. 5a). This is because the food-site location was stored in the memory relative to the sun’s position, and as the sun moves, so does this location. Either form of time compensation seems sufficient to navigate back and forth to the food site with relatively good accuracy (Fig. 5b and c).

Experiments with desert ants suggest that their homing error is slightly higher than the one our simulations produced using any model40 (Fig. 5d, green dashed line). Interestingly, the foraging routes of the real animals appear to be significantly more accurate than their homing routes41, which is only in line with the predictions of the complete model. Despite this advantage of the complete model over the other two, it seems likely that foragers using the hour angle (or even the no-compensation) model combined with other cues, such as visual place recognition in the vicinity of the food site, could produce indistinguishable behaviour (for example, see experiments with honeybees Apis mellifera and A. cerana42,43).

In the above experiments, we used the actual day length for equation (1) (orange lines in Fig. 2c). Supplementary Fig. S4 shows the results when, instead, we use the smoothed day length estimates (black lines in Supplementary Fig. S2), time-shifted to overlay their theoretical values. Although this introduced some extra noise, foraging performance was not dramatically affected.

Migration experiment
Most foraging insects remain at a similar latitude during their lifetime so it might be expected that the hour-angle model (which adjusts for day length but not solar declination and latitude) would be sufficient for successful behaviour. In contrast, several species of migrating insects travel, within a relatively short time, through multiple latitudes, so it might be expected that they require the complete time-compensation model for their compass system. We therefore simulated insect migration, over realistic travel distances and directions, using migration routes inspired by three different insect species: the monarch butterfly D. plexippus, the Bogong moth Agrotis infusa, and globe skimmer dragonfly Pantala flavescens. We selected these species to demonstrate migration in different characteristic locations on earth relative to its equator: above (D. plexippus), below (A. infusa), or across (P. flavescens). In this way, we test our model in locations where the sun moves CW, CCW, or switches its moving pattern during the migration.

In the following, we aim to test how travelling long distances across the globe can be done with a time-compensated sun compass, rather than to provide a full account of insect migration. Therefore, in the CX model, we replace its previous path integration or vector memory component with fixed goal coordinates on earth (corresponding to the endpoints of the above migrating species) to test whether the simulated insect can reach them from relevant start points, but use the same speed and daily pattern of movement across all simulations. We modified our simulation to factor in the curvature of the earth’s surface. The daily travel capacity was set at eight hours (at 2.5 m sec−1, based on the speed of D. plexippus), with one-hour breaks every hour for feeding or rest. We also omitted results without time compensation, as the simulated insects moved in circles around the starting point.

Figure 6a mimics the southward autumn migration routes of monarch butterflies using the hour angle (blue) and complete models (yellow), starting in late August from Mackinac Island (Michigan) and ending in late October in Michoacan (Mexico). Figure 6b shows similar migrations, starting from different locations across the Canadian border and California. Figure 6c summarises the performance of the two models in the above migrations. The variability in the performance comes from variations in the departure location (±5° in longitude and latitude) and time (±72 h). Overall, the performance of the two models seems very similar.

Figure 6d shows the simulated routes of Bogong moths during autumn migration from Montrose (Australia) south to Mount Bogong. Figure 6e shows similar migrations starting from different locations in Australia. As this migration occurs in the southern hemisphere, we use the CCW version of the hour angle model. Figure 6f summarises the simulation of migration in the south hemisphere, showing insignificant differences between the two models. The shorter (compared to butterflies) final distances from the goal are simply because the overall migration distances are shorter so less error accumulates.

Finally, Fig. 6g shows the simulated routes of the globe skimmer dragonflies during their spring migration from Mbekenyara (Tanzania) to Madirai (India), which is the world’s longest transoceanic migration (approximately 4859 km). Although dragonflies may fly more continuously during their transoceanic migration, for consistency we used the same migration time pattern as for the monarch butterfly (travel at 2.5 m sec−1 with foraging breaks). Exploratory simulations using continuous migrations produced smoother routes but led to the same conclusions. Figure 6h shows similar migrations starting along the east African coast. In these simulations, we use the equator-specific hour angle model. Figure 6i summarises the migration performance using the two models, where we see some more significant differences in their performance. Supplementary Figs. S5, S6 and S7 show the respective migrations of butterflies, moths and dragonflies using alternative hour angle models.

The complete model generally resulted in straighter migration routes than the hour-angle models. However, the deviations induced by the less accurate hour-angle model largely cancel out during the day. As a result, in the single-hemisphere migrations, both models could bring the animals close to their destinations (Fig. 6c, f). The hour-angle model deviates more from the desired destination point for the dragonflies crossing the equator (Fig. 6i), but it can still drive the animal fairly close to its destination. The observed error results from a consistent bias rather than lower precision (Supplementary Fig. S8), which a constant offset could compensate for. Therefore, the only clear advantage of the complete model is that it allows full adaptation to different environments. In contrast, we had to choose the appropriate variant of the hour angle model for simulated migration above, below or across the equator.

We performed further sensitivity analysis by introducing random sensor noise from a uniform distribution, with the upper and lower bounds set as a percentage of the maximum possible measurement value (Fig. 6j). For the hour angle, the error (average distance from goal across all migrating species) becomes significant only for unrealistic levels of noise in estimating the time (more than 25% noise, corresponding to 6 h). Magnetic inclination measurements are expected to be noisier (especially near the equator) but had to exceed 45° to produce noticeable error. If noise in the sun position is introduced independently in each TuBu1 neuron, then its effect averages out across the eight-dimensional encoding of the angle, leading to little change in migration error as the noise level is increased (solid grey line in Fig. 6j). If the noise is added to the sun’s angle before TuBu1, the error increases more rapidly, from around 10° (dashed grey line in Fig. 6j).

As before, these results use the actual day length. Substituting the estimated day length, migrations became slightly more tortuous and less accurate, especially at the start of the migration route (Supplementary Fig. S9). The largest error in the day-length estimates seems to come from the initialisation of TL, which takes some time to converge to the correct value. Although this could be avoided by optimising the initial value as we did with the other parameters, insects might encounter a similar problem.

Methods
Optimisation for the day length
To optimise equation (2), we needed the total blue irradiance of the skylight (Isky) and the ground-truth day length (TL). Thus, we generated a ground-truth dataset of overall blue skylight irradiance and day length during a calendar year. Then we optimised the free parameters (τL, a and β) of equation (2), using the ‘curve_fit’ method of the ‘SciPy’ Python package. The function we optimised was the value of TL over time, which was calculated using the Euler’s method for discrete-time linearity assumption with dt = 1 h and TL(0) = 7 h as
TL(t) = TL(i − 1) + (a * Isky(i) + β * TL(i − 1)) / τL: (4)

The celestial compass model
Our results assume a compass model that accurately returns the solar azimuth. We assume that this is represented in the AOTu by 16 TuBu1 directions centred at homogeneously distributed
ϕn = n * 22.5°, where n ∈ {1, ..., 16}: (5)
These take input from the medulla MeTu2 neurons, whose responses are calculated as
MeTu2an(t) = sin(αsun(t) − θ(t) − ϕn) + ϵn_sun(t), (6)
MeTu2bn(t) = cos(αsun(t) − θ(t) − ϕn) + ϵn_sun(t), (7)
where θ(t) is the heading of the animal at time t (hours), ϕn is the preference angle of the nth MeTu2 neuron, αsun(t) is the solar azimuth, and ϵn_sun(t) ∼ U(−η, η) is uniform noise in the encoding of the sun’s position, which is proportional to the given noise factor (η ∈ [0, 1]).

For the one-dimensional noise in our sensitivity analysis, we instead included the noise in the angle itself as
MeTu2an(t) = sin(αsun(t) − θ(t) − ϕn + ϵ_sun(t)), (8)
MeTu2bn(t) = cos(αsun(t) − θ(t) − ϕn + ϵ_sun(t)): (9)
Note that now the same noise applies to all the neurons.

Models of compensation for the moving sun
Three models of the compass are used in different parts of our results: the no-compensation, hour-angle, and complete models (in order of increasing complexity). Each model produces the responses of the ring neurons (ERs), which are input to the CX model.

The no-compensation model. The activity of the ERs is equivalent to the output of the optic lobe’s medulla-tubercle (MeTu) neurons,
ER4mn(t) = TuBu1bn(t) = MeTu2bn(t): (10)

The hour-angle model. Here, we introduce a basic correction using the hour-angle. The responses of the DN1pB clock neurons relate to the hour angle as
DN1pBE(t) = ωE(t), (11)
DN1pBN(t) = ωN(t), (12)
where t is the time (hours) since the beginning of the year. The components ωE and ωN are calculated as
ωE(t) = −sin(ω(t)) + ϵ_time(t), (13)
ωN(t) = −cos(ω(t)) + ϵ_time(t), (14)
where ω(t) is computed by equation (1), and ϵ_time(t) ∼ U(−η, η) represents the uniform noise in the encoding of time, which is proportional to the given noise factor (η ∈ [0, 1]). Note here that we assume a perfect estimate of the sunrise time (tsr; used in equation (1) to estimate the zeitgeber time). In migrations in the southern hemisphere, we use the CCW hour angle model, where we set ωN(t) = cos(ω(t)) + ϵ_time(t). For the migrations across the equator, we set ωN(t) = ϵ_time(t).

The activity of the tubercle-bulb (TuBu) neurons is then estimated as
TuBu1an(t) = −DN1pBE(t) * MeTu2an(t), (15)
TuBu1bn(t) = −DN1pBN(t) * MeTu2bn(t): (16)

The activity of the ring neurons in the bulb, where they target the ER4m neurons, is
ER4mn(t) = TuBu1an(t) + TuBu1bn(t): (17)

The complete model. The complete model also involves solar declination and the insect’s latitude. Solar declination is computed as
δ(t) = 23.45° * sin(2 * π * (284 + t/24) / 365), (18)
where t is the time (hours) since the start of the year, and it is encoded by the north-most and equator-most components as
δN(t) = sin(δ(t)), (19)
δQ(t) = cos(δ(t)): (20)

Geometric latitude can be approximated as a function of geomagnetic inclination37 as
ϕ(μ, t) = −tan−1(0.5 * tan(μ(t) + ϵ_μ(t))), (21)
where μ(t) is the local geomagnetic inclination, and ϵ_μ(t) ∼ U(−η90°, η90°) is uniform noise in sensing the magnetic inclination, based on the noise parameter η ∈ [0, 1]. The north-most and equator-most components encode the latitude as
ϕN(μ, t) = sin(ϕ(μ(t))), (22)
ϕQ(μ, t) = cos(ϕ(μ(t))): (23)

Using the above information, the apparent solar azimuth can be estimated as3
αE(μ, t) = δQ(t) * ωE(t), (24)
αN(μ, t) = ϕQ(μ, t) * δN(t) + ϕN(μ, t) * δQ(t) * ωN(t), (25)
corresponding to the solar azimuth’s east (negative sine) and north (negative cosine) components.

We replace the responses of the DN1pB clock neurons with the solar azimuth components,
DN1pBE(t, μ) = αE(μ, t), (26)
DN1pBN(t, μ) = αN(μ, t): (27)

We simulate the observed magnetic inclination (μ) using the actual geometric latitude of the animal as
μ(t) = tan−1(−2 * sin(ϕ(t)) / cos(ϕ(t))). (28)

The remaining calculations are the same as in the hour-angle model.

The central complex model
As we do not focus on the dynamics of the ring attractor or the specific neural response of the neurons in CX, we simplified the model described in Stone et al. (2017)38 by replacing the processing layers with vectors represented by complex numbers. Thus, we transformed the compass representation of the ER4m neurons as
ER4m(t) = 1/16 * Σ_{n=1}^{16} rn * α0(t) * eiϕn + ϵ, (29)
where ϵ = ϵx + iϵy ∼ U(−η, η)2C is a random number drawn from a uniform distribution, with real and imaginary components in the range [−η, η], and η ∈ [0, 1] is the selected noise level. By default, in all our experiments η = 0.2.

The representation of ellipsoid-body protocerebral-bridge gall (EPG) neurons can then be approximated as
zEPG(t) = ER4m(t) / |ER4m(t) + ϵ|: (30)
Note that we need to normalise this complex number to ensure that we only keep the direction information, which is the estimated heading of the animal.

Multiplying the heading with the speed of the animal (v), we compute its velocity in the protocerebral-bridge FB nodulus (PFN) neurons,
zPFN(t) = zEPG(t) * v(t): (31)

We use the activity pattern of the PFNs to update the working memory (M) of the CX as
τM * dzM / dt = zPFN(t), (32)
where τM = 40 km is the time-constant of the memory charge. Similarly, we have a target memory (zG ∈ 2C) that can be used as the migration target or the foraging site in our experiments, and by default it is zero.

The allocentric goal direction is computed by FB columnar (FC) neurons, which we implement as
zFC2(t) = (zG(t) − zM(t)) / |zG(t) − zM(t)|: (33)
Note that here we also normalise with the magnitude of the complex number, as this population of neurons represents the allocentric direction only and not the distance of the goal location.

Finally, the egocentric steering signal is decomposed into two axes, at 45° towards the left (L) or right (R), and it is calculated as
zPFL3,L(t) = zFC2(t) − zEPG(t) * cos(45°) * e−i45° + ϵ, (34)
zPFL3,R(t) = zFC2(t) − zEPG(t) * cos(45°) * ei45° + ϵ: (35)

Simulations
We run a set of simulations for migrating and central-place foraging insects. The update of the heading direction and position of the animals in all the simulations occurs in the same way.

Based on the above CX model, we calculate the angular velocity of the animal as
dθ / dt = 1/k * (|zPFL3,L(t)| − |zPFL3,R(t)|), (36)
where θ(t) is the heading of the animal. Then we update the linear velocity of the animal as
dzxy / dt = v(t) * eiθ(t), (37)
which is used for updating its actual position, zxy(t). The speed in the above equation (v) corresponds to the approximate speeds of the insects in the following experimental scenarios.

Central-place foraging. For these experiments, we placed the insects in Edinburgh (55.9533°N, 3.1883°W), the United Kingdom, on August 2, 2024. We use local coordinates where the nest is at point zero, which is also the initial location of the insect. The insect’s speed was constant at v(t) = 0.5 m sec−1 for all t the insect was moving, or v(t) = 0 m sec−1, for those in which the insect was resting. This experiment had three phases: searching for a food source, homing, and foraging to a known food site.

A random route is generated in the initial phase, and the animal is forced to follow it (see ‘Defining a random foraging route’). The CX model is updated in each step using the current direction and speed, as computed by the difference between two subsequent points on the route. The final location of the route is stored as the goal vector memory. The insect then alternates the homing and foraging phases, with an hour of rest after every homing phase.

In the homing phase, the goal location is set to the zero point (home), and we update the angular and linear velocity of the animal using equations (36) and (37). When the insect nears its goal, the CX model produces a characteristic search pattern. In each step, we estimate the probability of the animal expressing such a pattern by detecting four consecutive turning points (see ‘Detecting a turning point’). The centroid of the four turning points approximates the centre of the search, which we interpret as the expressed goal location of the insect
zcentroid = 1/4 * Σ_{c=1}^{4} zc_turn: (38)

The foraging phase is similar to the homing, but we replace the goal location with the stored vector memory of the known food site.

Migration. For the migration experiments, we assume that insects can travel for a maximum of 8 h per day (only between sunrise and sunset), they need to stop every hour for rest and feeding, and that their stops last for 1 h. The speed of the insects was set to v(t) = 2.5 m sec−1, which is based on the speed of D. plexippus monarch butterflies (although this could differ in reality between insects), and the timestep used was dt = 50 min.

The simulation of autumn migration (from August 29 to October 31, 2024) of monarch butterflies (D. plexippus) started close to Mackinac Island (Table 1, departure point 5), Michigan, with a destination close to Michoacan, Mexico, which is 3303.01 km long. The spring migration (from March 29 to May 31 2024) was in the opposite direction. Winter (from November 21, 2024, to January 23, 2025) and summer migrations (from June 21 to August 23, 2024) were from the same locations as autumn and spring, respectively. The autumn migration (from September 4 to October 1, 2024) of Bogong moths (A. infusa) started close to Montrose (Table 1, departure point 2), Australia, with a destination close to Mount Bogong, which is 1114.65 km long. The spring migration (from March 4 to April 1, 2024) was in the opposite direction. Winter (from November 27 to December 24, 2024) and summer migrations (from May 27 to June 24, 2024) were from the same locations as spring and autumn, respectively. The spring migration (from February 4 to May 1, 2024) of globe skimmer dragonflies (P. flavescens) started close to Mbekenyera (Table 1, departure point 4), Tanzania, with a destination close to Madurai, India, which is 4859.20 km long. The autumn migration (from September 4 to December 1, 2024) was in the opposite direction. Winter (from November 27, 2024, to February 23, 2025) and summer migrations (from April 29 to July 24, 2024) were from the same locations as autumn and spring, respectively. Other departure points for all the insects are listed in Table 1.

Before each simulation, we add ±5° noise at the departure point and ±72 h noise at the departure time.

For the foraging experiments, we treat the world as a two-dimensional plane. For migration, it is necessary to consider the earth’s curvature; hence the equations for location and motion must be modified. The initial heading of the animal was calculated as
θ(t0) = tan−1(cos(ϕs) * sin(ϕe) − sin(ϕs) * cos(ϕe) * cos(Δλ) / sin(Δλ) * cos(ϕe)),
and the distance between two points on earth (haversine distance) was calculated as
ρ = 2 * R * tan−1(sqrt(sin2(Δϕ/2) + cos(ϕs) * cos(ϕe) * sin2(Δλ/2)) / sqrt(1 − sin2(Δϕ/2) + cos(ϕs) * cos(ϕe) * sin2(Δλ/2))),
where R = 6378137 m is the radius of earth and
λs = start longitude, ϕs = start latitude,
λe = target longitude, ϕe = target latitude, (39)
Δλ = λe − λs, Δϕ = ϕe − ϕs:
where west and south directions were represented as negative angles.

The location of the animal on earth was transformed into a complex number for consistency as
zxy(t) = ϕ(t) + iλ(t): (40)

Thus, in the CX model, the goal location for the migrating experiments is set as
G(t) = ρ * eiθ(t0): (41)

We transformed the location and direction of the animal into a quaternion, qxyθ, to facilitate spherical computations. We used the ‘Rotation’ package of the SciPy library in Python to do this (see the code for details). So steering was applied as
qxyθ(t) = qxyθ(t − dt) * cos(1/2 * dθ * dt) − k * sin(1/2 * dθ * dt), (42)
and forward movement as
qxyθ(t) = qxyθ(t − dt) * cos(v(t) * dt / 2R) + j * sin(v(t) * dt / 2R), (43)
where j and k are two of the imaginary parts in the quaternion. We always update the heading before moving forward, which composes one step in the simulation. Using the same SciPy package, we can transform the quaternion back to the coordinates of the animal on earth and its heading direction. The coordinates are then transformed into a complex number using equation (40).

Each simulation is run from the start to the end date of the migration, and the insects are allowed to travel only between sunrise and sunset.

Software
Defining a random foraging route. The initial search for food was created using a von Mises distribution and Newtonian physics. The starting point was set as the home location, zs = 0, and the final point (food source) was 100 m towards the east, ze = 100. We drew 25000 (5 * 100 m / 0.5 m sec−1 * 1 km) bearing directions for the path from von Mises distribution as
dθ / dt ∼ VonMises(μ = 0, κ = 100), (44)
and low-pass filtered to smooth the turns. Subsequently, the position was updated using equation (37). The generated positions were resized and rotated to end at the final point as
zxy(t) = zxy(t) * (ze − zs) / (zxy(te) − zxy(ts)): (45)

The positions were resampled every 0.5 m sec−1 using linear interpolation. The final heading directions were then calculated as d/dt * zxy, ∀ t > t0, where dt = 1 km.

Detecting a turning point. To detect the search pattern of an insect, we first needed to detect whether the insect changed its heading direction sufficiently. We mark a sufficient change in the heading when its difference from 25 m before is more than 120° and no other turning point was detected in the past 50 m.

Definition of the desert-ant return data
In Huber et al. (2015)40, they measured the distance between the desert-ant search area and their fictive nest (y), as a function of their foraging distance (x), and fit a quadratic equation to allow interpolation for any distances,
y = 2 * 10−5 * x2 + 0.083 * x + 1.96 m: (46)
In our analysis, we use this equation to compare our simulated results to the ones produced by animals.

Solar ephemeris. The sun’s course during the day depends on the location of the animal on earth and the time of the year. To calculate these, we use the ‘skylight’ Python package, which implements the solar ephemeris suggested by the Global Monitoring Laboratory of the US National Oceanic and Atmospheric Administration.

Performance evaluation
Given the total distance travelled (C) and the straight-line distance of the insect from the goal location (L), the tortuosity of the path at a specific time (t) is
ς(t) = C(t) / L(t): (47)
The Euclidean distance of the insect from its goal location is calculated as
ε = |zxy − zgoal|: (48)
In Figs. 6 and 5, all measurements were taken when the insect was closest to its centre of search.

Similarly, the error between the estimated (T) and actual day length (T*) is calculated as
εTL(t) = |TL(t) − T*L(t)|: (49)

Software
We used custom code for our simulations and data analysis. This was written in Python 3.9.7 using the PyCharm v2024.1 (Professional Edition) IDE, and open-source packages including: NumPy (v1.26.3), SciPy (v1.12.0), Skylight (v1.0b2), Pandas (v2.1.4), OpenPyXL (v3.1.5), Matplotlib (v3.8.0), Seaborn (v0.12.2), Contextly (v1.5.1) and Loguru (v0.5.3). The maps were created using the Contextly (v1.5.1) Python package with the CartoDB provider option. All clipart and data in the figures were created or reformatted using the Inkscape (v1.3.2) software.

Peer review rounds
[{"round": 1, "reviewer_comments": {"reviewer_1": "This paper addresses an obvious problem in animal navigation using a celestial compass: time compensation. Since\ncelestial objects move according to the time of the day and the season, without time information the direction encoding can\nbe very wrong. In addition, the viewing perspective of the celestial objects also depends on the latitude of the globe.\nThe paper starts by constructing a model that represents time based on the CRY1 protein expression found in the monarch\nbutterflies. In this model, the insect estimates the daylength from the skylight irradiance through the CRY1 protein level.\nThen based on the daylength, it’s straightforward to interpret the “sun dial” information. To encode the time information from\nthis daylength model, the authors hypothesize that two clock neurons found in fruit flies represent\nmodulation of the expected solar azimuth collectively. Specifically, these DN1pB corresponds to two orthogonal directions of the solar azimuth. Based\non previous studies, they further speculate that two types of TuBu1 neurons store the expected solar azimuth in the form of\nsin and cos (90deg phase offset). Finally, the solar declination and geometric latitude were modelled separately to\naccount for season and location. Putting all these together, the authors produced a model that can\ntrack an absolute direction based on solar azimuth independent of time and place. This model was\nput to test in two simulation experiments to demonstrate the\naccuracy with simple daytime compensation and with complete model compensation. If the authors feel that the above\nsummary is incorrect somewhere, it would be good to clarify that somewhere, as this is my\nunderstanding from reading the paper.\nIn general, this paper provides a comprehensive theoretical derivation on how time-compensated celestial navigation could\nwork in insects. However, due to some knowledge gaps from the current literature, several mechanistic speculations had to\nbe made in both the exact roles of certain neurons and the way solar azimuth is represented in the neurons. As a reader,\nI\nwould like to see more demonstration on the “alternative hypotheses” of these speculations. For instance, encoding a\nvariable with orthogonal dimensions is convenient\ncomputationally but may not be how biological systems work. For\nTuBu1a and TuBu1b, is the 90deg offset necessary for the circuit to work or can they be in any known offset? Is there an\nalternative configuration for Fig 1h?\nThe central-place foraging validation is good. I understand that the agent performs a random walk initially in each trial, so the\nnavigation circuit is challenged by a different homing initial condition (and directional integration). It would be useful to mark\nthe accuracy as measured experimentally in some foraging insects on the figure for reference. For the migration experiment,\nit seems like the agent starts from the same location every time, so the only variation is the 20% added compass noise. This\nis likely not a good enough representation of natural variation. Perhaps the authors should consider initializing the\nmigration\nwith at different time of the day, season, or minor changes in location. It would be interesting to know if the navigation model\nperforms better at any time or location. If the sole objective was to show that equator crossing requires complete\ncompensation, does it require a simulation as the sign flip is so drastic in the model? My suggestion would be to explore\nhow to add value to the migration simulations. For instance, is the direction variation in the simulation consistent with\nexperimentally measured migration paths, or direction choices in navigating insects. It would be informative to build a simple\nphenomenological model of navigation based on experimental data and compare to this mechanistic model of\nnavigation.\nIt\nwould be also informative to see under what other conditions the model might fail (if any).\nOverall, this is a very nice paper and would be informative to the community.", "reviewer_2": "This manuscript describes a speculative model by which insects navigating via celestial cues\nmight compensate for the\nmovement of the sun during the day. The authors have built a navigation model that combines\ninput from solar position,\ntimekeeping neurons, and magnetic fields. They develop a simple model based on the hour angle of the sun, and more\ncomplete model that adds an estimate of latitude acquired via geomagnetic inclination. They then simulate place foraging\nover periods of hours, and distant migrations that last over months, to demonstrate approximately\nsuccessful navigation.\nTo their credit, the authors have worked to keep the model based on input and circuits that real\ninsects are known to use,\nsuch as time clock neurons and magnetic inclination. Every step seems plausible, at least in some insects, and aimed at\nexplaining behavior that is observed, but not fully understood. To this end the models do offer believable mechanisms by\nwhich solar time compensation could be achieved in insects.\nMy main concern is that this process requires many steps of neural calculations that aren't\ndirectly tested. I have little sense\nof how likely this particular model is, and for which insects. Further, estimates of magnetic inclination,\nnecessary for the full\nmodel, seem particularly tricky to me. The only citation given to support this is for the monarch butterfly, which curiously\nmigrated fine in their simulations with just the hour-angle model. Does the globe skimmer dragonfly possess this sense? The\nauthors seem to claim that it must, as it crosses the equator, which required the full model. But magnetic inclination is\nespecially low aronud the equator---how well could an insect estimate this variable, and how sensitive would it be to local or\nsecular magnetic variation? Other than the comparison of complete and hour-angle models, the model lacks a rigorous\nsensitivity analysis. Many inputs, such as sun position, time-estimate of sunrise, and magnetic field inclination, are certainly\nsubject to error (such as by clouds). How much does this matter? My concern is that a complex model with many free\nparameters and little ground truthing might need much revision as our specific knowledge improves.\nMinor:\n280: \"This describes an oscillation with an annual period, which can be further decomposed into two sinusoidal functions\n(Fig. 2b).\"\n-This isn't what I normally think of as \"decomposing\" a sinusoid, since the cosine of this sinusoid has double its frequency. In\nother words it is not in terms of simpler functions. But further, the motivation for this step isn't clear to me, other than that it\nyields functions you want to use later?\nFig 2\n-Many axes are not labeled on the figure, or adequately described in the legend or main text. For example, in 2c it is quite\ndifficult to determine what is plotted when units are missing from both horizontal and vertical axes.\n430 \"Finally, Figure 4e-g shows the simulated routes of the globe skimmer dragonflies during their spring migration from\nMbekenyara (Tanzania) to Madirai (India), which is the world’s longest transoceanic migration (approximately 4859 km).\"\n-I don't understand, did this simulated migration also include \"daily travel capacity of insects is eight hours (at 2.5 m sec−1 ,\nbased on the speed of D. plexippus), and they need one-hour breaks every hour for feeding or rest\", even though those\naren't part of this migration?"}, "author_response": "Manuscript NCOMMS-24-42339\nResponse to reviewers\nReviewer #1 (Remarks to the Author):\nThis paper addresses an obvious problem in animal navigation using a celestial compass: time\ncompensation. Since celestial objects move according to the time of the day and the season,\nwithout time information the direction encoding can be very wrong. In addition, the viewing\nperspective of the celestial objects also depends on the latitude of the globe.\nThe paper starts by constructing a model that represents time based on the CRY1 protein\nexpression found in the monarch butterflies. In this model, the insect estimates the daylength from\nthe skylight irradiance through the CRY1 protein level. Then based on the daylength, it’s\nstraightforward to interpret the “sun dial” information. To encode the time information from this\ndaylength model, the authors hypothesize that two clock neurons found in fruit flies represent\nmodulation of the expected solar azimuth collectively. Specifically, these DN1pB corresponds to\ntwo orthogonal directions of the solar azimuth. Based on previous studies, they further speculate\nthat two types of TuBu1 neurons store the expected solar azimuth in the form of sin and cos (90deg\nphase oPset). Finally, the solar declination and geometric latitude were modelled separately to\naccount for season and location. Putting all these together, the authors produced a model that can\ntrack an absolute direction based on solar azimuth independent of time and place. This model was\nput to test in two simulation experiments to demonstrate the accuracy with simple daytime\ncompensation and with complete model compensation. If the authors feel that the above\nsummary is incorrect somewhere, it would be good to clarify that somewhere, as this is my\nunderstanding from reading the paper.\nIn general, this paper provides a comprehensive theoretical derivation on how time-compensated\ncelestial navigation could work in insects. However, due to some knowledge gaps from the current\nliterature, several mechanistic speculations had to be made in both the exact roles of certain\nneurons and the way solar azimuth is represented in the neurons.\n1. As a reader, I would like to see more demonstration on the “alternative hypotheses” of these\nspeculations. For instance, encoding a variable with orthogonal dimensions is convenient\ncomputationally but may not be how biological systems work. For TuBu1a and TuBu1b, is the\n90deg oPset necessary for the circuit to work or can they be in any known oPset? Is there an\nalternative configuration for Fig 1h?\nAnswer: We agree that it is very interesting to consider alternative hypotheses for the neural\nimplementation of the functions we describe. Indeed, orthogonal dimensions are necessary for this model\nto work, but we believe there is accumulating evidence that this is a common feature in how the insect\nbrain encodes information, particularly in pathways related to navigation. However, there are multiple ways\nto implement orthogonality, and for this specific example, the 90-degree oDset in bumps could be obtained\neither as we suggest (in diDerent neuron types, TuBu1a and TuBu1b) or between brain hemispheres, or\nthrough shifts in the downstream connections. We have added text in the discussion and a figure (Fig. 7)\nto highlight these alternative hypotheses:\nLines 506-515: “We note that the same trigonometric operations could be obtained by several alternative\ncircuit configurations that are functionally equivalent to our model. For example, the cosine and sine of the\nsolar azimuth could be encoded in left and right brain hemispheres (Fig. 7a) or implemented by oPset\nconnectivity (Fig. 7b). The number of ER5m and TuBu1 neurons could diPer (Fig. 7c), as has been observed\nin the D. melanogaster brain (Hulse et al, 2021), and the relative phase of their sinusoids be oPset by an\narbitrary amount (Fig. 7d).”\n[... Figure 7 and associated text omitted for brevity ...]\n2. The central-place foraging validation is good. I understand that the agent performs a random\nwalk initially in each trial, so the navigation circuit is challenged by a diPerent homing initial\ncondition (and directional integration). It would be useful to mark the accuracy as measured\nexperimentally in some foraging insects on the figure for reference.\nAnswer: Although it is diDicult to obtain comparable data (i.e., where it is clear that no other factors than\ncelestial compass accuracy can be influencing navigation accuracy) we have updated Fig. 3 (now Fig. 5) to\ninclude the most relevant estimate, from desert ants navigating over comparable distances after\ndisplacement in relatively empty environments, of their accuracy in homing (Huber and Knaden, 2015).\nInterestingly, additional data suggests that outward paths (to a remembered food source) are more\naccurate than homeward paths (PfeDer et al., 2015), which corresponds to our simulation results for the\ncomplete, but not the hour-angle, model. We have added discussion of this observation to the text\ndescribing these results.\nLines 338-344: “Experiments with desert ants suggest that their homing error is slightly higher than the one\nour simulations produced using any model (Huber and Knaden, 2015) (Fig 5d, green dashed line).\nInterestingly, the foraging routes of the real animals appear to be significantly more accurate than their\nhoming routes (PfePer et al., 2015), which is only in line with the predictions of the complete model.”\n[... Figure 5 and associated text omitted for brevity ...]\n3. For the migration experiment, it seems like the agent starts from the same location every time,\nso the only variation is the 20% added compass noise. This is likely not a good enough\nrepresentation of natural variation. Perhaps the authors should consider initializing the\nmigration with at diPerent time of the day, season, or minor changes in location. It would be\ninteresting to know if the navigation model performs better at any time or location.\nAnswer: This suggestion to explore the eDects of variation in start location, time of day and season was very\nhelpful to enhance the analysis of our model performance. We kept the 20% compass noise and varied our\nexperiments by randomly altering the starting location (±5° in latitude and longitude) and time (±72 hours)\namong runs. We also initialised the migrations from diDerent locations along the Canadian border\n(butterflies), east African coast (dragonflies) and southeast Australia, allowing comparisons among\ndiDerent angles of travel. We have augmented our Fig. 4 (now Fig. 6) and text to include and comment these\nresults.\nLines 395-429: “Figure 6a mimics the southward autumn migration routes of monarch butterflies using the\nhour angle (blue) and complete models (yellow), starting in late August from Mackinac Island (Michigan)\nand ending in late October in Michoacan (Mexico). Figure 6b shows similar migrations, starting from\ndiPerent locations across the Canadian border and California. Figure 6c summarises the performance of\nthe two models in the above migrations. The variability in the performance comes from variations in the\ndeparture location (±5° in longitude and latitude) and time (±72 h). Overall, the performance of the two\nmodels seems very similar.\nFigure 6d shows the simulated routes of Bogong moths during autumn migration from Montrose (Australia)\nsouth to Mount Bogong. Figure 6e shows similar migrations starting from diPerent locations in Australia. As\nthis migration occurs in the south hemisphere, we use the CCW version of the hour angle model. Figure 6f\nsummarises the migration performance of the two models in the southern hemisphere, showing\ninsignificant diPerences between the two models. The lower final distances from the goal than the\nbutterflies are simply because the overall migration distances are shorter so less error accumulates.\nFinally, Fig. 6g shows the simulated routes of the globe skimmer dragonflies during their spring migration\nfrom Mbekenyara (Tanzania) to Madirai (India), which is the world's longest transoceanic migration\n(approximately 4859 km). Figure 6h shows similar migrations starting along the east African coast. In these\nsimulations, we use the equator-specific hour angle model. Figure 6i summarises the migration\nperformance using the two models, where we see some more significant diPerences in their performance.\nSupplementary Fig. S5, S6 and S7 show the respective migrations of butterflies, moths and dragonflies\nusing alternative hour angle models.”\n[... Figure 6 and associated text omitted for brevity ...]\n4. If the sole objective was to show that equator crossing requires complete compensation, does\nit require a simulation as the sign flip is so drastic in the model? My suggestion would be to\nexplore how to add value to the migration simulations. For instance, is the direction variation\nin the simulation consistent with experimentally measured migration paths, or direction\nchoices in navigating insects. It would be informative to build a simple phenomenological\nmodel of navigation based on experimental data and compare to this mechanistic model of\nnavigation. It would be also informative to see under what other conditions the model might\nfail (if any).\nAnswer: We appreciate this suggestion but feel it is beyond the scope of our work to fully investigate\nmechanisms of migration, e.g., by constructing phenomenological models fitted to experimental data\n(which in any case is limited in respect of providing detailed migration paths, or accuracy of individuals).\nOur intent in this paper is rather to explore the consequences, in migrating insects, of our proposed\nmechanisms for time compensation in the use of a celestial compass. We updated our text to clarify this.\nLines 367-376: “We therefore simulated insect migration, over realistic travel distances and directions,\nusing migration routes inspired by three diPerent insect species: the monarch butterfly D. plexippus, the\nBogong moth Agrotis infusa, and globe skimmer dragonfly Pantal flavescens. We selected these species to\ndemonstrate migration in diPerent characteristic locations on earth relative to its equator: above (D.\nplexippus), below (A. infusa), or across (P. flavescens). In this way, we test our model in locations where the\nsun moves CW, CCW, or switches its moving pattern during the migration.”\nWe have also updated our model for the equator-crossing migration to test whether the ‘sign flip’ could be\nhandled by an hour-angle model that sets the north-most axis to zero, and thus tracks only the switch of\nthe sun azimuth from east to west (neglecting whether this is clockwise or counterclockwise).\nLines 130-135: “Near the equator, the sun moves almost vertically (crossing the zenith) from east to west.\nIn this case, a zero north-most component (ω = 0; no vertical vector in Fig. 1d) would be more accurate\nand avoids any assumption regarding CW or CCW sun movement.”\nWe find that, although not as accurate as the complete model compensation, this does allow the migration\nto reach the approximate intended location. Correspondingly we now believe the complete model may not\nbe necessary even in this case, although it would remain necessary for an insect that needed to flexibly\nadapt to diDerent geographical locations. We have updated the results and discussion to reflect this\ninsight. Combined with our additional migration simulations (see Fig. 6, Supplementary Figures S5, S6, S7,\nand S8) we hope that this work provides a solid basis for future exploration of insect migration.\nLines 335-345: “The hour-angle model deviates more from the desired destination point for the dragonflies\ncrossing the equator (Fig. 6i), but it can still drive the animal fairly close to its destination. The observed\nerror results from a consistent bias rather than lower precision (Supplementary Fig. S8), which a constant\noPset could compensate for. Therefore, the only clear advantage of the complete model is that it allows full\nadaptation to diPerent environments. In contrast, we had to choose the appropriate variant of the hour\nangle model for simulated migration above, below or across the equator.”\nOverall, this is a very nice paper and would be informative to the community.\nAnswer: We thank the reviewer for their constructive feedback, which has certainly improved our paper.\nReviewer #2 (Remarks to the Author):\nThis manuscript describes a speculative model by which insects navigating via celestial cues\nmight compensate for the movement of the sun during the day. The authors have built a navigation\nmodel that combines input from solar position, timekeeping neurons, and magnetic fields. They\ndevelop a simple model based on the hour angle of the sun, and more complete model that adds\nan estimate of latitude acquired via geomagnetic inclination. They then simulate place foraging\nover periods of hours, and distant migrations that last over months, to demonstrate approximately\nsuccessful navigation.\nTo their credit, the authors have worked to keep the model based on input and circuits that real\ninsects are known to use, such as time clock neurons and magnetic inclination. Every step seems\nplausible, at least in some insects, and aimed at explaining behavior that is observed, but not fully\nunderstood. To this end the models do oPer believable mechanisms by which solar time\ncompensation could be achieved in insects.\nAnswer: We are grateful for the reviewer’s comments below, which we believe strengthen our manuscript.\n1. My main concern is that this process requires many steps of neural calculations that aren't\ndirectly tested. I have little sense of how likely this particular model is, and for which insects.\nAnswer: We appreciate this concern but would emphasise that the key elements presented here actually\ninvolve very few steps of neural calculations. Indeed, the core idea consists of essentially one step, the\ncombination of (known) time encoding with (known) spatial encoding, based on identified circuits in the\ninsect brain. The spatial encoding is well supported by previous (biologically grounded) modelling, as are\nall the downstream neural processes to support the navigation behaviour. We agree that the input to the\ntemporal encoding is much more speculative, but believe it is an important contribution to have identified\nsome crucial properties this encoding needs to satisfy, such as being able to synchronise to daylength, not\njust sunrise. With regard to how temporal and spatial encoding is combined, we believe this is the first\nattempt to describe a concrete neural mechanism to provide the required function, and in response to this\ncomment and related comment 1 from reviewer 1, we have added a figure (Fig. 7) and further discussion of\nhow alternative neural implementations might support the equivalent function.\nLines 506-515: “We note that the same trigonometric operations could be obtained by several alternative\ncircuit configurations that are functionally equivalent to our model. For example, the cosine and sine of the\nsolar azimuth could be encoded in left and right brain hemispheres (Fig. 7a) or implemented by oPset\nconnectivity (Fig. 7b). The number of ER5m and TuBu1 neurons could diPer (Fig. 7c), as has been observed\nin the D. melanogaster brain (Hulse et al, 2021), and the relative phase of their sinusoids be oPset by an\narbitrary amount (Fig. 7d).”\n[... Figure 7 and associated text omitted for brevity ...]\n2. Further, estimates of magnetic inclination, necessary for the full model, seem particularly\ntricky to me. The only citation given to support this is for the monarch butterfly, which curiously\nmigrated fine in their simulations with just the hour-angle model. Does the globe skimmer\ndragonfly possess this sense? The authors seem to claim that it must, as it crosses the equator,\nwhich required the full model. But magnetic inclination is especially low around the equator–\nhow well could an insect estimate this variable, and how sensitive would it be to local or\nsecular magnetic variation?\nAnswer: This is a very relevant comment, and as a consequence we have explored whether there is an\nalternative by which the dragonfly (or other equator-crossing) insects could support navigation without\nexplicitly sensing the latitude (through magnetic inclination or other means). We realised that a variation\non the hour-angle model that sets the north-most element to zero produces an estimate of azimuth that\nsimply switches from directly east to directly west at solar noon, which adequately approximates the path\nof the sun near the equator, neglecting any assumption of clockwise or counterclockwise rotation. Using\nthis model for the dragonfly produced relatively successful migration paths, although not as accurate as\nthe complete model. We have added these results and appropriate discussion to the text. We have also\ncarried out a sensitivity analysis including noise in the magnetic inclination as detailed in our response to\nthe next comment.\nLines 130-135: “Near the equator, the sun moves almost vertically (crossing the zenith) from east to west.\nIn this case, a zero north-most component (ω = 0; no vertical vector in Fig. 1d) would be more accurate\nand avoids any assumption regarding CW or CCW sun movement.”\nLines 430-445: “The complete model generally resulted in straighter migration routes than the hour-angle\nmodels. However, the deviations induced by the less accurate hour-angle model largely cancel out during\nthe day. As a result, in the single-hemisphere migrations, both models could bring the animals close to their\ndestinations (Fig. 6c and f). The hour-angle model deviates more from the desired destination point for the\ndragonflies crossing the equator (Fig. 6i), but it can still drive the animal fairly close to its destination. The\nobserved error results from a consistent bias rather than lower precision (Supplementary Fig. 8), which a\nconstant oPset could compensate for. Therefore, the only clear advantage of the complete model is that it\nallows full adaptation to diPerent environments. In contrast, we had to choose the appropriate variant of the\nhour angle model for simulated migration above, below or across the equator.”\n3. Other than the comparison of complete and hour-angle models, the model lacks a rigorous\nsensitivity analysis. Many inputs, such as sun position, time-estimate of sunrise, and magnetic\nfield inclination, are certainly subject to error (such as by clouds). How much does this matter?\nAnswer: We have added a sensitivity analysis which models error in sun position, time estimation and\nmagnetic field inclination as random uniformly distributed noise of diDerent magnitudes. We find that noise\nof up to 25% of the maximum possible measurement value in magnetic inclination (i.e. up to +/-45 degrees,\nas above) and time (i.e. up to 6 hours) does not significantly aDect accuracy; noise in the sun’s position\nestimations has smaller eDect, because it is encoded by a larger population of neurons (eight) than the\nmagnetic inclination and time information (two each). This latter point was verified by running the same\nanalysis when noise was introduced in the sun azimuth itself instead of its neural representation, which\nled to a more rapid decrease in navigation accuracy as the noise level increased. We added these results\nin Fig. 6j and updated the text accordingly:\nLines 446-462: “We performed further sensitivity analysis by introducing random sensor noise from a\nuniform distribution, with the upper and lower bounds set as a percentage of the maximum possible\nmeasurement value (Fig. 6j). For the hour angle, the error (average distance from goal across all migrating\nspecies) becomes significant only for unrealistic levels of noise in estimating the time (more than 25%\nnoise, corresponding to 6 h). Magnetic inclination measurements are expected to be noisier (especially\nnear the equator) but had to exceed 45° to produce noticeable error. If noise in the sun position is\nintroduced independently in each TuBu1 neuron, then its ePect averages out across the eight-dimensional\nencoding of the angle, leading to little change in migration error as the noise level is increased (solid grey\nline in 6j). If the noise is added to the sun's angle before TuBu1, the error increases more rapidly, from\naround 10°) (dashed grey line in Fig. 6j).”\n[... Figure 6j and associated text omitted for brevity ...]\n4. My concern is that a complex model with many free parameters and little ground truthing might\nneed much revision as our specific knowledge improves.\nAnswer: Although it might appear that the model has many free parameters, e.g., in connection weights\nbetween neurons, in fact these parameters are strongly constrained by the trigonometric principles that\nthe network needs to implement. In practice, there are very few (only 3) parameters that were optimised for\nthe model using realistic constraints. Nevertheless, we agree the model might need much revision as our\nspecific knowledge improves. In our view, this does not diminish the usefulness of publishing the model in\nits present form to help guide future investigations.\nMinor:\n5. 280: \"This describes an oscillation with an annual period, which can be further decomposed\ninto two sinusoidal functions (Fig. 2b).\"\nThis isn't what I normally think of as \"decomposing\" a sinusoid, since the cosine of this sinusoid\nhas double its frequency. In other words it is not in terms of simpler functions. But further, the\nmotivation for this step isn't clear to me, other than that it yields functions you want to use later?\nAnswer: We understand the confusion of the reviewer and we changed our wording to clarify this. Although\nthe solar declination is an annual oscillation, it is also an angle. If we think of it as a unit vector in polar\ncoordinates, the sine and cosine of this vector can represent this angle, while their combination can\nreconstruct it. We hope our wording clarifies this:\nLines 259-261: “This oscillating angle with an annual period can be described by its sine and cosine\ncomponents (Fig. 4b).”\nWe also updated our Fig. 2c (now Fig. 4c) to make the geometrical relation of the diDerent components\nmore apparent.\n[... Figure 4 and associated text omitted for brevity ...]\nRegarding the motivation for this step, the reviewer’s intuition is correct: it yields functions we want to use\nlater. In our models, the key components are neurons whose activity must be bounded. Representing an\nangle directly as strength of neural activity is a poor computational solution (e.g. not easily expressing that\n360 = 0) and does not reflect our knowledge of how neural activity represents angles in the insect brain.\nExpressing the angle by its sine and cosine creates convenient boundaries for the activity and aligns with\nour claim that neural activity and connections in navigation-related areas of the insect brain must conform\nto trigonometry.\nLines 476-479: “We suggest that this correction relies on trigonometric principles for spatial and temporal\nprocessing, and show a plausible neural mechanism by which the required trigonometry could be\nimplemented.”\n6. Fig 2\nMany axes are not labeled on the figure, or adequately described in the legend or main text. For\nexample, in 2c it is quite diPicult to determine what is plotted when units are missing from both\nhorizontal and vertical axes.\nAnswer: We are sorry this figure (now Fig. 4, as shown above) caused confusion. We have revised the figure,\nreplacing the previous schematic illustrations (c and f) with geometric explanations to describe the role of\nsolar declination and latitude in the transformation of the hour angle to the solar azimuth estimate. Panels\nb and e are unchanged as they already had labelled axes (noting that for the sinusoids (lower plots), the y-\naxis lacks units as these are arbitrary). We hope the figure is now clear.\n7. 430 \"Finally, Figure 4e-g shows the simulated routes of the globe skimmer dragonflies during\ntheir spring migration from Mbekenyara (Tanzania) to Madirai (India), which is the world’s\nlongest transoceanic migration (approximately 4859 km).\"\nI don't understand, did this simulated migration also include \"daily travel capacity of insects is eight\nhours (at 2.5 m sec−1, based on the speed of D. plexippus), and they need one-hour breaks every\nhour for feeding or rest\", even though those aren't part of this migration?\nAnswer: In our simulations, all insects have the same daily migrating pattern, based on the monarch\nbutterfly. This was for simplicity, as it was not our aim to model migration in detail, but rather to assess the\nproposed mechanisms of time compensation over realistic geographic ranges. Rerunning the simulation\nwithout the one-hour breaks produced smoother paths but did not change the overall results. We have now\nclarified this in the text by adding:\nLines 338-392: “The daily travel capacity was set at eight hours (at 2.5 m sec-1, based on the speed of D.\nplexippus), with one-hour breaks every hour for feeding or rest (using continuous travel produced\nsomewhat smoother courses but did not change the overall results).”\nLines 802-809: “For the migration experiments, we assume that insects can travel for a maximum of 8 h per\nday (only between sunrise and sunset), they need to stop every hour for rest and feeding, and that their\nstops last for 1 h. The speed of the insects was set to v(t) = 2.5 m sec-1, which is based on the speed of D.\nplexippus monarch butterflies (although this could diPer in reality between insects), and the time step used\nwas dt = 50 min.”"}, {"round": 2, "reviewer_comments": {"reviewer_1": "I am happy with the revision in this version as it addresses most of my concerns. The authors have put in great work in\nrefining the analysis.", "reviewer_2": "The authors have done an excellent job of addressing my comments, and I'm especially pleased with the addition of a\nsensitivity analysis. My only remaining point of confusion is with my final comment, where the authors seemed to simulate 8\nhour daily travel and hourly rest periods for the globe skimmer migration between East Africa and India. They now comment\nthat continuous travel makes little difference to the results of the model, and skipping the rest period produced no significant\nchanges. But these details are just inserted without specific reference to the globe skimmers. The reason for my initial\nconfusion was that I was unsure if these parameters were the same for the globe skimmer migration, so I think it would be\nmost helpful to mention that specifically when discussing the dragonfly."}, "author_response": "Manuscript NCOMMS-24-42339\nResponse to reviewers\nReviewer #2 (Remarks to the Author):\nThe authors have done an excellent job of addressing my comments, and I'm especially pleased\nwith the addition of a sensitivity analysis. My only remaining point of confusion is with my final\ncomment, where the authors seemed to simulate 8 hour daily travel and hourly rest periods for the\nglobe skimmer migration between East Africa and India. They now comment that continuous travel\nmakes little diDerence to the results of the model, and skipping the rest period produced no\nsignificant changes. But these details are just inserted without specific reference to the globe\nskimmers. The reason for my initial confusion was that I was unsure if these parameters were the\nsame for the globe skimmer migration, so I think it would be most helpful to mention that\nspecifically when discussing the dragonfly.\nAnswer: We have altered our text to clarify this in the paragraph where we discuss the dragonfly results.\np. 5, §4, line 3: “Although dragonflies may fly more continuously during their transoceanic migration, for\nconsistency we used the same migration time pattern as for the monarch butterfly (travel at 2.5 m sec-1 with\nforaging brakes). Exploratory simulations using continuous migrations produced smoother routes but led\nto the same conclusions.”"}]

Decision letter