Skip to content

Sofast diagnostics#328

Merged
jehsharp merged 5 commits intosandialabs:developfrom
rcbrost:sofast_diagnostics
Feb 16, 2026
Merged

Sofast diagnostics#328
jehsharp merged 5 commits intosandialabs:developfrom
rcbrost:sofast_diagnostics

Conversation

@rcbrost
Copy link
Collaborator

@rcbrost rcbrost commented Feb 15, 2026

Added Rendering of Mirror Embedded Surface, Also Bug Fixes

There has been a longstanding need to depict the relationship between a mirror's defining boundary on the (x, y) plane and its corresponding bound on the 3-d embedding optical surface. There also has been a longstanding need to draw slices of both parametric surfaces and measured point mirrors (the latter beyond the scope of this pull request). These new capabilities are also currently needed for a current challenging measurement problem. There also was a need to update and repair key test routines exercising mirror output.

Summary of changes

I extended the mirror rendering code to show the embedded surface of parametric mirrors, and also to show the relationships between defining features on the (x, y) plane and their corresponding features lifted onto the mirror embedding surface. This results in "projected" and "lifted" instances of the geometry.

This also includes implementation of general constant-x and constant-y slices of parametric mirrors, including both their projected and lifted geometries, and connecting lines between them.

These are demonstrated and tested in the test_MirrorOutput.py and example_MirrorOutput.py scripts. Further, the example_MirrorOutput.py scripts now verifies its output against expected output, as it should always have done.

I also extended the example_process_single_facet.py script to utilize this capability, to facilitate study of a new challenging measurement example.

I further began to extend the example_process_single_facet.py script to generate diagnostic output showing the progress of its computation to facilitate understanding and debugging. This work is ongoing, but I wanted to release these improvements instead of waiting until the full SOFAST diagnostic quite is operational.

I also improved some documentation and fixed some bugs encountered, most notably some circular imports which were blocking computation.

Implementation notes

It is possible that my repair to the circular references may have introduced a problem with the SpotAnalysis jupyter notebooks; I did not test these. However, the reason I conjecture that this might have occurred is due to a very large and problematic import dependence which caused the observed circular import problem. If problems with the SpotAnalysis jupyter notebooks are observed, then the SpotAnalysis code should be refactored to prevent the introduction of the multiple circular imports. (One specific example I encountered was that when a RegionXY was imported, it correctly imported a LoopXY class which in turn imported the View3d class. This is appropriate, since a RegionXY contains LoopXY objects, and both classes must be able to draw themselves. However, the problem occurred when the import of the View3d class forced an import of the entire rendering package, and then the entire computer vision package, and then large chunks of the SpotAnaylsis system. One of the SpotAnalysis files ultimately needed a RegionXY object, and this caused the circular import loop. This expansive growth of imports is excessive and should be prevented by refactoring.

Submission checklist

  • Target branch is develop, not main
  • Existing tests are updated or new tests were added
  • opencsp/test/test_DocStringsExist.py are verified to include this change or have been updated accordingly
  • .rst file(s) under doc/ are verified to include this change or have been updated accordingly

Additional information

Work on SOFAST diagnostics will continue.

…rOutput, example_MirrorOutput, also solar field. Fixed broken pytests, reduced circular imports. SpotAnalysis notebooks might be broken.
…n visualization. Also all prior debug plots output.
…le_facet.py. Added comments to LoopXY.py regarding convexity check.
@rcbrost rcbrost requested a review from jehsharp February 15, 2026 21:57
@rcbrost rcbrost added documentation Improvements or additions to documentation enhancement New feature or request labels Feb 15, 2026
Copy link
Collaborator

@jehsharp jehsharp left a comment

Choose a reason for hiding this comment

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

Hey Randy, in file common/lib/csp/MirrorAbstract.py, on line 842, this string:

If "project_..." is true

is causing the Sphinx doc check to fail, it does not like that syntax. Locally I changed it to something like this:

If any project slice variable is true (ie, project_origin_slice_y)

And that syntax works. Would you mind making that small change and pushing to the PR?

Thanks so much!

@rcbrost
Copy link
Collaborator Author

rcbrost commented Feb 16, 2026 via email

Copy link
Collaborator

@jehsharp jehsharp left a comment

Choose a reason for hiding this comment

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

This looks good to me!

@jehsharp jehsharp merged commit 22a48d2 into sandialabs:develop Feb 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants