Skip to content

Use sRTMnet as the default RT engine#848

Closed
evan-greenbrg wants to merge 3 commits into
isofit:devfrom
evan-greenbrg:utils/apply_oe/default_RT
Closed

Use sRTMnet as the default RT engine#848
evan-greenbrg wants to merge 3 commits into
isofit:devfrom
evan-greenbrg:utils/apply_oe/default_RT

Conversation

@evan-greenbrg

@evan-greenbrg evan-greenbrg commented Feb 2, 2026

Copy link
Copy Markdown
Collaborator

Adds an optional apply_oe argument, engine_name, which defaults to sRTMnet. I tried to maintain existing emulator_base-modtran_path structure to maintain backwards compatibility for emulator_base run configurations. This would change existing modtran_path run configurations, which currently can be run without specifying any paths in the apply_oe call.

Decision points:

Key block:

    # Logic to match engine paths with engine names
    if engine_name == "sRTMnet" and not emulator_base:
        emulator_base = str(env.path("srtmnet", key="srtmnet.file"))

    if engine_name == "modtran" and not modtran_path:
        modtran_path = os.getenv("MODTRAN_DIR", env.modtran)

    if emulator_base and emulator_base.endswith(".jld2"):
        engine_name = "KernelFlowsGP"

    if engine_name == "KernelFlowsGP" and not emulator_base:
        raise ValueError("emulator_base must be specifief if using Kernel Flows GP")

@evan-greenbrg evan-greenbrg force-pushed the utils/apply_oe/default_RT branch from 53987a1 to bbbd9f4 Compare February 9, 2026 17:22
@evan-greenbrg evan-greenbrg marked this pull request as ready for review February 9, 2026 17:32
Comment thread isofit/utils/apply_oe.py

if engine_name == "modtran" and not modtran_path:
modtran_path = os.getenv("MODTRAN_DIR", env.modtran)

@brentwilder brentwilder Feb 9, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@evan-greenbrg I think the easiest way to fold in #833 would be to add a check here for "libradtran" and default to LIBRADTRAN_DIR. that way I don't have to change any conflicting flags/etc in my PR?

Comment thread isofit/utils/apply_oe.py Outdated
# This becomes more complicated with backward compatability
# TODO Could abstract this into template construction
# TODO collapse modtran - emulator paths into single engine path when we eliminate list-based rt_engines
if engine_name == "sRTMnet" and not emulator_base:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this goes for all here, but do we want to make this check case insensitive by just checking .lower() of the input?

Comment thread isofit/utils/apply_oe.py
)

if emulator_base is None and prebuilt_lut is None:
max_water = tmpl.calc_modtran_max_water(paths)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line will raise in error in libRadtran case because it will expect to sort through MODTRAN tp6 files which won't be generated. I think this can be changed instead of checking emulator base (or in addition to), to ensuring engine_name is MODTRAN.

@evan-greenbrg

Copy link
Copy Markdown
Collaborator Author

Run down the run pathway if we only pass in a lut.nc and don't pass in an engine_name or emulator_base or modtran_path.

Make sure we don't break the run case if we pass in a prebuilt lut with incorrect/mismatching key names.

@evan-greenbrg evan-greenbrg force-pushed the utils/apply_oe/default_RT branch from e89762d to ac63115 Compare March 2, 2026 20:52
@evan-greenbrg

Copy link
Copy Markdown
Collaborator Author

Some of the issues holding this up are related to #921. I would get that in first, rebase, then merge this.

@evan-greenbrg

Copy link
Copy Markdown
Collaborator Author

To be addressed after RT-forward refactor

@evan-greenbrg evan-greenbrg deleted the utils/apply_oe/default_RT branch May 27, 2026 16:47
@evan-greenbrg evan-greenbrg restored the utils/apply_oe/default_RT branch May 27, 2026 16:47
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