Difference between revisions of "Mod:Hunt Research Group/center of mass"
Jump to navigation
Jump to search
| Line 4: | Line 4: | ||
:: 2. Then it calculates the center of mass (CoM) from those coordinates | :: 2. Then it calculates the center of mass (CoM) from those coordinates | ||
:: 3. It then saves the ''file_with_COM.xyz'' to the current directory with a dummy atom (X) with CoM corordinates | :: 3. It then saves the ''file_with_COM.xyz'' to the current directory with a dummy atom (X) with CoM corordinates | ||
| + | |||
| + | ====Running the python Script==== | ||
| + | * Running the script is very simple. Simply save the script as center-of-mass_calculation.py and run it as follows (considering your molecule file is water.log) | ||
| + | <pre> | ||
| + | python3 center-of-mass_calculation.py water.log | ||
| + | </pre> | ||
Revision as of 01:29, 16 May 2025
Code to Calculate the Center of Mass (CoM) and produce xyz file with CoM
- What the program does?
- 1. The script can read an XYZ or Gausslain log file and extract its coordinates
- 2. Then it calculates the center of mass (CoM) from those coordinates
- 3. It then saves the file_with_COM.xyz to the current directory with a dummy atom (X) with CoM corordinates
Running the python Script
- Running the script is very simple. Simply save the script as center-of-mass_calculation.py and run it as follows (considering your molecule file is water.log)
python3 center-of-mass_calculation.py water.log