コード例 #1
0
    def getMetadataObject(self, node):
        iMetadata = LConfigDataset()

        _peak_min = self.getNodeValue(node, 'from_peak_pixels')
        _peak_max = self.getNodeValue(node, 'to_peak_pixels')
        iMetadata.data_peak = [_peak_min, _peak_max]

        _back_min = self.getNodeValue(node, 'back_roi1_from')
        _back_max = self.getNodeValue(node, 'back_roi1_to')
        iMetadata.data_back = [_back_min, _back_max]

        _low_res_min = self.getNodeValue(node, 'x_min_pixel')
        _low_res_max = self.getNodeValue(node, 'x_max_pixel')
        iMetadata.data_low_res = [_low_res_min, _low_res_max]

        _back_flag = self.getNodeValue(node, 'background_flag')
        iMetadata.data_back_flag = _back_flag

        _low_res_flag = self.getNodeValue(node, 'x_range_flag')
        iMetadata.data_low_res_flag = _low_res_flag

        _clocking_min = self.getNodeValue(node, 'clocking_from')
        _clocking_max = self.getNodeValue(node, 'clocking_to')
        iMetadata.data_clocking = [_clocking_min, _clocking_max]

        _tof_min = self.getNodeValue(node, 'from_tof_range')
        _tof_max = self.getNodeValue(node, 'to_tof_range')
        if float(_tof_min) < 500:  # ms
            _tof_min = str(float(_tof_min) * 1000)
            _tof_max = str(float(_tof_max) * 1000)
        iMetadata.tof_range = [_tof_min, _tof_max]

        _q_min = self.getNodeValue(node, 'from_q_range')
        _q_max = self.getNodeValue(node, 'to_q_range')
        iMetadata.q_range = [_q_min, _q_max]

        _lambda_min = self.getNodeValue(node, 'from_lambda_range')
        _lambda_max = self.getNodeValue(node, 'to_lambda_range')
        iMetadata.lambda_range = [_lambda_min, _lambda_max]

        iMetadata.tof_units = 'micros'

        _data_sets = self.getNodeValue(node, 'data_sets')
        _data_sets = _data_sets.split(',')
        iMetadata.data_sets = [str(x) for x in _data_sets]

        _tof_auto = self.getNodeValue(node, 'tof_range_flag')
        iMetadata.tof_auto_flag = _tof_auto

        _norm_flag = self.getNodeValue(node, 'norm_flag')
        iMetadata.norm_flag = _norm_flag

        _peak_min = self.getNodeValue(node, 'norm_from_peak_pixels')
        _peak_max = self.getNodeValue(node, 'norm_to_peak_pixels')
        iMetadata.norm_peak = [_peak_min, _peak_max]

        _back_min = self.getNodeValue(node, 'norm_from_back_pixels')
        _back_max = self.getNodeValue(node, 'norm_to_back_pixels')
        iMetadata.norm_back = [_back_min, _back_max]

        _norm_sets = self.getNodeValue(node, 'norm_dataset')
        _norm_sets = _norm_sets.split(',')
        iMetadata.norm_sets = [str(x) for x in _norm_sets]

        _low_res_min = self.getNodeValue(node, 'norm_x_min')
        _low_res_max = self.getNodeValue(node, 'norm_x_max')
        iMetadata.norm_low_res = [_low_res_min, _low_res_max]

        _back_flag = self.getNodeValue(node, 'norm_background_flag')
        iMetadata.norm_back_flag = _back_flag

        _low_res_flag = self.getNodeValue(node, 'norm_x_range_flag')
        iMetadata.norm_low_res_flag = _low_res_flag

        try:
            _data_full_file_name = self.getNodeValue(node,
                                                     'data_full_file_name')
            _data_full_file_name = _data_full_file_name.split(',')
            _data_full_file_name = [str(x) for x in _data_full_file_name]
        except:
            _data_full_file_name = ['']
        iMetadata.data_full_file_name = _data_full_file_name

        try:
            _norm_full_file_name = self.getNodeValue(node,
                                                     'norm_full_file_name')
            _norm_full_file_name = _norm_full_file_name.split(',')
            _norm_full_fil_name = [str(x) for x in _norm_full_file_name]
        except:
            _norm_full_file_name = ['']
        iMetadata.norm_full_file_name = _norm_full_file_name

        return iMetadata
コード例 #2
0
	def getMetadataObject(parent, node):
		iMetadata = LConfigDataset()
		
		_peak_min = parent.getNodeValue(node, 'from_peak_pixels')
		_peak_max = parent.getNodeValue(node, 'to_peak_pixels')
		iMetadata.data_peak = [_peak_min, _peak_max]
		
		_back_min = parent.getNodeValue(node, 'back_roi1_from')
		_back_max = parent.getNodeValue(node, 'back_roi1_to')
		iMetadata.data_back = [_back_min, _back_max]
		
		_low_res_min = parent.getNodeValue(node, 'x_min_pixel')
		_low_res_max = parent.getNodeValue(node, 'x_max_pixel')
		iMetadata.data_low_res = [_low_res_min, _low_res_max]
		
		_back_flag = parent.getNodeValue(node, 'background_flag')
		iMetadata.data_back_flag = _back_flag
		
		_low_res_flag = parent.getNodeValue(node, 'x_range_flag')
		iMetadata.data_low_res_flag = _low_res_flag
		
		_clocking_min = parent.getNodeValue(node, 'clocking_from')
		_clocking_max = parent.getNodeValue(node, 'clocking_to')
		iMetadata.data_clocking = [_clocking_min, _clocking_max]
		
		_tof_min = parent.getNodeValue(node, 'from_tof_range')
		_tof_max = parent.getNodeValue(node, 'to_tof_range')
		if float(_tof_min) < 500:  # ms
			_tof_min = str(float(_tof_min) * 1000)
			_tof_max = str(float(_tof_max) * 1000)
		iMetadata.tof_range = [_tof_min, _tof_max]
		
		_q_min = parent.getNodeValue(node, 'from_q_range')
		_q_max = parent.getNodeValue(node, 'to_q_range')
		iMetadata.q_range = [_q_min, _q_max]
		
		_lambda_min = parent.getNodeValue(node, 'from_lambda_range')
		_lambda_max = parent.getNodeValue(node, 'to_lambda_range')
		iMetadata.lambda_range = [_lambda_min, _lambda_max]
		
		iMetadata.tof_units = 'micros'
		
		_data_sets = parent.getNodeValue(node, 'data_sets')
		_data_sets = _data_sets.split(',')
		iMetadata.data_sets = [str(x) for x in _data_sets]
		
		_tof_auto = parent.getNodeValue(node, 'tof_range_flag')
		iMetadata.tof_auto_flag = _tof_auto
		
		_norm_flag = parent.getNodeValue(node, 'norm_flag')
		iMetadata.norm_flag = _norm_flag
		
		_peak_min = parent.getNodeValue(node, 'norm_from_peak_pixels')
		_peak_max = parent.getNodeValue(node, 'norm_to_peak_pixels')
		iMetadata.norm_peak = [_peak_min, _peak_max]
		
		_back_min = parent.getNodeValue(node, 'norm_from_back_pixels')
		_back_max = parent.getNodeValue(node, 'norm_to_back_pixels')
		iMetadata.norm_back = [_back_min, _back_max]
		
		_norm_sets = parent.getNodeValue(node, 'norm_dataset')
		_norm_sets = _norm_sets.split(',')
		iMetadata.norm_sets = [str(x) for x in _norm_sets]
	    
		_low_res_min = parent.getNodeValue(node, 'norm_x_min')
		_low_res_max = parent.getNodeValue(node, 'norm_x_max')
		iMetadata.norm_low_res = [_low_res_min, _low_res_max]
	    
		_back_flag = parent.getNodeValue(node, 'norm_background_flag')
		iMetadata.norm_back_flag = _back_flag
		
		_low_res_flag = parent.getNodeValue(node, 'norm_x_range_flag')
		iMetadata.norm_low_res_flag = _low_res_flag
		
		try:
			_data_full_file_name = parent.getNodeValue(node, 'data_full_file_name')
			_data_full_file_name = _data_full_file_name.split(',')
			_data_full_file_name = [str(x) for x in _data_full_file_name]
		except:
			_data_full_file_name = ['']
		iMetadata.data_full_file_name = _data_full_file_name
			
		try:
			_norm_full_file_name = parent.getNodeValue(node, 'norm_full_file_name')
			_norm_full_file_name = _norm_full_file_name.split(',')
			_norm_full_fil_name = [str(x) for x in _norm_full_file_name]
		except:
			_norm_full_file_name = ['']
		iMetadata.norm_full_file_name = _norm_full_file_name
	    
		return iMetadata