Implement global fit in ncs.py