Giter VIP home page Giter VIP logo

Comments (5)

esheldon avatar esheldon commented on August 14, 2024

Should the row col be relative to the center?

row,col=self.get_cen()
rowdiff=gm['row']-row
coldiff=gm['col']-col

irr=((gm['irr'] + rowdiff**2)*gm['p']).sum()*ipsum
irc=((gm['irc'] + rowdiff*coldiff)*gm['p']).sum()*ipsum
icc=((gm['icc'] + coldiff**2)*gm['p']).sum()*ipsum

from ngmix.

rmjarvis avatar rmjarvis commented on August 14, 2024

Yes. Sorry, I just assumed (always a mistake) that that was what the 'row', 'col' parameters were. They should be the r,c offsets relative to the centroid.

This formula is basically just the parallel axis theorem for second moments. I_offset = I_center + r^2.

from ngmix.

esheldon avatar esheldon commented on August 14, 2024

Yes, thank you, I'll implement this soon.

from ngmix.

beckermr avatar beckermr commented on August 14, 2024

The parallel axis theorem seems like a sledgehammer for these purposes! However, now I can say I have seen it used somewhere in real research, as opposed to before when I just needed it to solve made up mechanics problems.

from ngmix.

esheldon avatar esheldon commented on August 14, 2024

I remember someone (maybe Mike even) suggesting this solution to me in the past, but I quickly forgot it and didn't implement it.

I've pushed a change to master that implements this.

from ngmix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.