A positional deviation between a phase distribution in a wavefront sensor and a compensation phase pattern in a wavefront modulator is corrected in a short time and with high accuracy by a method including a first step of causing the wavefront modulator to display a singularity generation pattern, a second step of measuring in the sensor an adjustment wavefront shape when an optical image modulated by the singularity generation pattern enters the wavefront sensor, a third step of detecting a position of a singularity in the adjustment wavefront shape from a measurement result in the sensor, and a fourth step of adjusting a positional deviation between a wavefront shape measured in the wavefront sensor and a compensation pattern displayed on the wavefront modulator based on a positional deviation of the position of the singularity.