SPEC standard plugin#

SPEC data file standard control lines

see:

SPEC manual, Standard Data File Format, https://www.certif.com/spec_manual/user_1_4_1.html

class spec2nexus.plugins.spec_common.SPEC_Comment[source]#

Bases: ControlLineBase

#C – any comment either in the scan header or somewhere in the scan

IN-MEMORY REPRESENTATION

  • (SpecDataFileHeader): comments

  • (SpecDataFileScan): comments

HDF5/NeXus REPRESENTATION

  • file root-level attribute: SPEC_comments : string array of all comments from first header block

  • dataset named comments under /NXentry group, such as /S1/comments : string array of all comments from this scan block

key = '#C'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(header, *args, **kws)#

optional: More processing deferred until after data file has been read.

process(text, scan, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = ['comments']#
writer(h5parent, writer, scan, *args, **kws)[source]#

Describe how to store this data in an HDF5 NeXus file

class spec2nexus.plugins.spec_common.SPEC_CountTime[source]#

Bases: ControlLineBase

#T – counting against this constant number of seconds (see #M)

IN-MEMORY REPRESENTATION

  • (SpecDataFileScan): T

HDF5/NeXus REPRESENTATION

  • Dataset named T in the NXentry group, such as /S1/T

  • Dataset named counting_basis in the NXentry group with value SPEC scan with constant counting time, such as /S1/counting_basis

key = '#T'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(header, *args, **kws)#

optional: More processing deferred until after data file has been read.

process(text, scan, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = ['T', 'time_name']#
writer(h5parent, writer, scan, *args, **kws)[source]#

Describe how to store this data in an HDF5 NeXus file

class spec2nexus.plugins.spec_common.SPEC_CounterMnemonics[source]#

Bases: ControlLineBase

#j – mnemonics of counter (new with SPEC v6)

IN-MEMORY REPRESENTATION

  • (SpecDataFileHeader): j : mnemonics

HDF5/NeXus REPRESENTATION

  • NXnote group named counter_cross_reference in the NXentry group, such as /S1/counter_cross_reference

    • datasets with names supplied as SPEC counter mnemonics, string values supplied as SPEC counter names

key = '#j\\d+'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(header, *args, **kws)[source]#

optional: More processing deferred until after data file has been read.

process(text, header, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = ['j']#
writer(h5parent, writer, header, nxclass=None, *args, **kws)[source]#

Describe how to store this data in an HDF5 NeXus file

class spec2nexus.plugins.spec_common.SPEC_CounterNames[source]#

Bases: ControlLineBase

#J – names of counters (each separated by two spaces) (new with SPEC v6)

IN-MEMORY REPRESENTATION

  • (SpecDataFileHeader): J : mnemonics

HDF5/NeXus REPRESENTATION

  • NXnote group named counter_cross_reference in the NXentry group, such as /S1/counter_cross_reference

    • datasets with names supplied as SPEC counter mnemonics, string values supplied as SPEC counter names

key = '#J\\d+'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(header, *args, **kws)[source]#

optional: More processing deferred until after data file has been read.

process(text, header, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = ['J']#
writer(h5parent, writer, header, nxclass=None, *args, **kws)[source]#

Describe how to store this data in an HDF5 NeXus file

class spec2nexus.plugins.spec_common.SPEC_DataLine[source]#

Bases: ControlLineBase

(scan_data) – scan data line

Scan data could include interspersed MCA data or even describe 2-D or 3-D data. T his method reads the data lines and buffers them for post-processing in spec2nexus.plugins.spec_common_spec2nexus.data_lines_postprocessing().

IN-MEMORY REPRESENTATION

  • (SpecDataFileScan): data_lines : values

  • (SpecDataFileScan): data : {labels: values}

HDF5/NeXus REPRESENTATION

  • NXdata group named data in the NXentry group, such as /S1/data

  • datasets with names supplied in L, array values collected in data_lines

key = 'scan_data'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)[source]#

Easier to try conversion to number than construct complicated regexp

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(scan, *args, **kws)[source]#

optional: More processing deferred until after data file has been read.

process(text, scan, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = ['data', 'data_lines']#
writer(h5parent, writer, scan, nxclass=None, *args, **kws)#

optional: Describe how to store this data in a NeXus HDF5 file.

class spec2nexus.plugins.spec_common.SPEC_Date[source]#

Bases: ControlLineBase

#D – date/time stamp

IN-MEMORY REPRESENTATION

  • (SpecDataFileHeader): date str, ISO8601 format

HDF5/NeXus REPRESENTATION

  • file root-level attribute: SPEC_date str (value for 1st header block is used)

key = '#D'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(header, *args, **kws)#

optional: More processing deferred until after data file has been read.

process(text, sdf_object, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = []#
writer(h5parent, writer, sdf_object, *args, **kws)[source]#

Describe how to store this data in an HDF5 NeXus file

class spec2nexus.plugins.spec_common.SPEC_Epoch[source]#

Bases: ControlLineBase

#E – the UNIX epoch (seconds from 00:00 GMT 1/1/70)

In SPEC data files, the #E control line indicates the start of a header block.

IN-MEMORY REPRESENTATION

  • (SpecDataFileHeader): epoch int

HDF5/NeXus REPRESENTATION

  • file root-level attribute: SPEC_epoch int

key = '#E'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(header, *args, **kws)#

optional: More processing deferred until after data file has been read.

process(buf, sdf_object, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = []#
writer(h5parent, writer, scan, nxclass=None, *args, **kws)#

optional: Describe how to store this data in a NeXus HDF5 file.

class spec2nexus.plugins.spec_common.SPEC_File[source]#

Bases: ControlLineBase

#F – original data file name (starts a file header block)

Module spec2nexus.spec is responsible for handling this control line.

IN-MEMORY REPRESENTATION

  • (SpecDataFile): fileName

  • (SpecDataFileHeader) : file

HDF5/NeXus REPRESENTATION

  • file root-level attribute: SPEC_file

key = '#F'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(header, *args, **kws)#

optional: More processing deferred until after data file has been read.

process(text, spec_file_obj, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = []#
writer(h5parent, writer, scan, nxclass=None, *args, **kws)#

optional: Describe how to store this data in a NeXus HDF5 file.

class spec2nexus.plugins.spec_common.SPEC_Geometry[source]#

Bases: ControlLineBase

#G – diffractometer geometry (numbered rows: #G0, #G1, …)

IN-MEMORY REPRESENTATION

  • (SpecDataFileScan): G

HDF5/NeXus REPRESENTATION

  • NXnote group named G in the NXentry group, such as /S1/G

    • Datasets created from dictionary <scan>.G (indexed by number from the scan block, such as G0, G1, …). Meaning of contents for each index are defined by geometry-specific SPEC diffractometer support.

  • NXinstrument & NXsample groups for interpreted information

key = '#G\\d+'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(scan, *args, **kws)[source]#

optional: More processing deferred until after data file has been read.

process(text, scan, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = ['G', 'diffractometer']#
writer(h5parent, writer, scan, nxclass=None, *args, **kws)[source]#

Describe how to store this data in an HDF5 NeXus file

class spec2nexus.plugins.spec_common.SPEC_HKL[source]#

Bases: ControlLineBase

#Q\(Q\) (\(hkl\)) at start of scan

IN-MEMORY REPRESENTATION

  • (SpecDataFileScan): Q

HDF5/NeXus REPRESENTATION

  • Dataset named Q in the NXentry group, such as /S1/M

key = '#Q'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(header, *args, **kws)#

optional: More processing deferred until after data file has been read.

process(text, scan, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = ['Q']#
writer(h5parent, writer, scan, *args, **kws)[source]#

Describe how to store this data in an HDF5 NeXus file

class spec2nexus.plugins.spec_common.SPEC_Labels[source]#

Bases: ControlLineBase

#L – data column labels

IN-MEMORY REPRESENTATION

  • (SpecDataFileScan): L : labels

  • (SpecDataFileScan): data : {labels: values}

HDF5/NeXus REPRESENTATION

  • NXdata group named data in the NXentry group, such as /S1/data

  • datasets with names supplied in L, array values collected in data_lines

key = '#L'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(header, *args, **kws)#

optional: More processing deferred until after data file has been read.

process(text, scan, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = ['L', 'column_first', 'column_last']#
writer(h5parent, writer, scan, nxclass=None, *args, **kws)#

optional: Describe how to store this data in a NeXus HDF5 file.

class spec2nexus.plugins.spec_common.SPEC_MCA[source]#

Bases: ControlLineBase

#@MCA – MCA data formatting declaration (ignored for now)

declares this scan contains MCA data (SPEC’s array_dump() format, such as "#@MCA 16C")

From documentation provided by the ESRF BLISS group: (https://www.esrf.eu/blissdb/macros/getsource.py?macname=mca.mac)

#@MCA 16C Format string passed to data_dump() function. This format string is held by the global variable “MCA_FMT” and can then been adapted to particular needs. “%%16C” is the default. It dumps data on 1 line, cut every 16 points:

@A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\
 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\
 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\
 0 0 0 0 0 0 0 0 0 0 0 ...

“%%16” would do the same without any backslash “1” would dump 1 point per line, …

key = '#@MCA'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(header, *args, **kws)#

optional: More processing deferred until after data file has been read.

process(text, scan, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = []#
writer(h5parent, writer, scan, nxclass=None, *args, **kws)#

optional: Describe how to store this data in a NeXus HDF5 file.

class spec2nexus.plugins.spec_common.SPEC_MCA_Array[source]#

Bases: ControlLineBase

@A – MCA Array data

MCA data. Each value is the content of one channel, or an integrated value over several channels if a reduction was applied.

Since the MCA Array data is interspersed with scan data, this method reads the data lines and buffers them for post-processing in spec2nexus.plugins.spec_common_spec2nexus.data_lines_postprocessing().

IN-MEMORY REPRESENTATION

  • (SpecDataFileScan): data_lines : values

  • (SpecDataFileScan): data : {labels: values}

HDF5/NeXus REPRESENTATION

  • NXdata group named data in the NXentry group, such as /S1/data

    • Dataset _mca_ : float MCA data reported on @A lines

    • Dataset _mca_channel_: provided as HDF5 dimension scale for _mca_ dataset
      • if CALIB data specified: float scaled MCA channels – \(x_k = a +bk + ck^2\)

      • if CALIB data not specified: int MCA channel numbers

key = '@A\\d*'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(scan, *args, **kws)[source]#

optional: More processing deferred until after data file has been read.

process(text, scan, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = ['data_lines']#
writer(h5parent, writer, scan, nxclass=None, *args, **kws)#

optional: Describe how to store this data in a NeXus HDF5 file.

class spec2nexus.plugins.spec_common.SPEC_MCA_Calibration[source]#

Bases: ControlLineBase

#@CALIB – coefficients to compute a scale based on the MCA channel number

\(x_k = a +bk + ck^2\) for MCA data, \(k\) is channel number

IN-MEMORY REPRESENTATION

  • (SpecDataFileScan): MCA[‘CALIB’] = dict(a, b, c)

HDF5/NeXus REPRESENTATION

  • defines a dimension scale for MCA data

  • NXnote group named MCA in the NXentry group, such as /S1/MCA

    • Dataset calib_a : float

    • Dataset calib_b : float

    • Dataset calib_c : float

key = '#@[cC][aA][lL][iI][bB]'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(header, *args, **kws)#

optional: More processing deferred until after data file has been read.

process(text, scan, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = ['MCA']#
writer(h5parent, writer, scan, nxclass=None, *args, **kws)[source]#

Describe how to store this data in an HDF5 NeXus file

class spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation[source]#

Bases: ControlLineBase

#@CHANN – MCA channel information

number_saved, first_saved, last_saved, reduction_coef

IN-MEMORY REPRESENTATION

  • (SpecDataFileScan): MCA[‘CALIB’] = dict(number_saved, first_saved, last_saved, reduction_coef)

HDF5/NeXus REPRESENTATION

  • NXnote group named MCA in the NXentry group, such as /S1/MCA

    • Dataset number_saved : int number of channels saved

    • Dataset first_saved : int first channel saved

    • Dataset first_saved : int last channel saved

    • Dataset reduction_coef : float reduction coefficient

key = '#@CHANN'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(header, *args, **kws)#

optional: More processing deferred until after data file has been read.

process(text, scan, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = ['MCA']#
writer(h5parent, writer, scan, nxclass=None, *args, **kws)[source]#

Describe how to store this data in an HDF5 NeXus file

class spec2nexus.plugins.spec_common.SPEC_MCA_CountTime[source]#

Bases: ControlLineBase

#@CTIME – MCA count times

preset_time, elapsed_live_time, elapsed_real_time

IN-MEMORY REPRESENTATION

  • (SpecDataFileScan): MCA[‘CALIB’] = dict(preset_time, elapsed_live_time, elapsed_real_time)

HDF5/NeXus REPRESENTATION

  • NXnote group named MCA in the NXentry group, such as /S1/MCA

    • Dataset preset_time : float

    • Dataset elapsed_live_time : float

    • Dataset elapsed_real_time : float

key = '#@CTIME'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(header, *args, **kws)#

optional: More processing deferred until after data file has been read.

process(text, scan, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = ['MCA']#
writer(h5parent, writer, scan, nxclass=None, *args, **kws)[source]#

Describe how to store this data in an HDF5 NeXus file

class spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest[source]#

Bases: ControlLineBase

#@ROI – MCA ROI (Region Of Interest) channel information

ROI_name, first_chan, last_chan

IN-MEMORY REPRESENTATION

  • (SpecDataFileScan): MCA[‘ROI’] = {ROI_name:dict(first_chan, last_chan)}

HDF5/NeXus REPRESENTATION

  • NXnote group ROI in in NXnote group named MCA in the NXentry group, such as /S1/MCA/ROI

    • Dataset {ROI_name} : int [first_chan, last_chan]

key = '#@ROI'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(header, *args, **kws)#

optional: More processing deferred until after data file has been read.

process(text, scan, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = ['MCA']#
writer(h5parent, writer, scan, nxclass=None, *args, **kws)[source]#

Describe how to store this data in an HDF5 NeXus file

class spec2nexus.plugins.spec_common.SPEC_Monitor[source]#

Bases: ControlLineBase

#M – counting against this constant monitor count (see #T)

IN-MEMORY REPRESENTATION

  • (SpecDataFileScan): M

HDF5/NeXus REPRESENTATION

  • Dataset named M in the NXentry group, such as /S1/M

  • Dataset named counting_basis in the NXentry group with value SPEC scan with constant monitor count, such as /S1/counting_basis

key = '#M'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(header, *args, **kws)#

optional: More processing deferred until after data file has been read.

process(text, scan, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = ['M', 'monitor_name']#
writer(h5parent, writer, scan, *args, **kws)[source]#

Describe how to store this data in an HDF5 NeXus file

class spec2nexus.plugins.spec_common.SPEC_NormalizingFactor[source]#

Bases: ControlLineBase

#I – intensity normalizing factor

IN-MEMORY REPRESENTATION

  • (SpecDataFileScan): I

HDF5/NeXus REPRESENTATION

  • Dataset named intensity_factor in the NXentry group, such as /S1/intensity_factor

key = '#I'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(header, *args, **kws)#

optional: More processing deferred until after data file has been read.

process(text, scan, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = ['I']#
writer(h5parent, writer, scan, nxclass=None, *args, **kws)[source]#

Describe how to store this data in an HDF5 NeXus file

class spec2nexus.plugins.spec_common.SPEC_NumColumns[source]#

Bases: ControlLineBase

#N – number of columns of data [ num2 sets per row ]

IN-MEMORY REPRESENTATION

  • (SpecDataFileScan): N : [int]

HDF5/NeXus REPRESENTATION

  • not written to file

key = '#N'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(header, *args, **kws)#

optional: More processing deferred until after data file has been read.

process(text, scan, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = ['N']#
writer(h5parent, writer, scan, nxclass=None, *args, **kws)#

optional: Describe how to store this data in a NeXus HDF5 file.

class spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics[source]#

Bases: ControlLineBase

#o – positioner mnemonics (new with SPEC v6)

IN-MEMORY REPRESENTATION

  • (SpecDataFileHeader): o : mnemonics

HDF5/NeXus REPRESENTATION

  • NXnote group named positioner_cross_reference in the NXentry group, such as /S1/positioner_cross_reference

    • datasets with names supplied as SPEC positioner mnemonics, string values supplied as SPEC positioner names

key = '#o\\d+'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(header, *args, **kws)[source]#

optional: More processing deferred until after data file has been read.

process(text, header, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = ['o']#
writer(h5parent, writer, header, nxclass=None, *args, **kws)[source]#

Describe how to store this data in an HDF5 NeXus file

class spec2nexus.plugins.spec_common.SPEC_PositionerNames[source]#

Bases: ControlLineBase

#O – positioner names (numbered rows: #O0, #O1, …)

IN-MEMORY REPRESENTATION

  • (SpecDataFileHeader) : O : label

  • (SpecDataFileScan): positioner : {label: value}

HDF5/NeXus REPRESENTATION

  • NXnote group named positioners in the NXentry group, such as /S1/positioners

    • datasets created from dictionary <scan>.positioner

  • NXnote group named positioner_cross_reference in the NXentry group, such as /S1/positioner_cross_reference

    • datasets with names supplied as SPEC positioner mnemonics, string values supplied as SPEC positioner names

key = '#O\\d+'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(header, *args, **kws)#

optional: More processing deferred until after data file has been read.

process(text, sdf_object, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = ['O']#
writer(h5parent, writer, scan, nxclass=None, *args, **kws)#

optional: Describe how to store this data in a NeXus HDF5 file.

class spec2nexus.plugins.spec_common.SPEC_Positioners[source]#

Bases: ControlLineBase

#P – positioner values at start of scan (numbered rows: #P0, #P1, …)

IN-MEMORY REPRESENTATION

  • (SpecDataFileHeader) : O : label

  • (SpecDataFileScan): positioner : {label: value}

HDF5/NeXus REPRESENTATION

  • NXnote group named positioners in the NXentry group, such as /S1/positioners

    • datasets created from dictionary <scan>.positioner

key = '#P\\d+'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(scan, *args, **kws)[source]#

interpret the motor positions from the scan header

Parameters:

scan (SpecDataFileScan) – data from a single SPEC scan

process(text, scan, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = ['P', 'positioner']#
writer(h5parent, writer, scan, nxclass=None, *args, **kws)[source]#

Describe how to store this data in an HDF5 NeXus file

class spec2nexus.plugins.spec_common.SPEC_Scan[source]#

Bases: ControlLineBase

#S – SPEC scan

In SPEC data files, the #S control line indicates the start of a scan block. Each scan will be written to a separate NXentry group in the HDF5 file.

NXentry:

“The top-level NeXus group which contains all the data and associated information that comprise a single measurement.”

https://download.nexusformat.org/doc/html/classes/base_classes/NXentry.html

IN-MEMORY REPRESENTATION

  • (SpecDataFile):

  • (SpecDataFileHeader):

HDF5/NeXus REPRESENTATION

  • /NXentry group named ‘S%d` scan_number at root level, such as /S1

key = '#S'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(header, *args, **kws)#

optional: More processing deferred until after data file has been read.

process(part, sdf, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = []#
writer(h5parent, writer, scan, nxclass=None, *args, **kws)#

optional: Describe how to store this data in a NeXus HDF5 file.

class spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint[source]#

Bases: ControlLineBase

#X – Temperature Set Point (desired temperature)

The default declaration of the #X control line is written:

def Fheader '_cols++;printf("#X %gKohm (%gC)\n",TEMP_SP,DEGC_SP)'

The supplied macro alters this slightly (replacing %g with %f) and uses the spec2nexus.scanf.scanf() implementation with this format:

fmt = "#X %fKohm (%fC)"

Depending on the circumstances, this might be a good candidate to override with a custom ControlLineBase that parses the data as written. If the conversion process fails for any reason in this implementation, the #X line is ignored.

IN-MEMORY REPRESENTATION

  • (SpecDataFileScan): TEMP_SP

  • (SpecDataFileScan): DEGC_SP

HDF5/NeXus REPRESENTATION

  • Dataset named TEMP_SP in the NXentry group, such as /S1/TEMP_SP

  • Dataset named DEGC_SP in the NXentry group, such as /S1/DEGC_SP

key = '#X'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(header, *args, **kws)#

optional: More processing deferred until after data file has been read.

process(text, scan, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = ['TEMP_SP', 'DEGC_SP']#
writer(h5parent, writer, scan, nxclass=None, *args, **kws)[source]#

Describe how to store this data in an HDF5 NeXus file

class spec2nexus.plugins.spec_common.SPEC_UserReserved[source]#

Bases: ControlLineBase

#U – Reserved for user-defined information

IN-MEMORY REPRESENTATION

  • (SpecDataFileHeader): U, [str]

  • (SpecDataFileScan): U, [str]

HDF5/NeXus REPRESENTATION

  • Within a group named UserReserved in the NXentry group: dataset(s) named header_## (from the SPEC data file header section) or item_## (from the SPEC data file scan section), such as /S1/UserReserved/header_1 and /S1/UserReserved/item_5

key = '#U'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(header, *args, **kws)#

optional: More processing deferred until after data file has been read.

process(text, sdf_object, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = ['U']#
writer(h5parent, writer, sdf_object, *args, **kws)[source]#

Describe how to store this data in an HDF5 NeXus file

class spec2nexus.plugins.spec_common.SPEC_UserResults[source]#

Bases: ControlLineBase

#R – Reserved for user results

IN-MEMORY REPRESENTATION

  • (SpecDataFileHeader): R, [str]

  • (SpecDataFileScan): R, [str]

HDF5/NeXus REPRESENTATION

  • Within a NXnote group named UserResults in the NXentry group: dataset(s) named header_## (from the SPEC data file header section) or item_## (from the SPEC data file scan section), such as /S1/UserResults/header_1 and /S1/UserResults/item_5

key = '#R'#
known_keys = {'#@CHANN': <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, '#@CTIME': <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, '#@MCA': <spec2nexus.plugins.spec_common.SPEC_MCA object>, '#@ROI': <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>, '#@[cC][aA][lL][iI][bB]': <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, '#C': <spec2nexus.plugins.spec_common.SPEC_Comment object>, '#CCD': <spec2nexus.plugins.XPCS.XPCS_CCD object>, '#D': <spec2nexus.plugins.spec_common.SPEC_Date object>, '#E': <spec2nexus.plugins.spec_common.SPEC_Epoch object>, '#F': <spec2nexus.plugins.spec_common.SPEC_File object>, '#G\\d+': <spec2nexus.plugins.spec_common.SPEC_Geometry object>, '#H\\d+': <unicat.UNICAT_MetadataMnemonics object>, '#I': <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, '#J\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, '#L': <spec2nexus.plugins.spec_common.SPEC_Labels object>, '#M': <spec2nexus.plugins.spec_common.SPEC_Monitor object>, '#MD\\w*': <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, '#N': <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, '#O\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, '#P\\d+': <spec2nexus.plugins.spec_common.SPEC_Positioners object>, '#Q': <spec2nexus.plugins.spec_common.SPEC_HKL object>, '#R': <spec2nexus.plugins.spec_common.SPEC_UserResults object>, '#S': <spec2nexus.plugins.spec_common.SPEC_Scan object>, '#T': <spec2nexus.plugins.spec_common.SPEC_CountTime object>, '#U': <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, '#UIM\\w*': <spec2nexus.plugins.uim.UIM_generic object>, '#UXML': <uxml.UXML_metadata object>, '#VA\\d+': <spec2nexus.plugins.XPCS.XPCS_VA object>, '#VD\\d+': <spec2nexus.plugins.XPCS.XPCS_VD object>, '#VE\\d+': <spec2nexus.plugins.XPCS.XPCS_VE object>, '#V\\d+': <unicat.UNICAT_MetadataValues object>, '#X': <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, '#XPCS': <spec2nexus.plugins.XPCS.XPCS_XPCS object>, '#j\\d+': <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, '#o\\d+': <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, '@A\\d*': <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, 'scan_data': <spec2nexus.plugins.spec_common.SPEC_DataLine object>, 'unrecognized_control_line': <spec2nexus.plugins.fallback.UnrecognizedControlLine object>}#
lazy_attributes = ['H', 'V', 'metadata', 'UXML', 'UXML_root', 'MD', '_unrecognized', 'UIM', 'comments', 'G', 'diffractometer', 'I', 'J', 'j', 'L', 'column_first', 'column_last', 'M', 'monitor_name', 'N', 'O', 'o', 'P', 'positioner', 'Q', 'R', 'T', 'time_name', 'U', 'TEMP_SP', 'DEGC_SP', 'data', 'data_lines', 'MCA', 'VA', 'VD', 'VE', 'XPCS', 'CCD']#
match_key(text)#

Test if this handler’s key matches text.

Parameters:

text (str) – first word on the line, up to but not including the first whitespace

Returns:

key or None

Applies a regular expression match using each handler’s key as the regular expression to match with text.

plugins = [<spec2nexus.plugins.unicat.UNICAT_MetadataMnemonics object>, <spec2nexus.plugins.unicat.UNICAT_MetadataValues object>, <spec2nexus.plugins.uxml.UXML_metadata object>, <apstools_specwriter.MD_apstools object>, <fallback.UnrecognizedControlLine object>, <unicat.UNICAT_MetadataMnemonics object>, <unicat.UNICAT_MetadataValues object>, <uxml.UXML_metadata object>, <uim.UIM_generic object>, <spec_common.SPEC_File object>, <spec_common.SPEC_Epoch object>, <spec_common.SPEC_Date object>, <spec_common.SPEC_Comment object>, <spec_common.SPEC_Scan object>, <spec_common.SPEC_Geometry object>, <spec_common.SPEC_NormalizingFactor object>, <spec_common.SPEC_CounterNames object>, <spec_common.SPEC_CounterMnemonics object>, <spec_common.SPEC_Labels object>, <spec_common.SPEC_Monitor object>, <spec_common.SPEC_NumColumns object>, <spec_common.SPEC_PositionerNames object>, <spec_common.SPEC_PositionerMnemonics object>, <spec_common.SPEC_Positioners object>, <spec_common.SPEC_HKL object>, <spec_common.SPEC_UserResults object>, <spec_common.SPEC_CountTime object>, <spec_common.SPEC_UserReserved object>, <spec_common.SPEC_TemperatureSetPoint object>, <spec_common.SPEC_DataLine object>, <spec_common.SPEC_MCA object>, <spec_common.SPEC_MCA_Array object>, <spec_common.SPEC_MCA_Calibration object>, <spec_common.SPEC_MCA_ChannelInformation object>, <spec_common.SPEC_MCA_CountTime object>, <spec_common.SPEC_MCA_RegionOfInterest object>, <XPCS.XPCS_VA object>, <XPCS.XPCS_VD object>, <XPCS.XPCS_VE object>, <XPCS.XPCS_XPCS object>, <XPCS.XPCS_CCD object>, <spec2nexus.plugins.uim.UIM_generic object>, <spec2nexus.plugins.apstools_specwriter.MD_apstools object>, <spec2nexus.plugins.XPCS.XPCS_VA object>, <spec2nexus.plugins.XPCS.XPCS_VD object>, <spec2nexus.plugins.XPCS.XPCS_VE object>, <spec2nexus.plugins.XPCS.XPCS_XPCS object>, <spec2nexus.plugins.XPCS.XPCS_CCD object>, <spec2nexus.plugins.fallback.UnrecognizedControlLine object>, <spec2nexus.plugins.spec_common.SPEC_File object>, <spec2nexus.plugins.spec_common.SPEC_Epoch object>, <spec2nexus.plugins.spec_common.SPEC_Date object>, <spec2nexus.plugins.spec_common.SPEC_Comment object>, <spec2nexus.plugins.spec_common.SPEC_Scan object>, <spec2nexus.plugins.spec_common.SPEC_Geometry object>, <spec2nexus.plugins.spec_common.SPEC_NormalizingFactor object>, <spec2nexus.plugins.spec_common.SPEC_CounterNames object>, <spec2nexus.plugins.spec_common.SPEC_CounterMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Labels object>, <spec2nexus.plugins.spec_common.SPEC_Monitor object>, <spec2nexus.plugins.spec_common.SPEC_NumColumns object>, <spec2nexus.plugins.spec_common.SPEC_PositionerNames object>, <spec2nexus.plugins.spec_common.SPEC_PositionerMnemonics object>, <spec2nexus.plugins.spec_common.SPEC_Positioners object>, <spec2nexus.plugins.spec_common.SPEC_HKL object>, <spec2nexus.plugins.spec_common.SPEC_UserResults object>, <spec2nexus.plugins.spec_common.SPEC_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_UserReserved object>, <spec2nexus.plugins.spec_common.SPEC_TemperatureSetPoint object>, <spec2nexus.plugins.spec_common.SPEC_DataLine object>, <spec2nexus.plugins.spec_common.SPEC_MCA object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Array object>, <spec2nexus.plugins.spec_common.SPEC_MCA_Calibration object>, <spec2nexus.plugins.spec_common.SPEC_MCA_ChannelInformation object>, <spec2nexus.plugins.spec_common.SPEC_MCA_CountTime object>, <spec2nexus.plugins.spec_common.SPEC_MCA_RegionOfInterest object>]#
postprocess(header, *args, **kws)#

optional: More processing deferred until after data file has been read.

process(text, sdf_object, *args, **kws)[source]#

required: Handle this line from a SPEC data file.

PARAMETERS

text str:

?raw text?

spec_obj obj:

Instance of SpecDataFile, SpecDataFileHeader, or SpecDataFileScan

scan_attributes_defined = ['R']#
writer(h5parent, writer, sdf_object, *args, **kws)[source]#

Describe how to store this data in an HDF5 NeXus file

spec2nexus.plugins.spec_common.combine_split_NM_lines(nm, data_lines)[source]#

combine split lines of data

#N N [M]

Indicates there are N columns of data. If M is present, it indicates there are M sets of data columns on each line.

spec2nexus.plugins.spec_common.counter_xref_postprocessing(header)[source]#
spec2nexus.plugins.spec_common.data_lines_postprocessing(scan)[source]#

interpret the data lines from the body of the scan

Parameters:

scan (SpecDataFileScan) – data from a single SPEC scan

spec2nexus.plugins.spec_common.data_lines_writer(h5parent, writer, scan, *args, **kws)[source]#

Describe how to store scan data in an HDF5 NeXus file

spec2nexus.plugins.spec_common.positioner_xref_postprocessing(header)[source]#