diff --git a/contrib/test_data_generation/sofast_fringe/generate_downsampled_dataset.py b/contrib/test_data_generation/sofast_fringe/generate_downsampled_dataset.py index 8a78acb7f..d723cc016 100644 --- a/contrib/test_data_generation/sofast_fringe/generate_downsampled_dataset.py +++ b/contrib/test_data_generation/sofast_fringe/generate_downsampled_dataset.py @@ -31,11 +31,8 @@ def downsample_dataset(dir_input: str, dir_output: str) -> None: # Copy files that don't need downsampling print('Copying files with no downsampling...') files = [ - "camera_sofast.h5", "screen_calibration_point_pairs.csv", "image_projection.h5", - "image_sofast_camera.png", - "point_locations.csv", ] for file in files: shutil.copy(join(dir_input, file), join(dir_output, file)) @@ -70,7 +67,7 @@ def downsample_dataset(dir_input: str, dir_output: str) -> None: downsample_dataset( dir_input=join( opencsp_code_dir(), - '../../sample_data/sofast/data_photogrammetric_calibration/data_measurement', + '../../sample_data/deflectometry/calibration_screen_shape_photogrammetric/data_measurement', ), - dir_output=join(opencsp_code_dir, 'test/data/measurements_sofast_fringe'), + dir_output=join(opencsp_code_dir(), 'app/sofast/test/data/data_measurement'), ) diff --git a/example/sofast_fringe/example_calibration_screen_shape.py b/example/sofast_fringe/example_calibration_screen_shape.py index 42795422b..2e56bc3b2 100644 --- a/example/sofast_fringe/example_calibration_screen_shape.py +++ b/example/sofast_fringe/example_calibration_screen_shape.py @@ -27,7 +27,7 @@ def example_run_screen_shape_calibration(save_dir): corner_ids = pts_marker_data[:, 1] # Define desired resolution of screen sample grid - resolution_xy = [100, 100] + resolution_xy = [20, 20] # Define directory where screen shape calibration data is saved base_dir_sofast_cal = join(opencsp_code_dir(), 'app/sofast/test/data/data_measurement') @@ -37,6 +37,7 @@ def example_run_screen_shape_calibration(save_dir): file_camera_distortion = join(base_dir_sofast_cal, 'camera_screen_shape.h5') file_image_projection = join(base_dir_sofast_cal, 'image_projection.h5') files_screen_shape_measurement = glob(join(base_dir_sofast_cal, 'screen_shape_sofast_measurements/pose_*.h5')) + files_screen_shape_measurement.sort() # Load input data camera = Camera.load_from_hdf(file_camera_distortion) @@ -52,6 +53,7 @@ def example_run_screen_shape_calibration(save_dir): camera, image_projection_data, [MeasurementSofastFringe.load_from_hdf(f) for f in files_screen_shape_measurement], + ray_intersection_threshold=0.1 ) # Perform screen shape calibration diff --git a/opencsp/app/sofast/test/data/data_expected/screen_distortion_data_100_100.h5 b/opencsp/app/sofast/test/data/data_expected/screen_distortion_data_100_100.h5 deleted file mode 100644 index 03f14b0b1..000000000 Binary files a/opencsp/app/sofast/test/data/data_expected/screen_distortion_data_100_100.h5 and /dev/null differ diff --git a/opencsp/app/sofast/test/data/data_expected/screen_distortion_data_20_20.h5 b/opencsp/app/sofast/test/data/data_expected/screen_distortion_data_20_20.h5 new file mode 100644 index 000000000..58b4e397d Binary files /dev/null and b/opencsp/app/sofast/test/data/data_expected/screen_distortion_data_20_20.h5 differ diff --git a/opencsp/app/sofast/test/test_CalibrateDisplayShape.py b/opencsp/app/sofast/test/test_CalibrateDisplayShape.py index a94b079fa..87b646169 100644 --- a/opencsp/app/sofast/test/test_CalibrateDisplayShape.py +++ b/opencsp/app/sofast/test/test_CalibrateDisplayShape.py @@ -37,7 +37,7 @@ def setUpClass(cls): dir_output = join(opencsp_code_dir(), 'app/sofast/test/data/data_expected') # Define input files - resolution_xy = [100, 100] # sample density of screen + resolution_xy = [20, 20] # sample density of screen file_screen_cal_point_pairs = join(dir_input_sofast, 'screen_calibration_point_pairs.csv') file_point_locations = join(dir_input_def, 'point_locations.csv') file_camera_distortion = join(dir_input_sofast, 'camera_screen_shape.h5') @@ -61,6 +61,7 @@ def setUpClass(cls): camera, image_projection_data, [Measurement.load_from_hdf(f) for f in files_screen_shape_measurement], + ray_intersection_threshold=0.1 ) # Perform screen position calibration @@ -73,11 +74,11 @@ def setUpClass(cls): # Test screen distortion information cls.data_exp = load_hdf5_datasets( ['pts_xy_screen_fraction', 'pts_xyz_screen_coords'], - join(dir_output, 'screen_distortion_data_100_100.h5'), + join(dir_output, 'screen_distortion_data_20_20.h5'), ) cls.data_meas = dist_data - @pytest.mark.no_xvfb + # @pytest.mark.no_xvfb def test_screen_distortion_data(self): """Tests screen calibration data""" np.testing.assert_allclose(