Persistence length - Ovito non-responsive when making histogram

Hello!

I am calculating the persistence length of polymers in my system. I load the ovito state session:

PersistenceLength.ovito (11.0 KB)

When I add the following code to line 58, the Ovito Script Output window becomes unresponsive although the rest of Ovito is responsive:

maxer = np.max(lps)
xinterval = (0.0, maxer)
histogram = np.histogram(lps, bins=50, range=xinterval)[0]

table = data.tables.create( 
    identifier = 'binning', 
    title = 'Binned particle counts', 
    plot_mode = DataTable.PlotMode.Histogram,
    interval = xinterval,
    axis_label_x = 'Persistence Length')
table.y = table.create_property('Frequency', data=histogram)

Here’s the system data and a single trajectory file:

polybuild366_Total.data (1.8 MB)
AAPoly366dump.20500000.dump (429.3 KB)

And more lately, when I try to load the session state linked above (PersistenceLength.ovito), it doesn’t load.

Any thoughts on what could be going on under the hood? Or simple mistakes I probably made? :wink:

Thanks!

Kind regards,
Sean

Dear Sean,

I’ve noticed that the file PersistenceLength.ovito was written by old OVITO version 3.8.1 and is completely empty (it doesn’t contain any pipeline(s)). Maybe this is what you mean with “it doesn’t load”.

Do you have any explanation for this? Maybe you accidentally overwrote the file with an empty state? In any case, without the state file, we cannot reproduce and investigate the issue you describe, unfortunately. Please provide some more information if you can.

-Alex

Hmm, not sure what I did there. I’ll try this again:

PersistenceLength2.ovito (2.1 MB)

This should be the proper sessions state. Thanks for your quick reply!

Clarification: I meant thank you for replying so quickly with your initial response :slight_smile:

Hi Sean,
I can load the session now and I am able to see the chains of arrows generated by the Python modifier script. I inserted the code above at the specified location and it seems it work normally.
Could you please describe in more detail what you mean with “the Ovito Script Output window becomes unresponsive although the rest of Ovito is responsive”. The script log panel (which is part of the modifier’s UI) only displays the output of Python print statements, so I am not sure how it can become unresponsive. Or are you talking about the integrated code editor window of OVITO Pro, which floats above the main window?

Hi Alex,

Sorry for the confusion - I’m now also able to see the data table after adding the code at line 58. I had a print statement at line 57 in the Ovito python script output that, previously, was not updating after I added the code at line 58. (I changed line 57 from printing LPS 1 to LPS 2, and the output did not update with the LPS 2 value.)

But, when I tried it just now, it worked. So, not sure what was happening there.

If it happens again, I’ll post again and try to include more details.

Thanks,
Sean