Skip to content

Conversation

@anschaible
Copy link
Collaborator

The FSPS template is offset in the wavelength (see position of Halpha line), this pull request fixes this issue.

Copy link
Collaborator

@TobiBu TobiBu left a comment

Choose a reason for hiding this comment

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

once the one fix is done, we can merge.

# Adjust the wavelength grid to the bin centers:
# _wave[0] and _wave[1] are different by 3, to center, we have to shift half way, so subtract 1.5 A
# to test that the centering is correct, we can look at the position of the Halpha line at 6563 A
ssp_wave_centered = ssp_wave - 1.5
Copy link
Collaborator

Choose a reason for hiding this comment

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

i think it makes more sense to to use offset = (_wave[1] - _wave[0]) / 2.
and not a fixed 1.5 as this value might depend on the exact wavelength grid used.

Copy link
Collaborator

Choose a reason for hiding this comment

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

any updates on this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, very good point! I just changed it in the code

@TobiBu
Copy link
Collaborator

TobiBu commented May 27, 2025

How is the progress on this @anschaible?

@anschaible
Copy link
Collaborator Author

How is the progress on this @anschaible?

@TobiBu , I changed the code regarding to your suggestions. Also I fixed the pytests that they now run and cleaned a bit the branch. If we get two reviews to the branch, we can merge it to the main

TobiBu
TobiBu previously approved these changes Jun 2, 2025
@TobiBu TobiBu requested a review from Copilot June 2, 2025 18:20

This comment was marked as outdated.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an incorrect wavelength grid centering in the FSPS template by shifting the wavelength array to bin centers and updating tests and documentation accordingly. It also adds a new telescope configuration, ensures numeric constants are cast properly, and clarifies configuration comments.

  • Center the FSPS wavelength grid on bin centers and update the grid creation
  • Update tests to expect the shifted wavelength values
  • Add a new MUSE_NFM instrument and clarify config behavior for “source”
  • Cast constant lookups to floats in IFU conversion

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_ssp_fsps.py Change expected wavelength to include the 50 Å offset
rubix/spectra/ssp/fsps_grid.py Compute and apply dynamic half‐bin offset on wavelength
rubix/telescope/telescopes.yaml Add new MUSE_NFM instrument definition
rubix/spectra/ifu.py Cast CONSTANTS lookup to float for consistency
rubix/config/rubix_config.yml Expand comments on source options
notebooks/... Remove obsolete pipeline notebook; add comparison notebooks
Comments suppressed due to low confidence (3)

rubix/spectra/ssp/fsps_grid.py:120

  • Consider adding a unit test that verifies the offset calculation for non-uniform or edge-case wavelength grids to ensure centering logic remains correct if SP returns unexpected spacing.
offset = (_wave[1] - _wave[0]) / 2.0

rubix/spectra/ifu.py:34

  • [nitpick] The name CONST is very generic; consider renaming to something more descriptive (e.g., LSOL_TO_ERG_PER_MPC2) to clarify what this constant represents.
CONST = float(CONSTANTS.get("LSOL_TO_ERG")) / float(CONSTANTS.get("MPC_TO_CM")) ** 2

rubix/config/rubix_config.yml:220

  • [nitpick] The commented-out "rerun_from_scratch" option is indented just like a config entry, which could confuse readers; move it into a dedicated comment block or list the allowed values explicitly under source.
# "rerun_from_scratch" # note: this is just meant for the case in which you really want to rerun your template library.

anschaible and others added 3 commits June 11, 2025 11:50
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@TobiBu
Copy link
Collaborator

TobiBu commented Jun 26, 2025

I approved.
@ufuk-cakir also happy, so we can move on and merge.

@anschaible anschaible merged commit 7c86bf0 into main Jul 2, 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