Exporting multiple snapshots

I have a series of lammps output files. I would like to apply the DXA modifier and the PTM modifier then export for each file the .ca file as well as the .imd file.

Currently I have to first export the .ca files, then I have to export the IMD files. This means that the modifiers calculations are performed twice.

Is there a way to do this in a single go, without having the modifiers run twice?

In a stand-alone Python script, you could do the following:

for i in range(pipeline.source.num_frames):
    data = pipeline.compute(i)
    export_file(data, f"output.{i}.imd", "imd")
    export_file(data, f"output.{i}.ca", "ca")
1 Like