Investigating the impact of heatwaves on natural and agricultural ecosystems