Text this: Sensor with enhanced performance based on photonic crystal with a defect layer