diff --git a/example/sofast_fringe/example_calibration_spatial_orientation.py b/example/sofast_fringe/example_calibration_spatial_orientation.py index 86651275e..573af0ae1 100644 --- a/example/sofast_fringe/example_calibration_spatial_orientation.py +++ b/example/sofast_fringe/example_calibration_spatial_orientation.py @@ -14,7 +14,7 @@ def example_run_camera_position_calibration(save_dir: str): - """Calibrates the relative position of the Sofast camera and display. + """Calibrates the relative position of the Sofast camera and display. Saves the rvec/tvec in a SpatialOrientation file at ./data/output/spatial_orientation.h5 """ # Define directory where screen shape calibration data is saved diff --git a/opencsp/app/sofast/lib/DisplayShape.py b/opencsp/app/sofast/lib/DisplayShape.py index 7ffdc9166..04cf0f671 100644 --- a/opencsp/app/sofast/lib/DisplayShape.py +++ b/opencsp/app/sofast/lib/DisplayShape.py @@ -177,33 +177,24 @@ def load_from_hdf(cls, file: str, prefix: str = '') -> 'DisplayShape': Prefix to append to folder path within HDF file (folders must be separated by "/") """ # Load grid data - datasets = [ - prefix + 'DisplayShape/screen_model', - prefix + 'DisplayShape/name', - ] + datasets = [prefix + 'DisplayShape/screen_model', prefix + 'DisplayShape/name'] data = ht.load_hdf5_datasets(datasets, file) # Rectangular if data['screen_model'] == 'rectangular2D': - datasets = ['DisplayShape/screen_x', 'DisplayShape/screen_y'] + datasets = [prefix + 'DisplayShape/screen_x', prefix + 'DisplayShape/screen_y'] grid_data = ht.load_hdf5_datasets(datasets, file) # Distorted 2D elif data['screen_model'] == 'distorted2D': - datasets = [ - 'DisplayShape/xy_screen_fraction', - 'DisplayShape/xy_screen_coords', - ] + datasets = [prefix + 'DisplayShape/xy_screen_fraction', prefix + 'DisplayShape/xy_screen_coords'] grid_data = ht.load_hdf5_datasets(datasets, file) grid_data['xy_screen_fraction'] = Vxy(grid_data['xy_screen_fraction']) grid_data['xy_screen_coords'] = Vxy(grid_data['xy_screen_coords']) # Distorted 3D elif data['screen_model'] == 'distorted3D': - datasets = [ - 'DisplayShape/xy_screen_fraction', - 'DisplayShape/xyz_screen_coords', - ] + datasets = [prefix + 'DisplayShape/xy_screen_fraction', prefix + 'DisplayShape/xyz_screen_coords'] grid_data = ht.load_hdf5_datasets(datasets, file) grid_data['xy_screen_fraction'] = Vxy(grid_data['xy_screen_fraction']) grid_data['xyz_screen_coords'] = Vxyz(grid_data['xyz_screen_coords']) @@ -213,10 +204,7 @@ def load_from_hdf(cls, file: str, prefix: str = '') -> 'DisplayShape': grid_data.update({'screen_model': data['screen_model']}) # Return display object - kwargs = { - 'name': data['name'], - 'grid_data': grid_data, - } + kwargs = {'name': data['name'], 'grid_data': grid_data} return cls(**kwargs) def save_to_hdf(self, file: str, prefix: str = '') -> None: diff --git a/opencsp/app/sofast/lib/ProcessSofastFringe.py b/opencsp/app/sofast/lib/ProcessSofastFringe.py index 6ad9eece6..56cac5c54 100644 --- a/opencsp/app/sofast/lib/ProcessSofastFringe.py +++ b/opencsp/app/sofast/lib/ProcessSofastFringe.py @@ -158,11 +158,9 @@ class ProcessSofastFringe(HDF5_SaveAbstract): - v_mask_centroid_image """ - def __init__(self, - measurement: MeasurementSofastFringe, - orientation: SpatialOrientation, - camera: Camera, - display: Display) -> 'ProcessSofastFringe': + def __init__( + self, measurement: MeasurementSofastFringe, orientation: SpatialOrientation, camera: Camera, display: Display + ) -> 'ProcessSofastFringe': """ SOFAST processing class. diff --git a/opencsp/app/sofast/lib/SpatialOrientation.py b/opencsp/app/sofast/lib/SpatialOrientation.py index 0eb09de5c..18801dd27 100644 --- a/opencsp/app/sofast/lib/SpatialOrientation.py +++ b/opencsp/app/sofast/lib/SpatialOrientation.py @@ -189,10 +189,7 @@ def load_from_hdf(cls, file: str, prefix: str = '') -> 'SpatialOrientation': # If optic is oriented, load optic orientation information if data['optic_oriented']: - datasets = [ - prefix + 'SpatialOrientation/r_cam_optic', - prefix + 'SpatialOrientation/v_cam_optic_cam', - ] + datasets = [prefix + 'SpatialOrientation/r_cam_optic', prefix + 'SpatialOrientation/v_cam_optic_cam'] data = ht.load_hdf5_datasets(datasets, file) r_cam_optic = Rotation.from_rotvec(data['r_cam_optic']) v_cam_optic_cam = Vxyz(data['v_cam_optic_cam'])