Skip to content

Fix synthetic filter interpolation outside passbands#1032

Open
nialljmiller wants to merge 2 commits into
mainfrom
features/nialljmiller/filter_interp_leak_fix
Open

Fix synthetic filter interpolation outside passbands#1032
nialljmiller wants to merge 2 commits into
mainfrom
features/nialljmiller/filter_interp_leak_fix

Conversation

@nialljmiller

Copy link
Copy Markdown
Collaborator

This fixes synthetic photometry for filters interpolated onto SED wavelength grids.

Previously, interpolated filter transmission could remain nonzero outside the tabulated filter wavelength range.
This produced out-of-band flux leakage for hot/blue SEDs, especially WD and blackbody models, causing unphysical synthetic colors. I found this testing WD cooling tracks.

The fix clamps interpolated filter transmission to zero outside the original filter support and clips negative interpolated transmission values to zero.

Here is the function that has been added to colors/private/synthetic.f90 --

      fmin = minval(filt_wave)
      fmax = maxval(filt_wave)

      do i = 1, size(target_wave)
         if (target_wave(i) < fmin .or. target_wave(i) > fmax) then
            filt_on_target(i) = 0.0_dp
         else if (filt_on_target(i) < 0.0_dp) then
            filt_on_target(i) = 0.0_dp
         end if
      end do

@Debraheem

Debraheem commented Jun 19, 2026

Copy link
Copy Markdown
Member

Nice find! I can't look at my computer for another couple days because im moving apts, just an fyi! But this is awesome!

Is there a reason the bolometric flux tests didn't capture this in the unit tests, maybe because i used too low log G and low teff? Do we need a high logG hot Teff bb flux unit test added to the others, so this would be caught?

Is there a particular place where this comes? Perhaps we add a minor changelog entry for this to mark it and tweak the unit tests slightly to capture this scenario?

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.

2 participants