-
Notifications
You must be signed in to change notification settings - Fork 274
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
Fix definition of particle age/times #3864
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks alright to me. I am not sure I can properly 'approve' however.
Agreed. Let's wait on the reporter's approval for this one. |
Hi @cphyc, this looks good. Just tested on my dataset and compared the results to those produced by the ramses utils. The birth times/ages match to similar accuracy as I mentioned in #3861 -- most of the ages agree to +/- 0.005 Myr, birth times are a little off, with most of them very close to -0.7 Myr compared to the ramses utils. I don't think this is due to this PR, though, instead I think it is down to the discrepancy between |
The small discrepancy come from the way we interpolate times from conformal to physical, which is probably slightly different (though I wouldn't know which one of RAMSES' and yt's is the most accurate). |
Great, thanks @iconaboy for your feedback. |
@neutrinoceros yes! |
Ah ok, I thought it might be something like this. I dug a bit and just noticed that in yt/frontends/ramses/data_structures.py, the value 3.08e24 is used for cm_per_mpc, from line 974:
I think this is a hangover from when ramses used to use 3.08e24 as the conversion from Mpc to cm, but newer versions use the more accurate 3.0856776d+24 (this is the value I used for the ramses utils comparison), which matches up with the yt value in yt/utilities/physical_ratios.py. Swapping the line
for
brings most of the This is a separate issue to the one @cphyc fixed above, though, might be better if I make a new issue/PR? e: Might this inconsistency in cm_per_Mpc be related to #2098 @cphyc? |
…4-on-yt-4.0.x Backport PR #3864 on branch yt-4.0.x (Fix definition of particle age/times)
PR Summary
This fixes #3861.