finished script to calculate data frame with macroscopic values