general probe code, for 2D or 3D files