.. _data.file: SPEC Data File -------------- The SPEC data file is written to a NeXus HDF5 file by parts as described below. .. _data.file.name: File name +++++++++ The file name (shown in this example): .. code-block:: :linenos: #F /home/sricat/POLAR/data/CMR/lmn40.spe The file name is copied to the file root as the ``SPEC_file`` attribute (denoted here as ``@SPEC_file``): .. code-block:: :linenos: @SPEC_file = "/home/sricat/POLAR/data/CMR/lmn40.spe" It is expected there is only one ``#F`` control line in a SPEC data file (assumes that the name of a file will not change midway) and, if it appears, it is the first line. .. _data.file.header: File header +++++++++++ Some content from a SPEC data file header is written to the root of the NeXus HDF5 file. Consider this example: .. code-block:: :linenos: #E 918630612 #D Wed Feb 10 01:10:12 1999 #C spec1ID User = polar #O0 Theta Two Theta sample x sample y From this example, this content is written to attributes of the file root: .. code-block:: :linenos: @SPEC_epoch = 918630612 @SPEC_date = "1999-02-10T01:10:12" @SPEC_comments = "spec1ID User = polar" @SPEC_user = "polar" @SPEC_num_headers = 1 The ``@SPEC_comments`` attribute includes contents of *all* ``#C`` (comment) lines that appear in the header section(s), joined together by newline (``\n``) characters. See :ref:`data.file.comments` for how this handled in scans. The additional information in the positioner names ``#O0`` control line will be used later (in :ref:`data.file.positioners`) when writing the positioners to the file.