add write hdr file in go