Modify time in trajectories

There have been a few requests recently where people wanted to modify the time in the trajectory. This is a read only property and modifying it can make trajectories unsuitable for analysis. However, I know there are cases where it is important to modify the time (for example, if you have been generating .arc files in Discover, or you didn't use the standard approach to trajectory restart). With this in mind, please find a script which enables you to modify the time in a trajectory by using a couple of utilities to convert between the binary .trj file and and ascii version, editing the ascii file, and then converting back to binary.

From a geeky MaterialsScript perspective, this script also demonstrates a simple way to run a third party (ie not integrated into Materials Studio) executable from within MaterialsScript.

Caveats

  • As the trj2ascii and ascii2trj executables are only on Windows, this will only run on Windows.
  • Only run this on the server and not in debug mode otherwise you will get errors or strange behaviour

More than usual, this script is provided AS-IS and is completely unsupported by Accelrys!

Cheers

Stephen