Study site and animals

We recorded data at ambush sites selected by free-ranging sidewinder rattlesnakes, Crotalus cerastes, found on the Barry M. Goldwater range (managed by US Marine Corps) near Yuma, Arizona, USA. The most important mammalian prey of sidewinder rattlesnakes are kangaroo rats (Dipodomys spp.) followed by pocket mice (Pergonathus and Chaetodipus spp.)29. Nocturnal mammals are eaten by sidewinders ranging in size from ca. 25 to 60 cm snout-vent length (SVL)29. We collected data from snakes of all sizes, but our sample is skewed towards smaller snakes (SVL: 35.6 ± 5.6 cm, mean ± SD)30 because they were most abundant at our field site.

The study site consists of sand dunes interspersed with bushes31 (Fig. 1). Data collection took place between 19 May and 31 July 2017. During the summer months, sidewinders are primarily nocturnal32. Therefore, all data collection was performed in darkness between 20:00 h and 02:00 h, and in calm conditions to ensure consistent temperature gradients between sand and bushes. As thermal conditions and an individual’s direction of orientation may change over the night, we collected data (including thermal imaging) immediately after locating a snake in ambush posture to ensure ecological relevance. Although a time-lapse panorama of the ambush site and ambush direction would provide a more complete thermal picture, this was not logistically feasible.

Field data collection

We located hunting snakes by following tracks left in the sand33. When rattlesnakes are ambush hunting, they locate a suitable site, stop, and assume a stereotypical coiled body position facing a particular direction1,32. We first recorded the compass bearing each snake was facing before temporarily collecting the snake. To record thermal panoramas, we centred an inverted tripod on the snake’s original head position and attached a FLIR T-420 thermal imaging camera (FLIR Systems, Wilsonville, OR, USA) to capture a series of near-ground thermal images later merged into a 360° thermal panorama (Fig. 2a; original image resolution 240 × 320 pixels). For all ambush sites, we positioned the camera to keep the horizon level and approximately in the middle of the image. Panoramas thus included, on average, 50% ground and 50% sky. In addition, we recorded air temperature (°C) and relative humidity (%) at each ambush site.

Snakes were measured, a microchip (8 mm PIT tags, Biomark, Boise, ID, USA) implanted for identification of recaptures, and released at the point of capture. We did occasionally recapture the same individuals later in the season, so we were able to collect data on more than one ambush site for some individuals. We recorded a total of 122 infrared panoramas from ambush sites selected by 67 individual snakes.

All methods were carried out in accordance with the relevant guidelines and regulations and approved by the San Diego State University Institutional Animal Care and Use Committee (APF 16-08-014 C).

Data processing

We used FLIR Tools + v5.4.1 software (FLIR Systems, Wilsonville, OR, USA) to assemble and visually check the quality of all panoramas. Each panorama consisted of a 240 row x ca 4800 column matrix of temperatures (Fig. 2a). This was then imported into MATLAB R2017a (The MathWorks Inc., Natick, MA, USA).

The MATLAB script saved the panorama, and then generated a simulated rodent target roughly the size and shape of a Merriam’s kangaroo rat, Dipodomys merriami, viewed from 0.3 m. It consisted of two superimposed ellipses, one for the body and one for the head, with separate temperatures based on regression equations relating wild kangaroo rat surface temperatures to air temperature (data from34).

The script then placed target at one of 72 positions spaced at 5° intervals. The estimated appearance of the panorama to the snake was computed using the optical and heat transfer analysis procedure described in Bakken and Krochmal16 (Fig. 2b,c). We assumed an elliptical spread function (major diameter = 15°, minor diameter = 7.5°, air temperature as measured in field). This spread function is limited by the vertical angle of the thermal images. It is somewhat smaller and therefore would produce a slightly sharper image than the neurally sharpened forward direction spread function found by Stanford and Hartline35 for C. oreganus. Unfortunately, no data is available for the neurally sharpened spread function of sidewinders. The procedure was repeated for each placement of the target, creating 73 simulated panoramas for each ambush site, one without (Fig. 2b) and 72 with (Fig. 2c) the simulated rodent.

For each panorama, we then estimated how detectable the simulated rodent target might be against that background at each of the 72 evenly spaced compass directions as follows. Panoramas consisted of a matrix of pixels, each with an associated temperature value. To compute the contrast index of target detectability, we subtracted the image matrix without the target from the image matrix with the target. The result has zeros for all pixels except those where the target is located. There, the value is the difference between background and target temperature. We then summed over rows and columns to compute a contrast index equal to the area x temperature difference for each rodent position around the panorama (Fig. 2d; Supplementary Video; MATLAB script available on request). We refer to this measure as ‘contrast’, where higher values indicate a greater total temperature change caused by the presence of the rodent. In addition, we calculated the rate of change (first derivative) of contrast values across a panorama to identify points where this contrast index changed rapidly (Fig. 2e). The sign of the first derivative of contrast only indicates the direction of simulated motion, so absolute values were used for analysis.

Statistical analysis

We used linear mixed models to determine whether contrast or rate of change of contrast in ambush direction were different from the contrast or rate of change of contrast averaged over the entire panorama. This allowed us to determine if snakes chose to face ambush directions with higher thermal contrast or higher rate of contrast change than available on average. The models included a random intercept for snake ID to statistically account for the non-independence of repeated measurements from the same snake. Snakes respond to positive and negative thermal contrast, though response to negative contrast is typically weaker14,15,26. We therefore analysed absolute contrast values. There was considerable variability among panoramas in the range of contrast values. This could be problematic as the direction faced is probably irrelevant to snakes when contrast is nearly uniform. We therefore weighted panoramas according to within-panorama standard deviation of raw contrast values.

The qualitative properties of the thermal environment may change over the course of the night as bushes, air, and substrate temperatures cool at different rates. Therefore, in the absence of time lapse data, we ran a linear regression to test whether the variability in contrast values was a function of time since sunset. All statistical analyses were done in R v3.2.336 using the package lme437.