Skip to content
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

Cannot access "Particle Creation Time" in ART data for Stellar particles #5105

Open
AsierLambarri opened this issue Jan 28, 2025 · 0 comments

Comments

@AsierLambarri
Copy link

For modellig the luminosity of stellar particles i am following the standard SSP approach, for which i need the ages of stellar particles. In, at least all of the yt4.X versions i have encountered that the "particle_creation_time" cannot be generated correctly. My code is the following:

import yt

ds = yt.load("sample_data.d")

ds.add_field(
  ("stars", "age"),
  function=lambda field, data: ds.current_time - data["stars", "particle_creation_time"],
 units="Gyr"
)

ad = ds.all_data()
ad["stars", "age"]

The error message is the following: UnitInconsistencyError: Expected all unyt_array arguments to have identical units. Received mixed units (dimensionless, Gyr).

The issue is that the variable interp_tb defined in line 292 of frontends/art/io.py is set to have units of "Gyr" that seem to not match the units of data. I have found that setting interp_tb to be dimensionless solves this UnitInconsistencyError and returns stellar ages that are plaussible. I could fix this issue in a PR.

Sample Data for reproduction: https://users.flatironinstitute.org/~chayward/agora_public_release/PaperIV/ART-I/

Dependencies:

numpy1.26.4
yt4.X

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant