Created
June 25, 2015 20:22
-
-
Save astatide/e751b38c869f477ee637 to your computer and use it in GitHub Desktop.
w_select predicate function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For use with w_select.py, part of the WESTPA west_tools package | |
# Thanks to Ali Sinan Saglam | |
def predicate(n_iter, iter_group): | |
pcoord = iter_group['pcoord'] | |
collection = [] | |
# Iterate over the segments | |
for iseg,seg in enumerate(pcoord): | |
# seg should return the pcoord array for every timepoint. | |
# If your pcoord is N dimensional, be sure to return the appropriate dimension | |
# seg[timepoint,dimension] | |
# Check the final timepoint for some logic; in this case, is our final pcoord timepoint | |
# over 5.0? | |
if seg[-1,0] > 5.0: | |
collection.append(iseg) | |
return collection |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment