pythonised full set of code needed to sweep_MNTB_fit.py