When substrate is processed, also any measurement grating marks available on the substrate will be influenced: they will be deformed asymmetrically, which gives rise to a measurement-shift error when measuring such a grating mark. To measure on a processed mark, an algorithm is used. This algorithm describes a method to calculate the weight factor of the information from each order. The weight factors of such an algorithm are based on a model which describes the measurement position as a function of the diffraction orders and the mark position. This paper proposes an algorithm for finding these weight factors, and the feasibility of the method is validated through simulation.