Optimized spatial loading, added a -localrms option to specify how the patch average is calculated