The influence of environmental and physical factors on the thermal patterns of headwater streams