Skip to content

Units and conversions#713

Merged
unbohn merged 20 commits into
isofit:devfrom
pgbrodrick:units
Jun 16, 2025
Merged

Units and conversions#713
unbohn merged 20 commits into
isofit:devfrom
pgbrodrick:units

Conversation

@pgbrodrick

@pgbrodrick pgbrodrick commented Jun 9, 2025

Copy link
Copy Markdown
Collaborator

PR to handle unit and conversion consistency throughout the code. See #711 .

@unbohn

unbohn commented Jun 9, 2025

Copy link
Copy Markdown
Collaborator

@pgbrodrick and @evan-greenbrg I walked through the two-albedo method and updated variable names. Also, I'm pretty sure that we can safely remove all the pi operations and simply calculate in radiance space. However, it'd be great if you could review the changes I introduced with commit 6fa4b6f.

Comment thread isofit/core/units.py Outdated
Comment thread isofit/core/units.py
Comment thread isofit/core/units.py
Comment thread isofit/radiative_transfer/engines/sRTMnet.py
Comment thread isofit/radiative_transfer/radiative_transfer_engine.py
Comment thread isofit/radiative_transfer/engines/six_s.py
@pgbrodrick

Copy link
Copy Markdown
Collaborator Author

Things execute through, and in radiance mode the solution space looks decent - but something in the initial guess is still off. In the figure below, early iterations of the state vector (red) show a terrible initial guess, and consequently a poor x_a, which then progress towards a better solution (blue), for this vegetated pixel. This suggests the calc_rdn function is working, but the something in the initial guess (when in radiance mode) is still off...just haven't tracked down what yet.
Screenshot 2025-06-11 at 7 24 21 AM

@pgbrodrick

pgbrodrick commented Jun 11, 2025

Copy link
Copy Markdown
Collaborator Author

I think this is actually just because we're adjusting to transmittance, even if the units are in radiance. I think this if-wrapper will solve things

    if my_RT.rt_mode != "rdn":
        rdn_solrfl = units.rdn_to_transm(rdn_solrfl, coszen, solar_irr)

Testing....

@pgbrodrick

Copy link
Copy Markdown
Collaborator Author

Confirmed the above fix works:

Screenshot 2025-06-11 at 7 56 35 AM

@unbohn

unbohn commented Jun 11, 2025

Copy link
Copy Markdown
Collaborator

Ah good catch, @pgbrodrick! We actually had that check in there before (see here), but accidentally removed it during our working session on Monday.

@pgbrodrick

pgbrodrick commented Jun 12, 2025

Copy link
Copy Markdown
Collaborator Author

4 tests need to happen:

  • radiance 1c
  • radiance 4c
  • transm 1c
  • transm 4c
    Technically, repeat for different RTMs, but we can probably assume that one is sufficent.

@pgbrodrick pgbrodrick marked this pull request as ready for review June 12, 2025 19:21
@pgbrodrick

Copy link
Copy Markdown
Collaborator Author

Confirmed working on 1c - transmittance case.

Screenshot 2025-06-16 at 1 54 10 PM

@unbohn

unbohn commented Jun 16, 2025

Copy link
Copy Markdown
Collaborator

Confirmed working on 4c - radiance case (with the KF emulator, technically a 2c model).
image

@pgbrodrick

Copy link
Copy Markdown
Collaborator Author

Reconfirmed 1c transm and rdn modes both work with new updates.

@evan-greenbrg

Copy link
Copy Markdown
Collaborator

After troubleshooting and fixing the missing upwards transm in the invert_algebraic. Confirmed working on 4c transm.

image

@pgbrodrick

Copy link
Copy Markdown
Collaborator Author

Through consensus, and with discussion with the broader team, this is good to go.

@unbohn unbohn merged commit feb8d9a into isofit:dev Jun 16, 2025
17 checks passed
This was referenced Jun 17, 2025
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.

3 participants