Skip to content

Removed L_dir(dif)/L_tot ratio in glint model#671

Merged
pgbrodrick merged 3 commits into
isofit:devfrom
evan-greenbrg:glint/clean_no_ratio
Apr 24, 2025
Merged

Removed L_dir(dif)/L_tot ratio in glint model#671
pgbrodrick merged 3 commits into
isofit:devfrom
evan-greenbrg:glint/clean_no_ratio

Conversation

@evan-greenbrg

Copy link
Copy Markdown
Collaborator

This PR includes two changes:

  1. Removed the ratio that was included in the glint model

For example, the old implementation:

    def glint_spectra(self, geom, L_down_dir, L_down_dif):
        """Calculates the sun (dir) and sky (dif) glint spectrums"""
        rho_ls = self.fresnel_rf(geom.observer_zenith)
        # direct sky transmittance
        g_dir = rho_ls * (L_down_dir / (L_down_dir + L_down_dif))
        # diffuse sky transmittance
        g_dif = rho_ls * (L_down_dif / (L_down_dir + L_down_dif))

        return g_dir, g_dif

    def calc_rfl(self, x_surface, geom, L_down_dir=None, L_down_dif=None):
        """Direct and diffuse Reflectance (includes sun and sky glint)."""
        # fresnel reflectance factor (approx. 0.02 for nadir view)
        g_dir, g_dif = self.glint_spectra(geom, L_down_dir, L_down_dif)

        sun_glint = x_surface[-2] * g_dir
        sky_glint = x_surface[-1] * g_dif

        rho_dir_dir = self.calc_lamb(x_surface, geom) + sun_glint
        rho_dif_dir = self.calc_lamb(x_surface, geom) + sky_glint

        return rho_dir_dir, rho_dif_dir

Changed to:

    def calc_rfl(self, x_surface, geom):
        """Direct and diffuse Reflectance (includes sun and sky glint)."""
        # fresnel reflectance factor (approx. 0.02 for nadir view)
        rho_ls = self.fresnel_rf(geom.observer_zenith)

        sun_glint = x_surface[-2] * rho_ls
        sky_glint = x_surface[-1] * rho_ls

        rho_dir_dir = self.calc_lamb(x_surface, geom) + sun_glint
        rho_dif_dir = self.calc_lamb(x_surface, geom) + sky_glint

        return rho_dir_dir, rho_dif_dir

The derivatives are also updated

  1. The second change is that I made a first pass on some simplification/walking back previous changes to support the glint model. This includes: removing L_ddir and L_ddif arguments in the calc_rfl and drfl_dsurface and removing the surface upsampling functions within forward.py

@evan-greenbrg evan-greenbrg marked this pull request as ready for review April 22, 2025 23:52
@pgbrodrick

Copy link
Copy Markdown
Collaborator

From testing, this looks great!

Screenshot 2025-04-23 at 7 23 19 PM

@pgbrodrick pgbrodrick merged commit f2842b0 into isofit:dev Apr 24, 2025
@evan-greenbrg evan-greenbrg deleted the glint/clean_no_ratio branch May 22, 2026 15:32
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