Skip to content

Updated glint derivatives and glint solution for the analytical line#637

Merged
pgbrodrick merged 16 commits into
isofit:devfrom
evan-greenbrg:clean/analytical_line
Mar 31, 2025
Merged

Updated glint derivatives and glint solution for the analytical line#637
pgbrodrick merged 16 commits into
isofit:devfrom
evan-greenbrg:clean/analytical_line

Conversation

@evan-greenbrg

@evan-greenbrg evan-greenbrg commented Feb 5, 2025

Copy link
Copy Markdown
Collaborator

Updates in this PRT:

  1. Further abstracted the surface model out of the radiative transfer class. This involves moving the derivatives of radiance with respect to the surface state elements into the surface class (e.g. for the multicomponent surface, for the glint_model_surface). The dRT functions solely deal with the RT statevector elements.

  2. RT functions now take explicit arguments. Calls of get_L_coupled and get_L_down_transmitted are performed in a helper function, which should handle switch off between the 1c and 4c model. Throughout forward.py, we now similarly call the RT and surface quantities before passing them into the respective derivative and calc_rdn function calls. See calc_meas, K, and Kb functions.

  3. The analytical line algorithm is simplified. We allow the user to initialize the AOE routine with 3 possible values (invert_simple, invert_algebraic, and the super pixel value). We also use the same subroutine across all surface models. This relies on the similar construction of the matrix, H, that is a property of the surface class. For example, the glint model, which inherits the linearization of the rfl terms from the multicomponent_surface.

  4. This updates the linearization of the 4c model used in the AOE solution. The multicomponent surface, and the glint surface.

  5. Edited glint derivatives to reflect the new 4c model. This results in a much improved optimization compared to dev that reflects both the prior and the measurement.

Other edits:

  • The outputs for the analytical line will be separated by surface reflectance and surface non_reflectance components. All possible output files are for example:
    prm20221026t182807_rfl
    prm20221026t182807_uncert
    prm20221026t182807_surf_non_rfl
    prm20221026t182807_surf_non_rfl_uncert

@evan-greenbrg evan-greenbrg marked this pull request as ready for review February 10, 2025 17:37
evan-greenbrg added a commit to evan-greenbrg/isofit that referenced this pull request Feb 10, 2025
Comment thread isofit/inversion/inverse_simple.py Outdated
Comment thread isofit/inversion/inverse_simple.py Outdated
Comment thread isofit/inversion/inverse_simple.py Outdated
Comment thread isofit/inversion/inverse_simple.py Outdated
Comment thread isofit/radiative_transfer/radiative_transfer.py Outdated
Comment thread isofit/surface/surface_glint_model.py
Comment thread isofit/surface/surface_glint_model.py Outdated
Comment thread isofit/surface/surface_glint_model.py Outdated
Comment thread isofit/surface/surface_lut.py
Comment thread isofit/surface/surface_multicomp.py
Comment thread isofit/utils/analytical_line.py Outdated
@evan-greenbrg

evan-greenbrg commented Feb 13, 2025

Copy link
Copy Markdown
Collaborator Author

I messed up the order on rebasing #641 in relation to #637. The commit order here reflects the commit order:
dev -> #641 -> #637 while based on conversations the commit order should be: dev -> #637 -> #641.

I've spent some time trying to work through options to get the dev -> #637 -> #641 within this PR, and while it is possible, would unnecessarily introduce a more complicated commit history and opportunities for mistakes in the merge. I'm keeping this PR as is for now with the note that I have a backup branch: https://github.com/evan-greenbrg/isofit/tree/backup/clean/analytical_line with the correct commit order, which makes it easy to roll back parts of #641 if needed.

@unbohn

unbohn commented Feb 14, 2025

Copy link
Copy Markdown
Collaborator

@evan-greenbrg Thanks for the update! This kind of problem sounds familiar to me. Every rebasing is a new experience ;)

Some cleaning for consistency

Use fresnel function in surface model

Moved drfl_dsurface into the surface model

cleaning

Move fresnel function out of radiative_transfer

set background rfl and initialize analytical line with background rfl

Analytical Line uses superpixel as background rfl and init values

Move Seps and Sa into the loop

Update to reflect new linear factorization

Glint analytical line now uses atm_interp for sky glint

Merge with dev

Abstract analytical model to the surface modules

reverting removing lower bounds on rfl inversion

added missing idx_surface attributes

Inverse_simple now backwards compatible

STARTED astracting surface model calls in RT with updated derivatives

Abstracted the interp check in analytical line

Formatting
Change name of glint_spectra

add in copy to inverse_analytical
Updated drfl_dglint

Updated drfl_dsurface and perturbation

Annotations

Reverting derivative changes

Added note on fixed apparent rfl in dRT, and testing slow example
@evan-greenbrg

evan-greenbrg commented Feb 28, 2025

Copy link
Copy Markdown
Collaborator Author

Results from comparing Dev-branch to this-branch solutions for a sample EMIT scene (Cuprite: emit20240626t165035). These solutions reflect the 4c radiance model with a multicomponent_surface in both cases.

emit20240626t165035_compare

@evan-greenbrg

Copy link
Copy Markdown
Collaborator Author

emit20240626t165035_compare_hists

@evan-greenbrg

Copy link
Copy Markdown
Collaborator Author

Based on #656, should change arguments for calc_rdn functions to be kwargs to reduce possibility of passing in an incorrect vector.

evan-greenbrg added a commit to evan-greenbrg/isofit that referenced this pull request Mar 24, 2025
Some cleaning for consistency

Use fresnel function in surface model

Moved drfl_dsurface into the surface model

cleaning

Move fresnel function out of radiative_transfer

set background rfl and initialize analytical line with background rfl

Analytical Line uses superpixel as background rfl and init values

Move Seps and Sa into the loop

Update to reflect new linear factorization

Glint analytical line now uses atm_interp for sky glint

Merge with dev

Abstract analytical model to the surface modules

reverting removing lower bounds on rfl inversion

added missing idx_surface attributes

Inverse_simple now cackwards compatible

Rebased with isofit#637
@davidraythompson

Copy link
Copy Markdown
Collaborator

This looks good to me. It's an elegant solution to a thorny problem of compartmentalizing functions while maintaining full functionality and forward-compatibility. Have we tested it with a higher-resolution LUT to make sure that the wavelength fitting works as expected? No objections to merging.

@pgbrodrick pgbrodrick mentioned this pull request Mar 31, 2025
@pgbrodrick pgbrodrick merged commit 564305b into isofit:dev Mar 31, 2025
evan-greenbrg added a commit to evan-greenbrg/isofit that referenced this pull request Apr 7, 2025
Some cleaning for consistency

Use fresnel function in surface model

Moved drfl_dsurface into the surface model

cleaning

Move fresnel function out of radiative_transfer

set background rfl and initialize analytical line with background rfl

Analytical Line uses superpixel as background rfl and init values

Move Seps and Sa into the loop

Update to reflect new linear factorization

Glint analytical line now uses atm_interp for sky glint

Merge with dev

Abstract analytical model to the surface modules

reverting removing lower bounds on rfl inversion

added missing idx_surface attributes

Inverse_simple now cackwards compatible

Rebased with isofit#637
@evan-greenbrg evan-greenbrg deleted the clean/analytical_line 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.

4 participants