ewoksxrdct.tasks.regrid_data.RegridData#

class ewoksxrdct.tasks.regrid_data.RegridData(inputs=None, varinfo=None, node_id=None, node_attrs=None, execinfo=None, profile_directory=None)[source]#

Bases: Task

Parameters:
  • inputs (Optional[Mapping])

  • varinfo (Optional[dict])

  • node_id (Union[str, int, tuple, None])

  • node_attrs (Optional[dict])

  • execinfo (Optional[dict])

  • profile_directory (Optional[dict])

static compute_bin_edges_centered(grid_start, grid_end, n_bins)[source]#

Compute bin edges, centered on grid points, to use for histogram regridding.

The edges are offset by half the grid spacing so that each bin is centered on its corresponding grid point.

Example: grid at [1, 2, 3, 4] -> edges at [0.5, 1.5, 2.5, 3.5, 4.5]

regrid_histogram(rot_edges, trans_edges)[source]#

Regrids azimuthally integrated data.

This function is used instead of np.histogram2d to avoid looping through all 2theta values.

Parameters#

self.inputs.rotation_angles: ndarray, shape (n_trans*n_rot,)

Rotation motor positions

self.inputs.translation_values: ndarray, shape (n_trans*n_rot,)

Translation motor positions

self.inputs.ai_datandarray, shape (n_trans*n_rot, n_2theta)

Azimuthally integrated intensities.

rot_edges, trans_edgesndarray

Pre-computed bin edges.

Returns#

ai_regridndarray, shape (n_trans, n_rot, n_2theta)

Regridded data on regular grid.

run()[source]#

Execute the task to regrid the azimuthally integrated data.

Return type:

None