Chemical sensor based on long-period fiber grating response to index of refraction