Experimental determination of an effective demagnetization factor for nonellipsoidal geometries