Refractive index and packing density for MgF2 films: Correlation of temperature dependence with water sorption