return exit code 1 if spectrum is invalid