Sensor applications often lead to nonuniform gratings. If the sensed environmental parameter varies continuously over the length of the grating, the grating parameters also vary, resulting in a nonuniform grating.
Optigrating uses the solution to the coupled mode equations for uniform gratings. It approximates nonuniform gratings by dividing the length of the grating into steps uniform segments. You noticed the sensor response changes with steps. Try a nonuniform grating and look at the profile, you should see it changes too. For a nonuniform grating you should see the grade resolved into a staircase where the number of steps over the whole length is steps. To calculate the spectrum of a nonuniform grating, Optigrating will use the scattering matrix of each uniform segment to calculate the spectrum of the whole grating.