Enhancement of temperature measurement by using photonic bandgap effect