ewoksid14.tasks.io.mca_data_to_spec_string#

ewoksid14.tasks.io.mca_data_to_spec_string(mca, title=None, filename=None, date=None, calibration=None, detector_name=None, metadata=None)[source]#

Official file format specs: https://certif.com/downloads/css_docs/spec_man.pdf

Parameters:
  • mca (Sequence[float]) – MCA spectrum

  • title (Optional[str]) – scan title

  • filename (Optional[str]) – name by which the file will be created

  • date (Union[str, datetime, date, None]) – start date of the scan

  • calibration (Optional[Sequence[float]]) – MCA calibration as the sequence [zero, gain, quad], all of them optional so that energy = zero + gain*channels + quad*channels^2

  • detector_name (Optional[str]) – name of the MCA detector

  • metadata (Optional[Dict]) – saved as comments

Return type:

str

Returns:

SPEC serialized string