Skip to content

ScreenBeamProfileMeasurement Fails if beam_fit != ImageProjectionFit #28

Description

@electronsandstuff

Describe the bug
ScreenBeamProfileMeasurement.fit_data(...) assumes image fit results have attribute signal_to_noise_ratio which isn't defined in parent class. See lcls_tools/common/measurements/screen_profile.py ln 155.

        for image in processed_images:
            fit_result = self.beam_fit.fit_image(image)
            rms_sizes_all.append(np.array(fit_result.rms_size))
            centroids_all.append(np.array(fit_result.centroid))
            total_intensities_all.append(fit_result.total_intensity)
            signal_to_noise_ratios_all.append(fit_result.signal_to_noise_ratio)

signal_to_noise_ratio is defined in ImageProjectionFitResult, but not the generic ImageFitResult which will cause errors if people use the code for image fitting methods other than ImageProjectionFit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions