Extending Isofit to handle multisurface classifications #617
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
ddcf117 to
324259e
Compare
c15d282 to
4ff9896
Compare
4ff9896 to
4070cff
Compare
386b9c8 to
bc054f5
Compare
1ab1c41 to
3223bce
Compare
3223bce to
cd08ced
Compare
108f56d to
6b72fe5
Compare
48caa43 to
e3a4fcf
Compare
8fd189c to
1ef884f
Compare
|
This worked for me! Testing the case of a single, multi-component surface model for an EMIT scene I have locally (emit20250327t212148). |
| surface_category: str, | ||
| multisurface: bool = False, |
There was a problem hiding this comment.
Add args strings to documentation for these two arguments below.
| meshgrid = np.meshgrid(self.rows, self.cols) | ||
| index_pairs[:, 0] = meshgrid[0].flatten(order="f") | ||
| index_pairs[:, 1] = meshgrid[1].flatten(order="f") | ||
| del meshgrid |
There was a problem hiding this comment.
I tested the indexing function using numpy where and actually found that numpy's performance is actually better than the view-based indexing.
View-based indexing: ~0.03s
Numpy-based indexing: ~0.005s
I'm going to swap the view-based indexing back to numpy. However, there is a speed difference between the memory contiguous index_pairs and the vstack (not contiguous) index_pairs.
Non-contiguous index_pairs: ~0.025s
Contiguous index_pairs: ~0.005s
This function is only called 2 * n_worker times throughout apply_oe so the differences here are so minor to be essentially irrelevant.
c04c10e to
fbf0dc4
Compare
|
I've updated the PR with the following revisions based on our conversation: Major changes:
Minor changes:
|
| ) | ||
| else: | ||
| self.svf = [] | ||
|
|
There was a problem hiding this comment.
@brentwilder I ended making the skyview file consistent with the rest of the input files in that they are held as memory objects at the Worker level.
I also edited the case of no sky-view file to get around holding the ones array in memory. Let me know if you have any reservations at all.
It'd be super useful for you to run through a sky-view case on this PR whenever you have the bandwidth to do so! (that is once I get the checks passing...)
|
Passing a |
|
Ok, the infrastructure runs without errors for me finally. Will inspect results qualitatively now... |
|
Magnitude and shape differences are very likely introduced by using the 6c emulator for the multi surface version, as opposed to the 1c sRTMnet for the classic L2A. Therefore, I think this PR is ready to merge, based on comprehensive testing of various scenarios. |
96bd26e to
da12a71
Compare
|
Action items:
|
b077112 to
a581a67
Compare
…or fit_params Updates to AL and sky glint prior Edits to sky glint prior Editing glint fit parameters and adding indexing Simplifying fit_params wl choice Fixing typoes in surface_glint_model Rebase with dev
Initializing output matrices in analytical line with numpy not envi Fixed classification cleaning function Fixed index shift in multicomponent classifier Analytical Line bug fixes Adding coupled total transm to hueristic atmosphere Removing duplciate analytical_model function from rebase Fixed typo in template_constructions Changing simple to algebraic Fixed logging Changed state order to alphabetical Bad object reference Rolling back transm change Fixing bugs in examples test Fixing rebase issues Fixed examples Fixed bad invert_algebraic return Typo in template Fixed bad classification filtering
…put init func. Missed incorrect function argument
Loose bugs to get running through AOE Removing multi-scattering from AOE. Edits to AOE init to remove discontinuities Glint updates to heuristic atm Fix surface path in config and correct surface creation on non multisurface runs
Fixing classification cli. Tweaking glint est on init Fixed staging and config for single surface json Moving multistate to core Moved multistate.py to core. Fixed surface config for input .mat files. Fixing direct .mat input for surface Bad indent Missed surface_mapping var
Fixing bugs after rebase isofit run gets n_rows from SpectrumFile Moving tests into test_examples editing working directory in apply oe test Edits to test_cli SpectrumFile errors out if trying to build output that already exists Bug fix for tests Added initialization method to IO class Removing multisurface test label updaing flush dirs to reflect correct working dir Update Glint model. Fix surface copying Surface matrices size checks for 1-component surfaces Fixed typos Fixed logging type
a581a67 to
7fcd635
Compare




This is includes changes to the code base to handle an external classification file that is mapped to specific configurations of surface models and executions varying per-pixel or per-superpixel.
The goals of the changes:
Utilize external or internal classifications of surface configurations via apply_oe, directly in a manually configured config, and able to run both in per-pixel mode and in superpixel modes.
Remain efficient both in terms of computation time and memory requirements.
Things to highlight:
The "Surfaces" key is only used when running multiple surfaces.
Now surface specific surface.mat files are possible, and encouraged. When generating from .json, the surface model will use a "surface type" key to generate shared surface groupings into respective .mat files.
The cleanest implementation was to first make this a required key for multi-surface runs from .json. This could be made optional. Passed .mat files will use the same surface prior file across types.
On the spectrum write, the statevector is matched against a full statevector by name (not index). A fill value populates elements that are present in the full statevector, but not a pixel statevector.
Analytical line processing is handled similarly in sequence across present surface types
A couple of other changes to note:
There are a couple glint-related updates that I'm going to include in a separate PR.