Skip to content

Fix stellar age#138

Merged
TobiBu merged 13 commits into
mainfrom
fix-stellar-age
Jul 3, 2025
Merged

Fix stellar age#138
TobiBu merged 13 commits into
mainfrom
fix-stellar-age

Conversation

@anschaible

Copy link
Copy Markdown
Collaborator

-Fix rotation for nihao
-Fix gas metals for nihao
-Fix stellar age for nihao

@TobiBu

TobiBu commented Apr 7, 2025

Copy link
Copy Markdown
Collaborator

tests are failing with missing argument 'gamma'.

Can we fix this? then I do the review.

@TobiBu
TobiBu requested a review from Copilot April 7, 2025 19:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • notebooks/nohup.out: Language not supported
Comments suppressed due to low confidence (1)

rubix/galaxy/input_handler/pynbody.py:112

  • [nitpick] Using a hardcoded index (4) for placing OxMassFrac may reduce clarity; consider defining a constant or using a named index for improved readability.
        metals[:, 4] = ox_data["OxMassFrac"]

Comment thread rubix/core/rotation.py Outdated
setattr(component, "coords", coords)
setattr(component, "velocity", velocities)

return rubixdata"

Copilot AI Apr 7, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extraneous string literal after the return statement appears to be an unintended docstring terminator. Please remove the spurious quotes to ensure proper function behavior.

Suggested change
return rubixdata"
return rubixdata

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this is still to be fixed, right?

Comment thread rubix/galaxy/alignment.py Outdated
vel_rot = apply_init_rotation(velocities, R)
pos_final = apply_rotation(pos_rot, alpha, beta, gamma)
vel_final = apply_rotation(vel_rot, alpha, beta, gamma)
if key == "ILlustrisTNG":

Copilot AI Apr 7, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string 'ILlustrisTNG' appears to be a misspelling of 'IllustrisTNG'. Correct the string to ensure consistent behavior.

Suggested change
if key == "ILlustrisTNG":
if key == "IllustrisTNG":

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed it

Comment thread notebooks/nohup.out Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file should not be in the repo.
Let's remove

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed it

@TobiBu

TobiBu commented May 27, 2025

Copy link
Copy Markdown
Collaborator

@anschaible @ufuk-cakir also we should probably clean this one up.

@TobiBu TobiBu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, there is one more thing I found...

Comment thread rubix/galaxy/input_handler/pynbody.py Outdated
self.logger.info("Metals assigned to gas particles.")
self.logger.info("Metals shape is: %s", self.data["gas"]["metals"].shape)

self.data["stars"]["age"] = 14.14019767 * u.Gyr - self.data["stars"]["age"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we have 14.14 Gyr? shouldn't the universe be 13.8 Gyr?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably that should be connected to the cosmology we specify in the yaml file...
see here:

def age_at_z0(self) -> Float[Array, "..."]:

@ufuk-cakir
ufuk-cakir self-requested a review July 1, 2025 19:46
Comment thread rubix/core/fits.py
hdr1["EXTNAME"] = "DATA"
hdr1["OBJECT"] = object_name
hdr1["BUNIT"] = "erg/(s*cm^2*A)" # flux unit per Angstrom
hdr1["BUNIT"] = "10**-20 erg/(s*cm^2*A)" # flux unit per Angstrom

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this factor?

Comment thread rubix/core/rotation.py
"""
logger.info("Rotating galaxy for simulation: " + config["simulation"]["name"])
# Rotate gas
if "gas" in config["data"]["args"]["particle_type"]:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this part looks like it can be refactored, but only minor comment

Comment thread rubix/galaxy/alignment.py
vel_rot = apply_init_rotation(velocities, R)
pos_final = apply_rotation(pos_rot, alpha, beta, gamma)
vel_final = apply_rotation(vel_rot, alpha, beta, gamma)
elif key == "NIHAO":

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add comment here why we distinguish between illustris and nihao

ufuk-cakir
ufuk-cakir previously approved these changes Jul 1, 2025

@ufuk-cakir ufuk-cakir left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some minor comments

@anschaible
anschaible dismissed ufuk-cakir’s stale review July 2, 2025 14:02

The merge-base changed after approval.

@anschaible
anschaible requested review from TobiBu and ufuk-cakir July 2, 2025 14:47
@TobiBu
TobiBu merged commit 75efd92 into main Jul 3, 2025
6 checks passed
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

Successfully merging this pull request may close these issues.

4 participants