Can now change the number of acquired points. This, with the ability to change the acquisition length, allows one to control dwell time indirectly
This commit is contained in:
@@ -194,7 +194,7 @@ def get_delay_header(col_delays, tuning_number):
|
||||
headerstr += Z*56
|
||||
return headerstr
|
||||
|
||||
def get_event_header(event_type, vals, tables, table_reg, tuning_number, col_delays):
|
||||
def get_event_header(event_type, vals, tables, table_reg, tuning_number, col_delays, num_acq_points):
|
||||
'''Generates the file information for the events section. This should come after the delay header (see get_delay_header())
|
||||
|
||||
Params
|
||||
@@ -225,7 +225,7 @@ def get_event_header(event_type, vals, tables, table_reg, tuning_number, col_del
|
||||
for i in range(len(vals)):
|
||||
headerstr += fm(str(vals[i]))
|
||||
if(event_type == 'Acq' and str(vals[i]) == '1'):
|
||||
acq_points = 1024
|
||||
acq_points = num_acq_points
|
||||
acq_time = col_delays[i]
|
||||
if('u' in acq_time):
|
||||
acq_time = float(acq_time.strip()[:-1])
|
||||
@@ -300,6 +300,7 @@ def generate_default_sequence(col_names, col_delays):
|
||||
sub_dict[e] = { 'value': str(event_defaults[e]), 'table': '' }
|
||||
sub_dict['Delay'] = delay
|
||||
full_dict['columns'][c] = sub_dict.copy()
|
||||
full_dict['num_acq_points'] = 1024
|
||||
return full_dict
|
||||
|
||||
def create_sequence_file(filename, data, author='NA'):
|
||||
@@ -308,7 +309,14 @@ def create_sequence_file(filename, data, author='NA'):
|
||||
Parameters
|
||||
----------
|
||||
filename: str, where to write this.
|
||||
data: a dictionary in the form { 'columns': { [column_name_0]: { 'F1_Ampl': [value], ..., 'Rx_Blank': [value], 'Delay': [value] }, ... }, 'tables': { 'table_1': {...}, ... } }. If any sub-entries are empty, they will be given default values (requires that all event_types are present). See event_types and event_defaults. This is best generated using generate_default_sequence and then modifying the given sequence.
|
||||
data: a dictionary in the form { 'columns': {
|
||||
[column_name_0]: {
|
||||
'F1_Ampl': [value], ..., 'Rx_Blank': [value], 'Delay': [value] }
|
||||
, ... },
|
||||
'tables': {
|
||||
'table_1': {...}, ... } ,
|
||||
'num_acq_points': [integer]
|
||||
}. Any column with Acq enabled should also have a field "num_acq_points". If any sub-entries are empty, they will be given default values (requires that all event_types are present). See event_types and event_defaults. This is best generated using generate_default_sequence and then modifying the given sequence.
|
||||
author [optional]: str to describe the file creator.
|
||||
'''
|
||||
content = ''
|
||||
@@ -328,7 +336,7 @@ def create_sequence_file(filename, data, author='NA'):
|
||||
for i in column_names:
|
||||
evnt_data_values += [ str(data['columns'][i][evnt]['value']) ]
|
||||
evnt_data_tables += [ data['columns'][i][evnt]['table'] ]
|
||||
content += get_event_header(evnt, evnt_data_values, evnt_data_tables, data['tables'], tuning_number, column_delays)
|
||||
content += get_event_header(evnt, evnt_data_values, evnt_data_tables, data['tables'], tuning_number, column_delays, data['num_acq_points'])
|
||||
|
||||
content += ' '
|
||||
content += get_table_spec(data['tables'])
|
||||
|
||||
Reference in New Issue
Block a user