Skip to content

Incorrect return of 1D #14

@dylanmcreynolds

Description

@dylanmcreynolds

reduction, _, _ = await asyncio.to_thread(

The first return value is not the reduced data, it's the calculated q-space coordinates.

We actually need both, and need to enhance the SAS1DReduction model to take both. Then UI needs to accept both.

So, maybe

q_coordinates, reduction, _ = await asyncio.to_thread(
                    pixel_roi_horizontal_cut, **reduction_settings
                )
                plot_array = np.column_stack((q_coordinates, reduction))
                serializable_reduction = SerializableNumpyArrayModel(array=plot_array)
                reduction_msg = SAS1DReduction(
                    curve=serializable_reduction,  # just the qparrallel, not the cut_average or errors
                    curve_tiled_url="curve",
                    raw_frame=message.image,
                    raw_frame_tiled_url=message.tiled_url,
                )

In this case, I think the websocket will change to producing a 2d array instead of a 1D array, and the UI code will need to change so with each item in the array, the first value is x and the second is y. The label might of x will be q. @SeijDeLeon

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions