-
Hello, Code I am referring to for calculating RDF -- https://github.com/deepmodeling/dpdata/blob/master/dpdata/md/rdf.py As we can see in the above code it accepts System or LabeledSystem.What are the changes need to make in the above if I give MultiSystem? I used the following code to create MultiSystem from this link ` def get_systems(path, jdata): I also tried to calculate iteratively for every data folder -- xx coordinates came the same and RDF values were coming different. Please suggest what changes do I need to make or Do I need to use data from all the folders for RDF generation ? Thank You |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Weighted average over the rdfs calculated from different |
Beta Was this translation helpful? Give feedback.
-
Final Solution -- def get_systems(path):
return [dpdata.LabeledSystem(os.path.join(path, s), fmt='deepmd/npy') for s in os.listdir(path)]
if __name__ == '__main__':
import dpdata
systems = get_systems('./data')
weights = []
rdf_list = []
for sys in systems:
coord_dim = sys['coords'].shape
frame_num = coord_dim[0]
atom_num = coord_dim[1]
weights.append(frame_num*atom_num)
xx,rdf_values,_ = rdf(sys, sel_type = [0,0], max_r = 6, nbins = 100)
rdf_list.append(rdf_values)
rdf = np.average(rdf_list, axis=0, weights=weights)
res = np.concatenate([xx, rdf]).reshape([2, -1])
np.savetxt('rdf_OO.out', res.T) |
Beta Was this translation helpful? Give feedback.
Final Solution --
We need to take the weighted average. And weight will be - frame_no * atom_no
Code --