Open main menu

Changes

→‎Create data files for relax: Converted the 1_prepare_data.py script to be Python 3 compatible.
{{collapsible script
| type = Python 2 /3 script
| title = The <code>1_prepare_data.py</code> script.
| lang = python
# Loop over the experiments, collect all data
for field in fields:
print ("\n%s", % field)
# Make a dic inside
all_data['%s'%field]['np_%s'%file_name] = file_name_path_data_np
print ("%s %s" % (file_name, file_name_path_data_np.shape))
# Collect residues
RFfields = all_data['%s'%field]['np_RFfields'][0]
print ("\nfield: %3.3f"%field)
for i, RF_field_strength_kHz in enumerate(RFfields):
#print ("RF_field_strength_kHz: %3.3f"%RF_field_strength_kHz)
# Generate file name
f_name = "sfrq_%i_MHz_RFfield_%1.3f_kHz.in"%(field, RF_field_strength_kHz)
cur_file = open(f_name, "w")
cur_file.write("# resi rate rate_err\n")
exp_string = "%11.7f %11.7f %s\n"%(field, RF_field_strength_kHz, f_name) print (exp_string,)
f_exp.write(exp_string)
Trusted, Bureaucrats
4,228

edits