Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
070484c
Added a cell for updating PYTHONPATH
jehsharp Sep 8, 2025
6d6c46f
Finished my comment
jehsharp Sep 8, 2025
8737797
Added helper script
jehsharp Sep 11, 2025
c4e3c1d
Updated helper cell for adding opencsp
jehsharp Sep 11, 2025
fed1d75
Got target identification to work locally
jehsharp Oct 1, 2025
c78d94b
More work on jupyter notebook
jehsharp Oct 1, 2025
e465919
I don't know if I actually got all my changes in the last commit
jehsharp Oct 1, 2025
befa862
Runs on Windows now, updated some cells
jehsharp Oct 2, 2025
40b7cc6
Enclosed energy jupyter notebook working on windows
jehsharp Oct 3, 2025
e9e14dc
Merging 2 branches so that my work is in same branch
jehsharp Oct 3, 2025
d71d33d
Additional work on examples
jehsharp Oct 7, 2025
35ada81
Small changes to jupyter notebooks
jehsharp Oct 8, 2025
5d26268
Updated Jupyter Notebooks and PowerpointImage.py
jehsharp Oct 8, 2025
af7282f
Fixed the ViewFalseColorImageProcessor image not displaying
jehsharp Oct 17, 2025
03923c3
Finally got bad plots to stop showing and good plots to appear
jehsharp Oct 21, 2025
69036ab
Uploading all my work so far
jehsharp Oct 29, 2025
701f43f
fixed formatting issues
jehsharp Oct 29, 2025
a360a6c
Fixing other format issues
jehsharp Oct 29, 2025
3913adb
Fixed another format error
jehsharp Oct 29, 2025
8098fce
Fixing another format error
jehsharp Oct 29, 2025
3fd2486
Modified Jupyter Notebooks
jehsharp Oct 29, 2025
247b259
Jupyter Notebook fixes
jehsharp Oct 30, 2025
d89efad
Format changes
jehsharp Oct 30, 2025
4febd59
Updated a path
jehsharp Oct 30, 2025
6785fcd
Format
jehsharp Oct 30, 2025
43efb88
Taking out the htmls from the repo
jehsharp Oct 30, 2025
bb012cf
Got notebooks working with ImageGrid and PowerpointImage
jehsharp Nov 20, 2025
3047405
Fixed merge conflict
jehsharp Nov 20, 2025
c9901ee
Cleaned up and got rid of obsolete helper script
jehsharp Nov 20, 2025
2a3114c
Revert to previous requirements.txt
jehsharp Nov 20, 2025
e537757
Revert some logic in PowerpointImage since I already have another fea…
jehsharp Nov 20, 2025
20fe8fe
Got Develops version of cross_section.ipynb to resolve merge conflict
jehsharp Nov 20, 2025
addf75e
Reformatted PowerpointImage
jehsharp Nov 20, 2025
b89ff73
Merge branch 'develop' into work_on_jupyter_notebooks_target_identifi…
jehsharp Nov 20, 2025
dafa958
Left a comment
jehsharp Nov 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
AbstractSpotAnalysisImageProcessor,
)
import opencsp.common.lib.tool.log_tools as lt
import matplotlib.pyplot as plt


if TYPE_CHECKING:
Expand Down Expand Up @@ -296,7 +297,6 @@ def build_enclosed_energy_plot(self, enclosed_energy_sums: list[int]) -> tuple[n

# close the figure
fig_record.close()

return plot_image, percentages_of_interest_radii

def build_poi_annotations(
Expand Down Expand Up @@ -342,9 +342,15 @@ def _execute(self, operable: SpotAnalysisOperable, is_last: bool) -> list[SpotAn
# Generate a visual plot of the enclosed energy
enclosed_energy_plot, percentages_of_interest_radii = self.build_enclosed_energy_plot(enclosed_energy_sums)

plt.imshow(enclosed_energy_plot)
plt.show()

# Attach the enclosed energy annotations
enclosed_energy_annos = self.build_poi_annotations(center, percentages_of_interest_radii)

plt.imshow(example_enclosed_energy_image, cmap="grey")
plt.show()

# Build the new operable
notes = copy.copy(operable.image_processor_notes)
notes.append(tuple([self.name, tuple([percentages_of_interest_radii, [str(v) for v in enclosed_energy_sums]])]))
Expand Down
4 changes: 3 additions & 1 deletion contrib/common/lib/tool/ImageGrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ def __init__(
self._subimage_size = subimage_size
self.number_images = number_images
self.numbering_color = clr.Color.from_generic(numbering_color)
self.numbering_outline_color = clr.Color.from_generic(numbering_outline_color)
self.numbering_outline_color = (
None if numbering_outline_color is None else clr.Color.from_generic(numbering_outline_color)
)

self.images: list[Image.Image] = []
self.add_images(*images)
Expand Down
292 changes: 246 additions & 46 deletions example/enclosed_energy/enclosed_energy.ipynb

Large diffs are not rendered by default.

616 changes: 502 additions & 114 deletions example/target_identification/target_identification.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,15 @@ def visualize_operable(
graphs_per_plot_cnt += self._draw_cross_section(np_image, cs_loc, cropped_region)

# draw
first_view = True
for view in self.views:
legend = graphs_per_plot_cnt > 1
view.show(block=False, legend=legend)

# jhs modified, only the first view has actual data to display in the enclosed_energy jupyter notebook
# example, so I am only showing that one here. Also, this is true for the target_identification example
if first_view:
view.show(block=False, legend=legend)
first_view = False

# explicitly set the y-axis range
if self.y_range is not None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ def visualize_operable(
else:
ret = [self.apply_mapping_jet(operable, base_image)]

processed_image = ret[0].nparray

self.figure.clear()
self.figure.view.imshow(processed_image)
self.figure.view.show(block=False)

return ret

def close_figures(self):
Expand Down
12 changes: 9 additions & 3 deletions opencsp/common/lib/render/lib/PowerpointImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ class PowerpointImage(pps.PowerpointShape):
"""

_tmp_save_path = ft.join(orp.opencsp_temporary_dir(), "PowerpointImage/images/tmp")
# _tmp_save_path = ft.join(
# "C:/ctemp", "OpenCSP_example_data/target_identification/HeliostatsSpotSize/3_Process/PowerPointFigures"
# )

def __init__(
self,
Expand Down Expand Up @@ -636,7 +639,9 @@ def save(self) -> None | str:
# get a temporary name to save to
found_unused_name = False
for tmp_slide_idx in slide_idx_range:
max_img_idx = 20 # probably shouldn't need more than 20 images in a slide
max_img_idx = (
20 # probably shouldn't need more than 20 images in a slide, TODO, marked, revisit 20 image limit
)
dir_name_ext_pattern = self._get_save_dir_name_ext_pattern(tmp_slide_idx)
max_image_path_name_ext = dir_name_ext_pattern % (max_img_idx - 1)
if ft.file_exists(max_image_path_name_ext):
Expand All @@ -656,6 +661,7 @@ def save(self) -> None | str:
lt.info(f"saving image to {image_path_name_ext}")

# save the image
# saved_path, body_ext = self._save(image_path_name_ext) # jhs commented out
saved_path, body_ext = self._save(image_path_name_ext)
if saved_path != self._tmp_save_path:
lt.error_and_raise(
Expand Down Expand Up @@ -690,8 +696,8 @@ def clear_tmp_save(self):
# TODO verify that the path is the expected temporary path

# delete the saved files
ft.delete_file(path_name_ext, error_on_not_exists=False)
ft.delete_file(path_name_ext_serialized, error_on_not_exists=False)
# ft.delete_file(path_name_ext, error_on_not_exists=False) # jhs, commented out in order to retain powerpoint figures
# ft.delete_file(path_name_ext_serialized, error_on_not_exists=False)

@classmethod
def clear_tmp_save_all(cls):
Expand Down