Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -112,6 +112,7 @@ def __init__(
processors_per_slide: (
list[list[ProcessorSelector | ProcOrImg | tuple[ProcOrImg, str, ImageType]]] | None
) = None,
persistent_save_path=None,
):
super().__init__()

Expand Down Expand Up @@ -172,6 +173,7 @@ def __init__(
self.overwrite = overwrite
self.operable_title_slides = operable_title_slides_todo
self.processors_per_slide = processors_per_slide
self.persistent_save_path = persistent_save_path

# internal values
self.is_first_operable = True
Expand Down Expand Up @@ -376,7 +378,9 @@ def _execute(self, operable: SpotAnalysisOperable, is_last: bool) -> list[SpotAn
slide.set_title(operable.best_primary_nameext)
for processor_sel, image in images_list:
caption = processor_sel.get_caption()
slide.add_image(pi.PowerpointImage(image.nparray, caption=caption))
slide.add_image(
pi.PowerpointImage(image.nparray, caption=caption, persistent_save_path=self.persistent_save_path)
)

# add the slide to the presentation
slide.save_and_bake()
Expand Down
301 changes: 155 additions & 146 deletions example/enclosed_energy/enclosed_energy.ipynb

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions example/enclosed_energy/enclosed_energy_settings_ctemp.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This file provides the data paths for the "enclosed_energy.ipynb" example notebook,
# executed against data placed in the "C:\ctemp\OpenCSP_example_data" directory.
#
# To use this file for the ctemp data location, copy the released OpenCSP data from:
#
# https://opencsp.sandia.gov
# --> How to Participate
# --> Access OpenCSP
# --> shared box.com link
# --> OpenCSP_Data
# --> OpenCSP_SampleData
# --> SpotAnalysis
# --> EnclosedEnergy_v1.1.zip
#
# Unzip and place the enclosed directory within the directory:
#
# C:\ctemp\OpenCSP_example_data\enclosed_energy\
#
# This will produce a directory structure:
#
# C:\ctemp\OpenCSP_example_data\enclosed_energy\EnclosedEnergyData_v1.1\
#
# Then rename "EnclosedEnergyData_v1.1" to "input", producing:
#
# C:\ctemp\OpenCSP_example_data\enclosed_energy\input\
#
# After this, the "enclosed_energy.ipynb" notebook should run without modification,
# writing to an "output" subdirectory placed next to the input directory.

[Default]
source_image_desc = Single_NSTTF_Facet_0900
nosun_dir = C:\ctemp\OpenCSP_example_data\enclosed_energy\input\HeliostatsSpotSize\2_Data\0900_NoSun\PixelData_Images
# In range below, no space allowed between comma and next entry.
nosun_images_range = 20241123_090715.90_1123_0900_NoSun_Raw.png,20241123_090721.58_1123_0900_NoSun_Raw.png
onsun_dir = C:\ctemp\OpenCSP_example_data\enclosed_energy\input\HeliostatsSpotSize\2_Data\0900_OnSun\PixelData_Images
# In range below, no space allowed between comma and next entry.
onsun_images_range = 20241123_090823.13_1123_0900_SF_Raw.png,20241123_090823.68_1123_0900_SF_Raw.png
output_dir = C:\ctemp\OpenCSP_example_data\enclosed_energy\output
7 changes: 0 additions & 7 deletions example/enclosed_energy/experiment_settings_example.ini

This file was deleted.

93 changes: 59 additions & 34 deletions example/scene_reconstruction/example_scene_reconstruction_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ example_scene_reconstruction_README.txt:
Example scene reconstruction calculation. Given photos with Aruco markers, find marker
and camera 3-d positions. See "example_scene_reconstruction_README.txt" for details.


To run this as a pytest on the built-in input:
1. cd to the OpenCSP code directory.
2. cd to the example subdirectory.
Expand All @@ -11,49 +12,73 @@ To run this as a pytest on the built-in input:
or
pytest scene_reconstruction\example_scene_reconstruction.py


To run this on the default built-in input:
1. cd to the directory containing the script "example_scene_reconstruction.py".
2. Run the script:
python example_scene_reconstruction.py --verbose
The "--verbose" flag is optional.

To run this on new input, use the -s option and point to a settings control file.
For an example settings file, see:
<OpenCSP_code_dir>\example\scene_reconstruction\example_scene_reconstruction_settings_ctemp.ini

We recommend copying this file and placing it alongside the data you wish to run.
For example, to run the full-size OpenCSP example:'
1. Create a directory "C:\ctemp\OpenCSP_ctemp\example_data_large" for holding example data.
2. Create subdirectory "scene_reconstruction"
3. Create subsubdirectory "input", and fill it with the required input files:
"alignment_points.csv"
"camera.h5"
"known_point_locations.csv"
"point_pair_distances.csv"
Subdirectory "aruco_marker_images" containing images of scene with Aruco markers.
4. Copy the file "example_scene_reconstruction_settings_ctemp.ini" into the subdirectory
"scene_reconstruction" made in step 2.'
5. Launch a PowerShell and ensure the OpenCSP virtual environment is activated.
6. cd to the directory containing the script "example_scene_reconstruction.py".
7. Run the script, providing the -s option and pointing to the .ini file:
python example_scene_reconstruction.py --verbose -s "C:\ctemp\OpenCSP_ctemp\example_data_large\scene_reconstruction\example_scene_reconstruction_settings_ctemp.ini"
8. The "--verbose" option generates additional status and calculation output.
9. The output will be written to an "example_scene_reconstruction_output" subdirectory
created alongside the input directory.
(This is to distinguish it from output from other examples within the directory.)

To run this calculation on your own data:
A. Create a directory holding your input data.
B. Copy the "example_scene_reconstruction_settings_ctemp.ini" file to a new name, such as
"My_Data_scene_reconstruction_settings.ini" and edit it to point to your data location.
C. For the sake of example, suppose you place your data in "C:\ctemp\OpenCSP_ctemp\MyData",

To run this on the published OpenCSP full-size example input:
1. Copy the released OpenCSP data from:

https://opencsp.sandia.gov
--> How to Participate
--> Access OpenCSP
--> shared box.com link
--> OpenCSP_Data
--> OpenCSP_SampleData
--> SceneReconstruction
--> SceneReconstructionData_v1.1.zip

2. Unzip and place the enclosed directory within the directory:

C:\ctemp\OpenCSP_example_data\enclosed_energy\

3. This will produce a directory structure:

C:\ctemp\OpenCSP_example_data\enclosed_energy\EnclosedEnergyData_v1.1\

4. Then rename "EnclosedEnergyData_v1.1" to "input", producing:

C:\ctemp\OpenCSP_example_data\enclosed_energy\input\

5. After this, the "example_scene_reconstruction.py" script should run without modification,
by executing the following:
5.1. Start a powershell.
5.2. Ensure the OpenCSP virtual environment is activated.
5.3. Navigate to the directory containing example_scene_reconstruction.py.
5.4. Execute the following command:
python example_scene_reconstruction.py --verbose -s C:\ctemp\OpenCSP_example_data\scene_reconstruction\input\example_scene_reconstruction_settings_ctemp.ini
The script should write to an "output" subdirectory placed next to the input directory.


To run this on your own new input:
1. Set up your input directory to contain the required information. See the published OpenCSP scene
reconstruction example for the files that are needed. These include:
"alignment_points.csv"
"camera.h5"
"known_point_locations.csv"
"point_pair_distances.csv"
Subdirectory "aruco_marker_images" containing images of scene with Aruco markers.

2. Create a settings configuration file. For an example settings file, see:
<OpenCSP_code_dir>\example\scene_reconstruction\example_scene_reconstruction_settings_ctemp.ini
We suggest copying this file, renaming it, placing it alongside your data, and editing
it to point to your data and output locations.

3. For the sake of example, suppose you place your data in "C:\ctemp\OpenCSP_ctemp\MyData",
and also suppose you place your new "My_Data_scene_reconstruction_settings.ini" file
in this directory.
Then you can run the same calculation on your data by:
a. cd to the directory containing the script "example_scene_reconstruction.py".
b. Run the script, providing the -s option and pointing to your .ini file:
python example_scene_reconstruction.py --verbose -s "C:\ctemp\OpenCSP_ctemp\MyData\My_Data_scene_reconstruction_settings_ctemp.ini"
D. The output will be written to the output subdirectory you specify in your .ini file.'
3.1. Start a powershell.
3.2. Ensure the OpenCSP virtual environment is activated.
3.3. Navigate to the directory containing the script "example_scene_reconstruction.py".
3.4. Run the script, providing the -s option and pointing to your .ini file:
python example_scene_reconstruction.py --verbose -s "C:\ctemp\OpenCSP_ctemp\MyData\My_Data_scene_reconstruction_settings_ctemp.ini"
The script shouyld write to the output directory specified in your .ini file.'


For a detailed description of the algorithm and its input and output, see:
B. J. Smith, R. C. Brost, and B. G. Bean.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,42 @@
# This file provides the data paths for the example_scene_reconstruction.py example.
# To use this file, copy it to a new filename and update the values below to point at your data source.
# Original file:
# <OpenCSP_code_dir>/example/scene_reconstruction/example_scene_reconstruction_ctemp.ini
# This file provides the data paths for the "example_scene_reconstruction.py" example,
# executed against data placed in the "C:\ctemp\OpenCSP_example_data" directory.
#
# To use this file for the ctemp data location, copy the released OpenCSP data from:
#
# https://opencsp.sandia.gov
# --> How to Participate
# --> Access OpenCSP
# --> shared box.com link
# --> OpenCSP_Data
# --> OpenCSP_SampleData
# --> SceneReconstruction
# --> SceneReconstructionData_v1.1.zip
#
# Unzip and place the enclosed directory within the directory:
#
# C:\ctemp\OpenCSP_example_data\scene_reconstruction\
#
# This will produce a directory structure:
#
# C:\ctemp\OpenCSP_example_data\scene_reconstruction\SceneReconstructionData_v1.1\
#
# Then rename "SceneReconstructionData_v1.1" to "input", producing:
#
# C:\ctemp\OpenCSP_example_data\scene_reconstruction\input\
#
# After this, the "example_scene_reconstruction.py" script should run without modification, by executing the following:
# 1. Start a powershell.
# 2. Ensure the OpenCSP virtual environment is activated.
# 3. Navigate to the directory containing example_scene_reconstruction.py.
# 4. Execute the following command:
# python example_scene_reconstruction.py --verbose -s C:\ctemp\OpenCSP_example_data\scene_reconstruction\input\example_scene_reconstruction_settings_ctemp.ini
# The script should run, writing to an "output" subdirectory placed next to the input directory.


[Default]
# Whether to output detailed progress output, intermediate calculation results, etc.
verbose = True

# Directory to find input files.
dir_input = C:\ctemp\OpenCSP_ctemp\example_data_large\scene_reconstruction\input

dir_input = C:\ctemp\OpenCSP_example_data\scene_reconstruction\input\LabScene\2_Data
# Directory to write output files.
dir_output = C:\ctemp\OpenCSP_ctemp\example_data_large\scene_reconstruction\example_scene_reconstruction_output
dir_output = C:\ctemp\OpenCSP_example_data\scene_reconstruction\output
10 changes: 0 additions & 10 deletions example/target_identification/experiment_settings_example.ini

This file was deleted.

Loading