def write_array_info(event, output_filename):
    """
    Write the array info to a HDF5 file
        - layout info is writen in '/instrument/subarray/layout'
        - optics info is writen in '/instrument/telescope/optics'
        - camera info is writen in '/instrument/telescope/camera/{camera}' for each camera in the array

    Parameters
    ----------
    event: `ctapipe.io.DataContainer`
    output_filename: str
    """
    serialize_meta = True
    sub = event.inst.subarray
    sub.to_table().write(output_filename, path=
        '/instrument/subarray/layout', serialize_meta=serialize_meta,
        append=True)
    sub.to_table(kind='optics').write(output_filename, path=
        '/instrument/telescope/optics', append=True, serialize_meta=
        serialize_meta)
    for telescope_type in sub.telescope_types:
        ids = set(sub.get_tel_ids_for_type(telescope_type))
        if len(ids) > 0:
            tel_id = list(ids)[0]
            camera = sub.tel[tel_id].camera
            camera.to_table().write(output_filename, path=
                f'/instrument/telescope/camera/{camera}', append=True,
                serialize_meta=serialize_meta)
