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
    Title = "HII galaxy " + CodeName + " " + r'$c(H\beta)$' + ' coefficient calculation'
    y_Title = r'$log(I/I_{H\beta})_{th}-log(F/F_{H\beta})_{Obs}$'
    x_Title = r'$f(\lambda)-f(\lambda_{H\beta})$'
    dz.FigWording(x_Title, y_Title, Title)

    #Save data
    #         pv.SaveManager(SavingName = pv.ScriptCode + '_' + CodeName + '_IntrinsicReddening', SavingFolder = FileFolder, ForceSave=True)
    #     dz.display_fig()
    dz.savefig(
        '/home/vital/Dropbox/Astrophysics/Papers/Elemental_RegressionsSulfur/Images/'
        + 'SHOC579_cHbeta')

print 'All data treated', pv.display_errors()
示例#2
0
# dz.Axis.set_xscale('log')
dz.Axis.tick_params(axis='both', labelsize=20.0)
dz.Axis.set_ylim(0.0, 2.5)
# dz.Axis.patch.set_facecolor('white')
# dz.Fig.set_facecolor('black')
# dz.Fig.set_edgecolor('black')

#Plot wording
xtitle = r'$n_{e}$ $(cm^{-3})$'
# ytitle  = r'j(T) [erg cm$^{-3}$ s${-1}$]'
ytitle = 'Relative emissivity'
title = 'HeI emissivities @ $T_e$={:.0f}'.format(tem)
dz.FigWording(xtitle,
              ytitle,
              title,
              axis_Size=20.0,
              title_Size=20.0,
              legend_size=20.0)

#Display figure
# dz.display_fig()
dz.savefig(
    '/home/vital/Dropbox/Astrophysics/Lore/PopStar_SEDs/SIV_Emissivity_den',
    extension='.png',
    reset_fig=True)

#--------------------------Temperature case----------------------------------
#Plot the lines
for line in S_Lines:
    y = S4.getEmissivity(tem_range, den, wave=line)
    y_1000_100 = S4.getEmissivity(tem, den, wave=line)
#----------------------Plotting abundances
#Perform linear regression
zero_vector  = zeros(len(list_xvalues_clean_greater))
m ,n, m_err, n_err, covab = bces(list_xvalues_clean_greater, zero_vector, list_yvalues_clean_greater, zero_vector, zero_vector)
 
x_regresion         = linspace(0, max(list_xvalues_clean_greater), 50)
y_regression        = m[0] * x_regresion + n[0]
   
LinearRegression_Label = r'Linear fitting'.format(n = round(n[0],2) ,nerr = round(n_err[0],2))
dz.data_plot(x_regresion, y_regression, label=LinearRegression_Label, linestyle='--', color=dz.ColorVector[1])
       
logSII_SIII_theo            = m[0] * logArII_ArIII + n[0]
   
dz.data_plot(nominal_values(logArII_ArIII), nominal_values(logSII_SIII_theo),  color=dz.ColorVector[1], label='Observations', markerstyle='o', x_error=std_devs(logArII_ArIII), y_error=std_devs(logSII_SIII_theo))
          
# #Plot fitting formula
formula = r"$log\left(Ar^{{+2}}/Ar^{{+3}}\right) = {m} \cdot log\left(S^{{+2}}/S^{{+3}}\right) + {n}$".format(m='m', n='n')
formula2 = r"$m = {m} \pm {merror}; n = {n} \pm {nerror}$".format(m=round(m[0],3), merror=round(m_err[0],3), n=round(n[0],3), nerror=round(n_err[0],3))
dz.Axis.text(0.50, 0.15, formula, transform=dz.Axis.transAxes, fontsize=20) 
dz.Axis.text(0.50, 0.08, formula2, transform=dz.Axis.transAxes, fontsize=20) 
  
#Plot wording
xtitle  = r'$log(S^{+2}/S^{+3})$'
ytitle  = r'$log(Ar^{+2}/Ar^{+3})$'
title   = 'Argon - Sulfur ionic relation in Cloudy photoionization models'
dz.FigWording(xtitle, ytitle, title, axis_Size = 20.0, title_Size = 20.0, legend_size=20.0, legend_loc='best')
  
#Display figure
# dz.display_fig()
dz.savefig(output_address = '/home/vital/Dropbox/Astrophysics/Papers/Elemental_RegressionsSulfur/Cloudy_Models/ArIons_vs_SIons_Ionization_Obs')
print 'Data treated'
xtitle = r'$T[SIII] (K)$'
ytitle = r'$log(Ar^{+2}/Ar^{+3})$'

title = r'Argon ionic abundance versus $S^{+2}$ temperature in Cloudy models'
print len(Temps), len(logArII_ArIII)
dz.data_plot(nominal_values(Temps),
             nominal_values(logArII_ArIII),
             color=dz.ColorVector[1],
             label='Observations',
             markerstyle='o',
             x_error=std_devs(Temps),
             y_error=std_devs(logArII_ArIII))
dz.FigWording(xtitle,
              ytitle,
              title,
              axis_Size=20.0,
              title_Size=20.0,
              legend_size=20.0,
              legend_loc='upper right')
'ArIons_vs_TSIII_Obs'

dz.Axis.set_xlim(5000, 20000)

#Display figure
# dz.display_fig()
dz.savefig(
    output_address=
    '/home/vital/Dropbox/Astrophysics/Papers/Elemental_RegressionsSulfur/Cloudy_Models/ArIons_vs_TSIII_Obs'
)

print 'Data treated'
    #     dz.InsertFigure(FileFolder,  CodeName + '.png')

    arr_hand = read_png(FileFolder + CodeName + '.png')
    Image_Frame = OffsetImage(arr_hand, zoom=3)
    ab = AnnotationBbox(Image_Frame, [0.865, 0.8],
                        xybox=(10, -10),
                        xycoords='figure fraction',
                        boxcoords="offset points")
    dz.Axis.add_artist(ab)

    dz.Axis.set_xlim(3600.0, 3900)
    dz.Axis.set_ylim(0, 1e-15)
    #Set plot labels
    title = r'SHOC579 spectrum components$'
    dz.FigWording(r'Wavelength $(\AA)$',
                  'Flux' + r'$(erg\,cm^{-2} s^{-1} \AA^{-1})$', title)

    #Display figure
    #     dz.display_fig()
    dz.savefig(
        '/home/vital/Dropbox/Astrophysics/Papers/Elemental_RegressionsSulfur/Images/'
        + 'SHOC579_spectralComponents',
        extension='.png')

# #---------------------Zanstra calibration------------------------------
#
# pv                      = myPickle()
# dz                      = Plot_Conf()
# nebCalc                 = NebularContinuumCalculator()
# nebCalc.DataRoot        = '/home/vital/Dropbox/Astrophysics/Lore/NebularContinuum/'
#
示例#6
0
Lineal_parameters = lineal_mod.guess(y_linealFitting, x=x_linealFitting)
x_lineal = linspace(0, np_max(x_linealFitting), 100)
y_lineal = Lineal_parameters[
    'lineal_slope'].value * x_lineal + Lineal_parameters[
        'lineal_intercept'].value
dz.data_plot(x_lineal,
             y_lineal,
             label='Linear fitting',
             color='black',
             linestyle='-')

# #Plot fitting formula
formula = r"$log\left(Ar^{{+2}}/Ar^{{+3}}\right) = {m} \cdot log\left(S^{{+2}}/S^{{+3}}\right) + {n}$".format(
    m=round(Lineal_parameters['lineal_slope'].value, 3),
    n=round(Lineal_parameters['lineal_intercept'].value, 3))
dz.Axis.text(0.35, 0.15, formula, transform=dz.Axis.transAxes, fontsize=20)

#Plot wording
xtitle = r'$log\left(S^{{+2}}/S^{{+3}}\right)$'
ytitle = r'$log\left(Ar^{{+2}}/Ar^{{+3}}\right)$'
title = 'Argon - Sulfur ionic abundances\nfor a Z, Mass, log(t) cluster grid'
dz.FigWording(xtitle, ytitle, title, loc='upper left')

#Display figure
# dz.display_fig()
dz.savefig(
    output_address=
    '/home/vital/Dropbox/Astrophysics/Data/WHT_observations/data/sulfur_argon_ionicAbundances',
    extension='.png')

print 'Data treated otro'
示例#7
0
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)

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)