analysis script for sweep N