wl cal patches#958
Conversation
|
📊 Generated results:
URL: isofit/isofit-test-results#30 |
| if isinstance(rho_dif_dif, np.ndarray) and len(rho_dif_dif) != len(RT.wl): | ||
| rho_dif_dif = interp1d( | ||
| surface.wl, rho_dif_dif, fill_value="extrapolate", bounds_error=False | ||
| )(RT.wl) |
There was a problem hiding this comment.
@evan-greenbrg / @unbohn - please review if this is the right place for this to live.
There was a problem hiding this comment.
Required, and consistent because of the eq_11 calculation in RT:
L358 radiative_transfer.py
eq_11_term = 1 - (r["sphalb"] * rho_dif_dif)
L_tot = L_dir_dir + L_dif_dir + L_dir_dif + L_dif_dif
L_dif_dir /= eq_11_term
L_dif_dif /= eq_11_termAlthough we use a slightly different syntax in forward.py:
in calc_meas:
rho_dir_dir, rho_dif_dir = self.calc_rfl(x_surface, geom)
rho_dir_dir_hi = self.upsample(self.surface.wl, rho_dir_dir)
rho_dif_dir_hi = self.upsample(self.surface.wl, rho_dif_dir)
# Adjacency effects
rho_dir_dif_hi = (
self.upsample(self.surface.wl, geom.bg_rfl)
if isinstance(geom.bg_rfl, np.ndarray)
else rho_dir_dir_hi
)
rho_dif_dif_hi = (
self.upsample(self.surface.wl, geom.bg_rfl)
if isinstance(geom.bg_rfl, np.ndarray)
else rho_dif_dir_hi
)The only difference is that fm.upsample handles multidim arrays:
def upsample(self, wl, q):
"""Linear interpolation to RT wavelengths."""
# Only interpolate if these aren't close
close = len(wl) == len(self.RT.wl) and np.allclose(wl, self.RT.wl)
# or if any dimension is the wrong size
interp = (np.array(q.shape) != len(self.RT.wl)).all()
if not close or interp:
if q.ndim > 1:
return np.array(
[interp1d(wl, qi, fill_value="extrapolate")(self.RT.wl) for qi in q]
)
else:
p = interp1d(wl, q, fill_value="extrapolate")
return p(self.RT.wl)
return qWould update for consistency, except that invert_algebraic does not have access to fm.
There was a problem hiding this comment.
Thanks for the review! I say we accept as is then, and make this more intuitive in the 4x implementation.
|
I updated the wavelength cal test: pgbrodrick#21 Associated tutorials PR: isofit/isofit-tutorials#53 |
Revised wl_cal test
|
@unbohn , now that checks clear, this is ready for merge! |
|
Roger, @pgbrodrick. Merging. Do we want to do a 3x patch release with this? |
|
Yes I think so! |

Fix breaks to wavelength calibration utility not caught in tests (tests do not use cli).