diff options
author | Volker Hoffmann <volker@cheleb.net> | 2015-10-27 10:00:08 +0100 |
---|---|---|
committer | Volker Hoffmann <volker@cheleb.net> | 2015-10-27 10:00:08 +0100 |
commit | ed36d6d3bf3cf46dc42285f88af52eb31a0f6ede (patch) | |
tree | 5b9af5d62008d8af21cad14821d025f048fad7fc | |
parent | b8a4acf87c40e8986b4b6697f79f2a292541b8c4 (diff) |
feat: filter sources by ifname, so that we can use a single dataframe for many runs
-rw-r--r-- | Helpers/formation_helpers.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Helpers/formation_helpers.py b/Helpers/formation_helpers.py index 5652c99..395aff0 100644 --- a/Helpers/formation_helpers.py +++ b/Helpers/formation_helpers.py @@ -172,8 +172,12 @@ def compute_wmf(dfo, dfo_t0, dfc, showstep=False): dfo_loc = dfo_row[1] # Identify Source Particles - sources = return_sources(int(dfo_loc.pid), dfc_now) - dfo_sources = dfo_t0[dfo_t0.pid.isin(sources)] + sources = \ + return_sources(int(dfo_loc.pid), \ + dfc_now[dfc_now.ifname == int(dfo_loc.ifname)]) + dfo_sources = \ + dfo_t0[(dfo_t0.pid.isin(sources)) & \ + (dfo_t0.ifname == int(dfo_loc.ifname))] # Compute WMF (Raymond+ 2004, Ronco+ 2014) dfo_sources.loc[:,'wmf_01'] = \ |