Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Birth location of an object changes with different time ranges #552

Closed
sivdur opened this issue Feb 19, 2023 · 1 comment
Closed

Birth location of an object changes with different time ranges #552

sivdur opened this issue Feb 19, 2023 · 1 comment

Comments

@sivdur
Copy link

sivdur commented Feb 19, 2023

I initialized the orbit of an object with the following code:

cl = SkyCoord(ra=259.103*u.deg,
              dec=-39.316*u.deg,
              distance=2.53*u.kpc,
              pm_ra_cosdec=-0.455*u.mas/u.yr,
              pm_dec=-1.439*u.mas/u.yr,
              radial_velocity=-14.423*u.km/u.s, 
              frame='icrs')
o = Orbit(cl)
# ob = Orbit(cl)
logAge = 7.0
clage = 10**(logage-9)#*u.Gyr

ts = np.linspace(-200.0, 200.0, 10001)#*u.Gyr
o.integrate(ts, MWPotential2014)

and I calculate the birth location in the (X, Y, Z) space as follows:

o.x(-clage), o.y(-clage), o.z(-clage)

which gives the following plot:
download

when I change the integration time as follows:

ts = np.linspace(-100.0, 100.0, 10001)#*u.Gyr

the plots look like this:
download

the green stars indicates the birth location, whereas the red dot is the current location of the object.
When I multiply the integration time by u.Gyr, it doesn't change the result. The birth location changes everytime.
The version of galpy is 1.8.0

How can I find the birth location of an object?

Best,
Sivan.

@jobovy
Copy link
Owner

jobovy commented Feb 20, 2023

Hi!

The first entry in the time array is the time of the initial condition (that is, the initial condition isn't assumed to be at t=0, which I think you may have thought). So because you change the initial time, your clage will be a different time in the past. If you keep the initial times the same, e.g., in your second run use

ts = np.linspace(-200.0, 100.0, 10001)#*u.Gyr

then you'll see that you get a consistent result.

A few more comments:

  • You do have to add *u.Gyr if you want your times to be interpreted as being in Gyr. Without this, the times are assumed to be in internal units. Given how you define clage, I think this is supposed to be in Gyr.
  • I think you want to integrate backwards in time, but you are integrating forwards in time. For your purposes, the best thing to do would be to use
    ts = np.linspace(0,-clage, 10001)
    
    So you go from the present (defined to be t=0 here) to the time you want to integrate backwards for.

I hope this helps!

Repository owner locked and limited conversation to collaborators Feb 20, 2023
@jobovy jobovy converted this issue into discussion #553 Feb 20, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants