ess.nmx.mcstas.streaming.calculate_number_of_chunks#

ess.nmx.mcstas.streaming.calculate_number_of_chunks(file_path, *, detector_name, bank_prefix=None, chunk_size=0)[source]#

Calculate number of chunks in the event data.

Parameters:
  • file_path (mcstas.types.FilePath (str)) – Path to the nexus file

  • detector_name (mcstas.types.DetectorName (str)) – Name of the detector to load

  • pixel_ids – Pixel ids to generate the data array with the events

  • chunk_size (int, default: 0) – Number of rows to read at a time. If 0, chunk slice is determined automatically by the iter_chunks. Note that it only works if the dataset is already chunked.

Returns:

int – Number of chunks in the event data.

Raises:
  • ValueError: – If the chunk size is not valid. (>= -1)

  • TypeError: – If the chunk size is not an integer.