From spatio-temporal data to a weighted and lagged network between functional domains: Applications in climate and neuroscience