parametrized macro for intensity measurements