1. A computer-implemented method of generating an electromagnetic field (EMF) correction boundary layer (BL) model corresponding to a mask, comprising using a computer to perform a method, the method including: (a) determining asymmetry factor data from aerial image measurements of a plurality of different gratings representative of features provided on a mask, the aerial image measurements having been made at a plurality of different focus settings; and (b) determining boundary layer (BL) model parameters of an EMF correction BL model corresponding to the mask by fitting to the asymmetry factor measurements, wherein step (a) includes determining first asymmetry factor data corresponding to first mask features from aerial measurements of a first grating of the plurality of different gratings, and determining second asymmetry factor data corresponding to second mask features from aerial measurements of a second grating of the plurality of different gratings and different from the first grating, and step (b) includes determining feature-dependent BL model parameters including first BL model parameters and second BL model parameters, the first BL model parameters differing from the second BL model parameters according to a difference between the first and second gratings.