script to calculate irmsd