Z-scan study of the thermo-optical effect