Starfish-develop / Starfish-develop/Starfish
air=True in grid_tools causing weird wavelength bug
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 78
- Forks
- 23
- PR merge metrics
- No merged PRs in 30d
Description
Steps to reproduce:
import numpy as np
import Starfish
from Starfish.grid_tools import PHOENIXGridInterfaceNoAlpha
grid = PHOENIXGridInterfaceNoAlpha(wl_range=[900, 50000], air=False)
wl = grid.wl
print("Air is {}: Maximum change in wavelength {:.3f} AA".format(False, np.max(np.diff(wl))))
print("Air is {}: Minimum change in wavelength {:.3f} AA".format(False, np.min(np.diff(wl))))
print()
grid = PHOENIXGridInterfaceNoAlpha(wl_range=[900, 50000], air=True)
wl = grid.wl
print("Air is {}: Maximum change in wavelength {:.3f} AA".format(True, np.max(np.diff(wl))))
print("Air is {}: Minimum change in wavelength {:.3f} AA".format(True, np.min(np.diff(wl))))
Output
Air is False: Maximum change in wavelength 0.225 AA
Air is False: Minimum change in wavelength 0.006 AA
Air is True: Maximum change in wavelength 743.863 AA
Air is True: Minimum change in wavelength -1293.716 AA
Obviously, the wavelength grid should be monotonic. I'm not really sure what's causing this, but it seems to be related to applying the vacuum_to_air method to a larger range of wavelengths than just the optical.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the reproduction snippet for PHOENIXGridInterfaceNoAlpha with air=False and air=True, then inspect the grid_tools air conversion path, especially vacuum_to_air. Done means the air=True wavelength grid remains monotonic across the reported range and the existing reproduction no longer shows negative wavelength differences.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100