Create magnitude function, call through novelty_detector script