script for near-ish field array factor