ewoksxrpd.tasks.ascii.SaveNexusPatternsAsAscii#

class ewoksxrpd.tasks.ascii.SaveNexusPatternsAsAscii(*args, **kw)[source]#

Bases: TaskWithDataAccess

Convert azimuthal integration results from NeXus to ASCII files

One ASCII file is created for each integration pattern in nxdata_url. ASCII files are named from the output_filename_template and the pattern index.

If output_archive_filename is provided, all ASCII files are stored in a single ZIP file. In this case, output_filename_template is the template path of ASCII files inside the ZIP file.

Required inputs: - nxdata_url (str): The url of the NXData group storing the azimuthal integration results - output_filename_template (str): A string template containing one ‘%d’ field.

It is used to generate the filename from the frame number.

Optional inputs: - header (dict): Information to store in ASCII file header (default: {}) - enabled (bool): True to enable saving as ASCII files, False to skip task (default: True) - output_archive_filename (str): Filename of the ZIP file containing all ASCII files.

If this is None (default) or the empty string, ZIP compression is disabled.

  • overwrite (bool): True to allow overwriting existing ASCII/ZIP files (default: False)

  • sector_suffix_template (str): A string template containing one ‘%d’ field. Used to generate the string appended at the end of the filename showing the sector number. Defaults to “sector%04d”. Only used if 2D integrated patterns are present.

  • counter_urls (list[str]): Urls to datasets with counter values to save in the file header. The dataset should be scalar or have a length equal to the number of integrated frames from the nxdata_url. If this is None (default), no counter value is added to the header.

Outputs: - filenames (tuple[str]): The names of the created ASCII files or ZIP file

MISSING_DATA = <MISSING_DATA>#
assert_ready_to_execute()#
cancel()#

Function called when a task is cancelled. To be implemented by the derived classes

property cancelled: bool#

Return True if the task has been cancelled by the user

classmethod class_nonce()#
classmethod class_nonce_data()#
classmethod class_registry_name()#
Return type:

Optional[str]

cleanup_references()#

Removes all references to the inputs. Side effect: fixes the uhash of the task and outputs

property done: bool#

Completed (with or without exception)

property exception: Exception | None#
execute(force_rerun=False, raise_on_error=True, cleanup_references=False)#
Parameters:
  • force_rerun (Optional[bool])

  • raise_on_error (Optional[bool])

  • cleanup_references (Optional[bool])

property failed: bool#

Completed with exception

fix_uhash()#

Fix the uhash when it is derived from the uhash data.

get_data(*args, **kw)#
get_image(*args, **kw)#
get_input_uhashes()#
get_input_value(key, default=<MISSING_DATA>)#
Parameters:

default (Any)

Return type:

Any

get_input_values()#
get_named_input_values()#
get_output_transfer_data()#

The values are either DataUri or Variable

get_output_uhashes()#
get_output_value(key, default=<MISSING_DATA>)#
Parameters:

default (Any)

Return type:

Any

get_output_values()#
get_positional_input_values()#
get_retry_options()#
classmethod get_subclass(registry_name, _second_attempt=False)#

Retrieving a derived class

classmethod get_subclass_names()#
Return type:

List[str]

classmethod get_subclasses()#
get_uhash_init(serialize=False)#
classmethod input_model()#
Return type:

Optional[Type[BaseInputModel]]

classmethod input_names()#
Return type:

Set[str]

property input_uhashes#
property input_values#

DEPRECATED

property input_variables: VariableContainer#
property inputs: ReadOnlyVariableContainerNamespace#
instance_nonce()#
classmethod instantiate(registry_name, **kw)#

Factory method for instantiating a derived class.

Parameters:
  • registry_name (str) – for example “tasklib.tasks.MyTask” or “MyTask”

  • **kwTask constructor arguments

Returns Task:

property is_ready_to_execute#
iter_bliss_data(*args, **kw)#
iter_bliss_data_from_memory(*args, **kw)#
iter_bliss_scan_data_from_memory_slice(*args, **kw)#
property job_id: str | None#
property label: str#
property missing_inputs: VariableContainerMissingNamespace#
property missing_outputs: VariableContainerMissingNamespace#
property n_positional_inputs: int#
classmethod n_required_positional_inputs()#
Return type:

int

property named_input_values#

DEPRECATED

property node_id: str | int | tuple#
property npositional_inputs#

DEPRECATED

open_h5item(url, create=False, overwrite=False, **openoptions)#
Parameters:
  • url (Union[str, DataUrl])

  • create (bool)

  • overwrite (bool)

Return type:

Iterator[Union[Group, Dataset, ndarray]]

classmethod optional_input_names()#
Return type:

Set[str]

property output_metadata: dict | None#
classmethod output_model()#
Return type:

Optional[Type[BaseOutputModel]]

classmethod output_names()#
Return type:

Set[str]

property output_transfer_data#

DEPRECATED

property output_uhashes#

DEPRECATED

property output_values#

DEPRECATED

property output_variables: VariableContainer#
property outputs: VariableContainerNamespace#
property positional_input_values#

DEPRECATED

property progress: int | None#

Task advancement. If a task progress is not provided then return None

classmethod required_input_names()#
Return type:

Set[str]

reset_state()#
run()[source]#

To be implemented by the derived classes

set_uhash_init(pre_uhash=None, instance_nonce=None)#
Parameters:
  • pre_uhash (Union[str, bytes, UniversalHash, HasUhash, None])

  • instance_nonce (Optional[Any])

property succeeded: bool#

Completed without exception and with output values

property task_identifier: str#
property uhash: UniversalHash | None#
uhash_randomize()#
undo_fix_uhash()#
undo_randomize()#
property workflow_id: str | None#