Hello,

I’m trying to calculate the ratio between first max. and the first min. value of g[r] .

I did a coordination analysis(for calculating RDF) and then using a python script modifier implemented max() and min() function.

But the problem with this is, it’s not finding the 1st max. and 1min. value. For min. it takes 0. Also if there is two-particle type in the system then it can not take value for rdf.y and return nan.

So, is there any possible way to do it in Ovito by using python modifier.

I tried something like this:

`from ovito.data import *

import numpy as np

def modify(frame, data, output):

rdf = data.tables[‘coordination-rdf’]

rdf_max = np.max(rdf.y)

rdf_min = np.min(rdf.y)

rdf_ratio = (rdf_min/rdf_max)

print(rdf_max)

print(rdf_min)

print(rdf_ratio)``

Thank you

Best

Prash