Improved ratio calculation script, including systematic propagation