Optical properties of 1D metal nanogratings