A computational physics method is described for calculating the mooro-optical constants of solids based on the micro-data obtained from computation of electronic structure in solids. As an example, the absorption coefficient of metal Gd is calculated under the approximation of joint density of states.