unumpy.nominal_values(Trendline_all),
                     label='Trend line: Including errors',
                     linestyle=':')
        dz.data_plot(x_Red,
                     unumpy.nominal_values(y_Red),
                     label='Red arm emission lines',
                     markerstyle='o',
                     y_error=unumpy.std_devs(y_Red))
        dz.data_plot(x_BlueRed,
                     unumpy.nominal_values(y_NoError_trend),
                     label='Trend line: Without including error',
                     linestyle='--')

        dz.text_plot(EmLine_blue,
                     x_Blue,
                     unumpy.nominal_values(y_Blue),
                     x_pad=0.95,
                     y_pad=1.10,
                     fontsize=10)
        dz.text_plot(EmLine_Red,
                     x_Red,
                     unumpy.nominal_values(y_Red),
                     x_pad=0.95,
                     y_pad=1.10,
                     fontsize=10)
        #Plot the data
        #Points not used for the treatment
        #         d.TextPlotter(x_outbound,  unumpy.nominal_values(y_outbound), EmLine_outBound, x_pad = 0.95, y_pad = 1)
        dz.text_plot(EmLine_outBound,
                     x_outbound,
                     unumpy.nominal_values(y_outbound),
                     fontsize=10)
            cHbeta_all_MagEr, n_all_MagEr                   = LinfitLinearRegression(x_BlueRed, y_BlueRed)            
            cHbeta_NoError, n_NoError                       = NumpyRegression(x_BlueRed, unumpy.nominal_values(y_BlueRed))            
            
            #Trendline with all points and error
            Trendline_all                                   = cHbeta_all_MagEr * x_BlueRed + n_all_MagEr
        
        #Trendline for he case we do not consider the error
        y_NoError_trend                                     = cHbeta_NoError * x_BlueRed + n_NoError
         
        #Plot the data
        dz.data_plot(x_Blue,        unumpy.nominal_values(y_Blue), label='Blue arm emission lines', markerstyle='^', y_error=unumpy.std_devs(y_Blue))        
        dz.data_plot(x_BlueRed,     unumpy.nominal_values(Trendline_all),   label='Trend line: Including errors',  linestyle=':')
        dz.data_plot(x_Red,         unumpy.nominal_values(y_Red),  label='Red arm emission lines', markerstyle='o', y_error=unumpy.std_devs(y_Red))       
        dz.data_plot(x_BlueRed,     unumpy.nominal_values(y_NoError_trend), label='Trend line: Without including error', linestyle='--')
        
        dz.text_plot(EmLine_blue, x_Blue, unumpy.nominal_values(y_Blue), x_pad = 0.95, y_pad = 1.10, fontsize=10)
        dz.text_plot(EmLine_Red, x_Red, unumpy.nominal_values(y_Red), x_pad = 0.95, y_pad = 1.10, fontsize=10)
        #Plot the data
        #Points not used for the treatment
#         d.TextPlotter(x_outbound,  unumpy.nominal_values(y_outbound), EmLine_outBound, x_pad = 0.95, y_pad = 1)
        dz.text_plot(EmLine_outBound, x_outbound, unumpy.nominal_values(y_outbound), fontsize=10)
        #--Blue arm
#         dz.data_plot(x_Blue,   unumpy.nominal_values(y_Blue),                                          'Blue arm',         pv.Color_Vector[2][2],      YError=unumpy.std_devs(y_Blue))        
#         dz.data_plot(x_Blue,   unumpy.nominal_values(cHbeta_blue_MagEr * x_Blue + n_blue_MagEr), label='Trend line blue', linestyle=':')
         
#       #--Red arm

    #Increase the display range
#     dz.Axis.set_ylim(-0.4,0.4)

    #Insert labels and legends    
            g_mags.append(12)
            r_mags.append(12)
            



#------Plot magnitudes

x_values    = array(r_mags)
y_values    = array(g_mags)

dz.Axis.set_xlim(12 , 22)
dz.Axis.set_ylim(12 , 22)

dz.data_plot(x_values, y_values, color = dz.ColorVector[2][0], label='Candidate objects', markerstyle='o')
dz.text_plot(names, x_values, y_values, color = dz.ColorVector[1], fontsize = 11)
dz.Axis.axhline(y = 20, color=dz.ColorVector[2][1])
dz.Axis.axvline(x = 19, color=dz.ColorVector[2][1])

Title   = r'Sample SDSS model magnitudes' 
Title_X = r'r $(model)$'
Title_Y = r'g $(model)$'
dz.FigWording(Title_X, Title_Y, Title, legend_loc='best')
dz.savefig(output_address = Catalogue_Dic['Data_Folder'] + 'g_r_magnitudes', reset_fig = True)


#------Plot magnitudes

x_values    = array(Hbeta_values)
y_values    = array(Declination_values)
    pv.SaveParameter_ObjLog('WHT_Catalogue_properties.txt', Catalogue_Dic['Data_Folder'], Parameter = 'Yp_'+Element+'_Inf',    Magnitude = n_Median, Error = '-', Log_extension='')       
    pv.SaveParameter_ObjLog('WHT_Catalogue_properties.txt', Catalogue_Dic['Data_Folder'], Parameter = 'Yp_'+Element+'_16th_p', Magnitude = n_16th, Error = '-', Log_extension='')       
    pv.SaveParameter_ObjLog('WHT_Catalogue_properties.txt', Catalogue_Dic['Data_Folder'], Parameter = 'Yp_'+Element+'_84th_p', Magnitude = n_84th, Error = '-', Log_extension='')       
    
    pv.SaveParameter_ObjLog('WHT_Catalogue_properties.txt', Catalogue_Dic['Data_Folder'], Parameter = 'Gradient_'+Element+'_Inf',     Magnitude = m_Median, Error = '-', Log_extension='')       
    pv.SaveParameter_ObjLog('WHT_Catalogue_properties.txt', Catalogue_Dic['Data_Folder'], Parameter = 'Gradient_'+Element+'_16th_p',  Magnitude = m_16th, Error = '-', Log_extension='')       
    pv.SaveParameter_ObjLog('WHT_Catalogue_properties.txt', Catalogue_Dic['Data_Folder'], Parameter = 'Gradient_'+Element+'_84th_p',  Magnitude = m_84th, Error = '-', Log_extension='')   

    Obj_Elem, Metal_abun, Ymass_Metal = Abundances_dict[regression][0], Abundances_dict[regression][1], Abundances_dict[regression][2]
    
    #Plotting the data
    element_label = r'$Y_{{P}} = {n}_{{-{lowerlimit}}}^{{+{upperlimit}}}$'.format(n = round(n_Median,4), lowerlimit = round(n_Median-n_16th,4), upperlimit = round(n_84th-n_Median,4))

    dz.data_plot(nominal_values(Metal_abun), nominal_values(Ymass_Metal), color = dz.ColorVector[2][j], label=element_label, markerstyle='o', x_error=std_devs(Metal_abun), y_error=std_devs(Ymass_Metal))
    dz.data_plot(Y_WMAP_coord[0].nominal_value, Y_WMAP_coord[1].nominal_value, color = dz.ColorVector[2][len(Regression_list) + 1], label='WMAP prediction', markerstyle='o', x_error=Y_WMAP_coord[0].std_dev, y_error=Y_WMAP_coord[1].std_dev)
    dz.text_plot(Obj_Elem, nominal_values(Metal_abun), nominal_values(Ymass_Metal), color = dz.ColorVector[1], x_pad = 0.95, y_pad = 1)
        
    #Plot the linear trendlines
    x_regression_range = linspace(0.0, max(Metal_matrix[:,0])*1.10, 20)
    y_regression_range = m_Median * x_regression_range + n_Median    
    label_S = r'Median value: $' + round_sig(n_Median, n=4, scien_notation=False) + '_{-' + round_sig(n_Median - n_16th, n=4, scien_notation=False) + '}^{+' + round_sig(n_84th - n_Median, n=4, scien_notation=False) + '}$'

    dz.data_plot(x_regression_range, y_regression_range, label = 'Linear regression', color = dz.ColorVector[2][j], linestyle = '--')
    dz.FigWording(Titles_wording[regression][2], Titles_wording[regression][3], Titles_wording[regression][1],legend_loc='best')
    
    #Set legends
#     dz.Axis.set_xlim(0.0, x_regression_range[-1]*1.10)
    
    print 'bien'
    
    #Save the data
Exemple #5
0
            r_mags.append(12)

#------Plot magnitudes

x_values = array(r_mags)
y_values = array(g_mags)

dz.Axis.set_xlim(12, 22)
dz.Axis.set_ylim(12, 22)

dz.data_plot(x_values,
             y_values,
             color=dz.ColorVector[2][0],
             label='Candidate objects',
             markerstyle='o')
dz.text_plot(names, x_values, y_values, color=dz.ColorVector[1], fontsize=11)
dz.Axis.axhline(y=20, color=dz.ColorVector[2][1])
dz.Axis.axvline(x=19, color=dz.ColorVector[2][1])

Title = r'Sample SDSS model magnitudes'
Title_X = r'r $(model)$'
Title_Y = r'g $(model)$'
dz.FigWording(Title_X, Title_Y, Title, legend_loc='best')
dz.savefig(output_address=Catalogue_Dic['Data_Folder'] + 'g_r_magnitudes',
           reset_fig=True)

#------Plot magnitudes

x_values = array(Hbeta_values)
y_values = array(Declination_values)