dnarayanan / powderday

powderday dust radiative transfer
BSD 3-Clause "New" or "Revised" License
22 stars 17 forks source link

Hyperion grid centering issue with Enzo simulations #107

Closed anchwr closed 3 years ago

anchwr commented 3 years ago

There's a bug in enzo_zoom in zoom.py that causes the dataset that's used to create the hyperion grid to center on the center of the simulation, rather than the user-specified center. Because the star particles are later added to the hyperion grid assuming that the user-specified center has been used, this can result in a large offset between the sources and the dust associated with the galaxy that they come from. This is not an issue for simulations like EnzoDisk, where the galaxy is at the center of the simulation, but can produce a dust-free SED for simulations where this is not the case. This can be fixed by adding ds1.domain_center = reg.center to the end of enzo_zoom.

dnarayanan commented 3 years ago

oh thank you for this report and sleuthing! The Enzo modeling is the newest in our front ends, and we only tested on idealized galaxies (as you noted).

i'm happy to fix this, but would prefer (if you don't mind) to have you issue a PR so that you can get credit for this fix!

anchwr commented 3 years ago

Sure! I just issued the PR.

dnarayanan commented 3 years ago

closed with https://github.com/dnarayanan/powderday/pull/108 and commit d7aad1e2f4a207037652230bd356ca1f85e88480

thanks @anchwr !