Structural analysis and optical and electrical characterization of the ordered defect compound CuIn5Se8