Author: tlinnet Date: Wed Jul 30 12:53:02 2014 New Revision: 24826 URL: http://svn.gna.org/viewcvs/relax?rev=24826&view=rev Log: Removed unused plotting 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=24826&r1=24825&r2=24826&view=diff ============================================================================== --- branches/r1rho_plotting/specific_analyses/relax_disp/data.py (original) +++ branches/r1rho_plotting/specific_analyses/relax_disp/data.py Wed Jul 30 12:53:02 2014 @@ -1834,125 +1834,6 @@ else: file_name = expanduser(file_name) chmod(file_name, S_IRWXU|S_IRGRP|S_IROTH) - - -def plot_disp_curves_disp(file_name_ini=None, dir=None, num_points=None, extend_hz=None, force=None, proton_mmq_flag=None): - """Custom 2D Grace plotting function for the dispersion curves, looping over dispersion points. - - One file will be created per spin system. - - @keyword file_name_ini: The first part of the file_name. - @type file_name_ini: str - @keyword dir: The optional directory to place the file into. - @type dir: str - @keyword num_points: The number of points to generate the interpolated fitted curves with. - @type num_points: int - @keyword extend_hz: How far to extend the interpolated fitted curves to (in Hz). - @type extend_hz: float - @param force: Boolean argument which if True causes the files to be overwritten if it already exists. - @type force: bool - @keyword proton_mmq_flag: The flag specifying if proton SQ or MQ CPMG data exists for the spin. - @type proton_mmq_flag: bool - """ - - # Loop over each spin. Initialise spin counter. - si = 0 - for spin, mol_name, res_num, res_name, spin_id in spin_loop(full_info=True, return_id=True, skip_desel=True): - # Skip protons for MMQ data. - if spin.model in MODEL_LIST_MMQ and spin.isotope == '1H': - continue - - # Initialise some data structures. - data = [] - set_labels = [] - x_err_flag = False - y_err_flag = False - axis_labels = [] - set_colours = [] - x_axis_type_zero = [] - symbols = [] - symbol_sizes = [] - linetype = [] - linestyle = [] - - # The unique file name. - file_name = "%s%s.agr" % (file_name_ini, spin_id.replace('#', '_').replace(':', '_').replace('@', '_')) - - # Set up the interpolated curve data structures. - interpolated_flag = False - if not spin.model in [MODEL_R2EFF]: - # Interpolate through disp points. - interpolated_flag, back_calc, cpmg_frqs_new, spin_lock_nu1_new, chemical_shifts, spin_lock_fields_inter, offsets_inter, tilt_angles_inter, Delta_omega_inter, w_eff_inter = interpolate_disp(spin=spin, spin_id=spin_id, si=si, num_points=num_points, extend_hz=extend_hz) - - else: - back_calc = None - cpmg_frqs_new = None - spin_lock_nu1_new = None - - # Open the file for writing. - file_path = get_file_path(file_name, dir) - file = open_write_file(file_name, dir, force) - - # Get the attached proton. - proton = None - if proton_mmq_flag: - proton = return_attached_protons(spin_id)[0] - - # Loop over each experiment type. - graph_index = 0 - for exp_type, ei in loop_exp(return_indices=True): - # Update the structures. - data.append([]) - set_labels.append([]) - set_colours.append([]) - x_axis_type_zero.append([]) - symbols.append([]) - symbol_sizes.append([]) - linetype.append([]) - linestyle.append([]) - - # Alias the correct spin. - current_spin = spin - if exp_type in [EXP_TYPE_CPMG_PROTON_SQ, EXP_TYPE_CPMG_PROTON_MQ]: - current_spin = proton - - # Loop over the spectrometer frequencies and offsets. - err, data, set_labels, set_colours, x_axis_type_zero, symbols, symbol_sizes, linetype, linestyle, axis_labels = return_grace_data_r2eff_as_func_of_cpmg_frq_or_r1rho_as_func_of_spin_lock_nu1(exp_type=exp_type, ei=ei, current_spin=current_spin, back_calc=back_calc, cpmg_frqs_new=cpmg_frqs_new, spin_lock_nu1_new=spin_lock_nu1_new, interpolated_flag=interpolated_flag, graph_index=graph_index, data=data, set_labels=set_labels, set_colours=set_colours, x_axis_type_zero=x_axis_type_zero, symbols=symbols, symbol_sizes=symbol_sizes, linetype=linetype, linestyle=linestyle, axis_labels=axis_labels) - - # Increment the graph index. - graph_index += 1 - - # Remove all NaN values. - for i in range(len(data)): - for j in range(len(data[i])): - for k in range(len(data[i][j])): - for l in range(len(data[i][j][k])): - if isNaN(data[i][j][k][l]): - data[i][j][k][l] = 0.0 - - # Write the header. - spin_string = generate_spin_string(spin=spin, mol_name=mol_name, res_num=res_num, res_name=res_name) - title = "Relaxation dispersion plot for: %s"%(spin_string) - graph_num = len(data) - sets = [] - legend = [] - for gi in range(len(data)): - sets.append(len(data[gi])) - legend.append(False) - legend[0] = True - write_xy_header(file=file, title=title, graph_num=graph_num, sets=sets, set_names=set_labels, set_colours=set_colours, x_axis_type_zero=x_axis_type_zero, symbols=symbols, symbol_sizes=symbol_sizes, linetype=linetype, linestyle=linestyle, axis_labels=axis_labels, legend=legend, legend_box_fill_pattern=[0]*graph_num, legend_char_size=[0.8]*graph_num) - - # Write the data. - graph_type = 'xy' - if err: - graph_type = 'xydy' - write_xy_data(data, file=file, graph_type=graph_type) - - # Close the file. - file.close() - - # Add the file to the results file list. - add_result_file(type='grace', label='Grace', file=file_path) def plot_disp_curves_to_file(file_name_ini=None, dir=None, y_axis=None, x_axis=None, interpolate=None, num_points=None, extend_hz=None, extend_ppm=None, force=None, proton_mmq_flag=None):