Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rdf action should be able to return the raw-rdf values #1650

Merged
merged 4 commits into from
Feb 2, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pytraj/all_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,8 @@ def rdf(traj=None,
center_solute=False,
intramol=True,
frame_indices=None,
top=None):
top=None,
raw_rdf=False):
'''compute radial distribtion function. Doc was adapted lightly from cpptraj doc

Returns
Expand Down Expand Up @@ -1132,6 +1133,8 @@ def rdf(traj=None,
intramol : bool, default True, optional
if False, ignore intra-molecular distances
frame_indices : array-like, default None, optional
raw_rdf : bool, default False, optional
if True, return the raw (non-normalized) RDF values

Examples
--------
Expand Down Expand Up @@ -1171,13 +1174,14 @@ def rdf(traj=None,
center1_ = 'center1' if center_solvent else ''
center2_ = 'center2' if center_solute else ''
nointramol_ = 'nointramol' if not intramol else ''
raw_rdf_ = "rawrdf pytraj_tmp_output_raw.agr" if raw_rdf else ''
hainm marked this conversation as resolved.
Show resolved Hide resolved

# order does matters
# the order between solventmask_ and solutemask_ is swapped compared
# to cpptraj's doc (to get correct result)
command = ' '.join(("pytraj_tmp_output.agr", spacing_, maximum_,
solventmask_, solutemask_, noimage_, density_, volume_,
center1_, center2_, nointramol_))
center1_, center2_, nointramol_, raw_rdf_))

c_dslist, _ = do_action(traj, command, c_action.Action_Radial)
# make a copy sine c_dslist[-1].values return view of its data
Expand Down
Loading