Supplement 1. Code developed to assess the effect of spatial heterogeneity on insect fitness as implemented in Matlab 7.10.0 (r2010a).
The sigmascalculation.m and sigmasmodel.m files are code developed to assess the effect of spatial heterogeneity on insect fitness as implemented in Matlab 7.10.0 r2010a. A grid of temperature data is inputted into sigmascalculation.m and the code calculates spatial heterogeneity for each point on the grid (in this case, the grid is a half degree global grid). The sigmasmodel.m file inputs tave (average temperature), xt (seasonality or sigma_t), and sigmas (spatial heterogeneity or the result from sigmascalculation.m) to calculate physiology metrics ctmax (critical thermal maximum), ctmin (critical thermal minimum), and topt (thermal optimum).