lwang-astro / PeTar

PeTar is a high-performance N-body code for modelling the evolution of star clusters and tidal streams, including the effect of galactic potential, dynamics of binary and hierarchical system, single and binary stellar evolution.
MIT License
71 stars 19 forks source link

movie.py: center of mass evaluation #10

Closed PaoloSuin closed 3 years ago

PaoloSuin commented 3 years ago

There's a compilation error in line 302 of movie.py tool, inside function corretctCM: the y coordinate of the core centre of mass is subtracted to x coordinates


    def correctCM(self, boxsize, pos):
        xcm = 0.0
        ycm = 0.0
        if (self.cm_mode=='core'):
            xcm = pos[0]
            ycm = pos[1]
            if (self.generate_binary!=2): # data from petar.data.process already remove c.m. from core center
                self.x = self.x-ycm   <<<<<
                self.y = self.y-ycm
lwang-astro commented 3 years ago

Thank you for pointing this out! Now I have fixed it.