-
Notifications
You must be signed in to change notification settings - Fork 276
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
yt code_length unit inconsistent with Ramses unit_l #4787
Comments
Hi, and welcome to yt! Thanks for opening your first issue. We have an issue template that helps us to gather relevant information to help diagnosing and fixing the issue. |
Thanks for bringing this up -- I am sorry we didn't address it before! Perhaps @cphyc can provide some insight? |
I'm happy to help but I'm 200% busy until February 9 and won't have time until then. Most likely, these two lines are the right entry points: yt/yt/frontends/ramses/data_structures.py Line 977 in 1e90fd7
yt/yt/frontends/ramses/data_structures.py Line 1046 in 1e90fd7
The first sets the length_unit, so self.domain_right_edge = np.full(3, self.parameters["boxlen"], dtype="float64") Could you try and let us know if this works? If it does, we'd be happy for you to submit a PR, or I can do it in a couple of weeks. |
Hi, Thanks for the quick reply. I tried changing the line you suggested, and this does mean the correct domain_right_edge is returned when loading the data:
However, the ratio code_length/unit_l is still incorrect by a factor of boxlen and I get the same offset in my plots. I also tried removing the factor of boxlen in line 977 to give: setdefaultattr(self, "length_unit", self.quan(length_unit , "cm")) I'm completely new to both Ramses and yt so I'm not sure if it was logical to do this, but this seems to completely break any plots I make of the gas. |
Bug report
Bug summary
I experience the same issue as #2866: the unit length conversion for a non cosmological simulation is off by a factor of the boxlength.
Code for reproduction
Actual outcome
The length conversion is off by a factor of 150, the value of the box length. However, the density conversion seems to be correct...
I was wondering if anyone had a simple work around for this? I don't think I can just multiply any results with length units by factors of the box length since the density conversion is correct and includes length**3.
Version Information
The text was updated successfully, but these errors were encountered: