Author: tlinnet Date: Wed Jul 30 13:30:31 2014 New Revision: 24831 URL: http://svn.gna.org/viewcvs/relax?rev=24831&view=rev Log: Removed un-used return_grace_data..() function. sr #3124(https://gna.org/support/?3124): Grace graphs production for R1rho analysis with R2_eff as function of Omega_eff. sr #3138(https://gna.org/support/?3138): Interpolating theta through spin-lock offset [Omega], rather than spin-lock field strength [w1]. Modified: branches/r1rho_plotting/specific_analyses/relax_disp/data.py Modified: branches/r1rho_plotting/specific_analyses/relax_disp/data.py URL: http://svn.gna.org/viewcvs/relax/branches/r1rho_plotting/specific_analyses/relax_disp/data.py?rev=24831&r1=24830&r2=24831&view=diff ============================================================================== --- branches/r1rho_plotting/specific_analyses/relax_disp/data.py (original) +++ branches/r1rho_plotting/specific_analyses/relax_disp/data.py Wed Jul 30 13:30:31 2014 @@ -3256,255 +3256,6 @@ return err, data, set_labels, set_colours, x_axis_type_zero, symbols, symbol_sizes, linetype, linestyle, axis_labels -def return_grace_data_r2eff_as_func_of_cpmg_frq_or_r1rho_as_func_of_spin_lock_nu1(exp_type=None, ei=None, current_spin=None, back_calc=None, cpmg_frqs_new=None, spin_lock_nu1_new=None, interpolated_flag=None, graph_index=None, data=None, set_labels=None, set_colours=None, x_axis_type_zero=None, symbols=None, symbol_sizes=None, linetype=None, linestyle=None, axis_labels=None): - """Loop function over the spectrometer frequencies and offsets for 2D Grace plotting function. - - @keyword exp_type: The experiment type. - @type exp_type: str - @keyword ei: The experiment type index. - @type ei: int - @keyword current_spin: The specific spin data container. - @type current_spin: SpinContainer instance. - @keyword back_calc: The back calculated data. The first index corresponds to the experiment type, the second is the spin of the cluster, the third is the magnetic field strength, and the fourth is the dispersion point. - @type back_calc: list of lists of lists of lists of float - @keyword cpmg_frqs_new: The interpolated CPMG frequencies in Hertz. The dimensions are {Ei, Mi, Oi}. - @type cpmg_frqs_new: rank-3 list of floats - @keyword spin_lock_nu1_new: The interpolated spin-lock field strengths in Hertz. The dimensions are {Ei, Mi, Oi}. - @type spin_lock_nu1_new: rank-3 list of floats - @keyword interpolated_flag: Flag telling if the graph should be interpolated. - @type interpolated_flag: bool - @keyword graph_index: Graph index for xmgrace. - @type graph_index: int - @keyword data: The 4D structure of numerical data to graph (see docstring). - @type data: list of lists of lists of float - @keyword set_labels: Data labels to be used per experiment. - @type set_labels: list of list of strings - @keyword set_colours: The colours for each graph data set Gx.Sy. The first dimension is the graph, the second is the set. - @type set_colours: None or list of list of int - @keyword x_axis_type_zero: The flags specifying if the X-axis should be placed at zero. - @type x_axis_type_zero: list of lists of bool - @keyword symbols: The symbol style for each graph data set Gx.Sy. The first dimension is the graph, the second is the set. - @type symbols: list of list of int - @keyword symbol_sizes: The symbol size for each graph data set Gx.Sy. The first dimension is the graph, the second is the set. - @type symbol_sizes: list of list of int - @keyword linetype: The line type for each graph data set Gx.Sy. The first dimension is the graph, the second is the set. - @type linetype: list of list of int - @keyword linestyle: The line style for each graph data set Gx.Sy. The first dimension is the graph, the second is the set. - @type linestyle: list of list of int - @keyword axis_labels: The labels for the axes (in the [X, Y] list format). The first dimension is the graph. - @type axis_labels: list of list of str - @return: The xy graph or xydy error graph, the 4D structure of numerical data to grace graph, the names associated with each graph data set Gx.Sy, the colours for each graph data set Gx.Sy, flags specifying if the X-axis should be placed at zero, the symbol style for each graph data set Gx.Sy, the symbol size for each graph data set Gx.Sy, the line type for each graph data set Gx.Sy, the line style for each graph data set Gx.Sy, the labels for the axes (in the [X, Y] list format). - @rtype: boolean, list of lists of lists of float, list of list of str, list of list of int, list of lists of bool, list of list of int, list of list of int, list of list of int, list of list of int, list of list of str - """ - - set_index = 0 - err = False - colour_index = 0 - - for frq, offset, mi, oi in loop_frq_offset(exp_type=exp_type, return_indices=True): - # Add a new set for the data at each frequency and offset. - data[graph_index].append([]) - - # Add a new label. - if exp_type in EXP_TYPE_LIST_CPMG: - label = "R\\s2eff\\N" - else: - label = "R\\s1\\xr\\B\\N" - if offset != None and frq != None: - label += " (%.1f MHz, %.3f ppm)" % (frq / 1e6, offset) - elif frq != None: - label += " (%.1f MHz)" % (frq / 1e6) - elif offset != None: - label += " (%.3f ppm)" % (offset) - set_labels[ei].append(label) - - # The other settings. - set_colours[graph_index].append(COLOUR_ORDER[colour_index]) - x_axis_type_zero[graph_index].append(True) - symbols[graph_index].append(1) - symbol_sizes[graph_index].append(0.45) - linetype[graph_index].append(0) - linestyle[graph_index].append(0) - - # Loop over the dispersion points. - for point, di in loop_point(exp_type=exp_type, frq=frq, offset=offset, return_indices=True): - # The data key. - key = return_param_key_from_data(exp_type=exp_type, frq=frq, offset=offset, point=point) - - # No data present. - if key not in current_spin.r2eff: - continue - - # Add the data. - data[graph_index][set_index].append([point, current_spin.r2eff[key]]) - - # Add the error. - if hasattr(current_spin, 'r2eff_err') and key in current_spin.r2eff_err: - err = True - data[graph_index][set_index][-1].append(current_spin.r2eff_err[key]) - - # Increment the graph set index. - set_index += 1 - colour_index += 1 - - # Add the back calculated data. - colour_index = 0 - for frq, offset, mi, oi in loop_frq_offset(exp_type=exp_type, return_indices=True): - # Add a new set for the data at each frequency and offset. - data[graph_index].append([]) - - # Add a new label. - if exp_type in EXP_TYPE_LIST_CPMG: - label = "Back calculated R\\s2eff\\N" - else: - label = "Back calculated R\\s1\\xr\\B\\N" - if offset != None and frq != None: - label += " (%.1f MHz, %.3f ppm)" % (frq / 1e6, offset) - elif frq != None: - label += " (%.1f MHz)" % (frq / 1e6) - elif offset != None: - label += " (%.3f ppm)" % (offset) - set_labels[ei].append(label) - - # The other settings. - set_colours[graph_index].append(COLOUR_ORDER[colour_index]) - x_axis_type_zero[graph_index].append(True) - symbols[graph_index].append(4) - symbol_sizes[graph_index].append(0.45) - linetype[graph_index].append(1) - if interpolated_flag: - linestyle[graph_index].append(2) - else: - linestyle[graph_index].append(1) - - # Loop over the dispersion points. - for point, di in loop_point(exp_type=exp_type, frq=frq, offset=offset, return_indices=True): - # The data key. - key = return_param_key_from_data(exp_type=exp_type, frq=frq, offset=offset, point=point) - - # No data present. - if not hasattr(current_spin, 'r2eff_bc') or key not in current_spin.r2eff_bc: - continue - - # Add the data. - data[graph_index][set_index].append([point, current_spin.r2eff_bc[key]]) - - # Handle the errors. - if err: - data[graph_index][set_index][-1].append(None) - - # Increment the graph set index. - set_index += 1 - colour_index += 1 - - # Add the interpolated back calculated data. - if interpolated_flag: - colour_index = 0 - for frq, offset, mi, oi in loop_frq_offset(exp_type=exp_type, return_indices=True): - # Add a new set for the data at each frequency and offset. - data[graph_index].append([]) - - # Add a new label. - if exp_type in EXP_TYPE_LIST_CPMG: - label = "R\\s2eff\\N interpolated curve" - else: - label = "R\\s1\\xr\\B\\N interpolated curve" - if offset != None and frq != None: - label += " (%.1f MHz, %.3f ppm)" % (frq / 1e6, offset) - elif frq != None: - label += " (%.1f MHz)" % (frq / 1e6) - elif offset != None: - label += " (%.3f ppm)" % (offset) - set_labels[ei].append(label) - - # The other settings. - set_colours[graph_index].append(COLOUR_ORDER[colour_index]) - x_axis_type_zero[graph_index].append(True) - if current_spin.model in MODEL_LIST_NUMERIC_CPMG: - symbols[graph_index].append(8) - else: - symbols[graph_index].append(0) - symbol_sizes[graph_index].append(0.20) - linetype[graph_index].append(1) - linestyle[graph_index].append(1) - - # Loop over the dispersion points. - for di in range(len(back_calc[ei][0][mi][oi])): - # Skip invalid points (values of 1e100). - if back_calc[ei][0][mi][oi][di] > 1e50: - continue - - # The X point. - if exp_type in EXP_TYPE_LIST_CPMG: - point = cpmg_frqs_new[ei][mi][oi][di] - else: - point = spin_lock_nu1_new[ei][mi][oi][di] - - # Add the data. - data[graph_index][set_index].append([point, back_calc[ei][0][mi][oi][di]]) - - # Handle the errors. - if err: - data[graph_index][set_index][-1].append(None) - - # Increment the graph set index. - set_index += 1 - colour_index += 1 - - # Add the residuals for statistical comparison. - colour_index = 0 - for frq, offset, mi, oi in loop_frq_offset(exp_type=exp_type, return_indices=True): - # Add a new set for the data at each frequency and offset. - data[graph_index].append([]) - - # Add a new label. - label = "Residuals" - if offset != None and frq != None: - label += " (%.1f MHz, %.3f ppm)" % (frq / 1e6, offset) - elif frq != None: - label += " (%.1f MHz)" % (frq / 1e6) - elif offset != None: - label += " (%.3f ppm)" % (offset) - set_labels[ei].append(label) - - # The other settings. - set_colours[graph_index].append(COLOUR_ORDER[colour_index]) - x_axis_type_zero[graph_index].append(True) - symbols[graph_index].append(9) - symbol_sizes[graph_index].append(0.45) - linetype[graph_index].append(1) - linestyle[graph_index].append(3) - - # Loop over the dispersion points. - for point, di in loop_point(exp_type=exp_type, frq=frq, offset=offset, return_indices=True): - # The data key. - key = return_param_key_from_data(exp_type=exp_type, frq=frq, offset=offset, point=point) - - # No data present. - if key not in current_spin.r2eff or not hasattr(current_spin, 'r2eff_bc') or key not in current_spin.r2eff_bc: - continue - - # Add the data. - data[graph_index][set_index].append([point, current_spin.r2eff[key] - current_spin.r2eff_bc[key]]) - - # Handle the errors. - if err: - err = True - data[graph_index][set_index][-1].append(current_spin.r2eff_err[key]) - - # Increment the graph set index. - set_index += 1 - colour_index += 1 - - # The axis labels. - if exp_type in EXP_TYPE_LIST_CPMG: - axis_labels.append(['\\qCPMG pulse train frequency (Hz)\\Q', '%s - \\qR\\s2,eff\\N\\Q (rad.s\\S-1\\N)'%exp_type]) - else: - axis_labels.append(['\\qSpin-lock field strength (Hz)\\Q', '\\qR\\s1\\xr\\B\\N\\Q (rad.s\\S-1\\N)']) - - return err, data, set_labels, set_colours, x_axis_type_zero, symbols, symbol_sizes, linetype, linestyle, axis_labels - - def return_index_from_disp_point(value, exp_type=None): """Convert the dispersion point data into the corresponding index.