Outputting 10 spectrum images to a file