cHbeta=cHbeta.nominal_value, R_v=R_v) IntEmi_dered = dz.derreddening_spectrum(Wave_E, Int_E, reddening_curve=red_curve, cHbeta=cHbeta.nominal_value, R_v=R_v) Int_Sum = IntEmi_dered + Int_Stellar_Resampled + Int_N dz.data_plot(Wave_O, IntObs_dered, 'Observed spectrum') dz.data_plot(Wave_N, Int_N, 'Nebular continuum', linestyle=':') dz.data_plot(Wave_S, Int_S, 'Stellar continuum', linestyle='--') dz.insert_image( '/home/vital/Dropbox/Astrophysics/Papers/Yp_AlternativeMethods/images/SHOC579_invert.png', Image_Coordinates=[0.07, 0.875], Zoom=0.25, Image_xyCoords='axes fraction') #Set titles and legend PlotTitle = '' dz.FigWording(r'Wavelength $(\AA)$', 'Flux' + r'$(erg\,cm^{-2} s^{-1} \AA^{-1})$', PlotTitle, loc='upper right') dz.Axis.set_xlim(3550, 10000) axins2 = inset_axes(dz.Axis, width='70%', height='50%', loc=7) #sub_axes = plt.axes([6000.0, 1.2e-14, 3000, 3.75e-14])
axins2.set_ylim(-0.2e-16, 3.0e-16) mark_inset(dz.ax1, axins2, loc1=2, loc2=4, fc="none", ec="0.5") axins.get_xaxis().set_visible(False) axins.get_yaxis().set_visible(False) axins2.get_xaxis().set_visible(False) axins2.get_yaxis().set_visible(False) dz.FigWording('', 'Flux ' + r'$(erg\,cm^{-2} s^{-1} \AA^{-1})$', '', loc='upper left', graph_axis=dz.ax1, sort_legend=True) dz.FigWording(r'Wavelength $(\AA)$', 'Normalized flux', '', loc='lower center', graph_axis=dz.ax2, ncols_leg=4) dz.ax2.set_ylim(0.2,1.25) if 'S3_9531A_continuum' in obj_dict: dz.ax1.set_ylim(-2 * obj_dict['S3_9531A_continuum'], 1.1 * obj_dict['S3_9531A_Peak']) else: dz.ax1.set_ylim(0.005 * mean_flux, 20 * mean_flux) dz.insert_image('/home/vital/Downloads/obj08_SDSS_image_color.png', Image_Coordinates = [0.50,0.80], Zoom=0.25, Image_xyCoords = 'axes fraction', axis_plot=dz.ax1) dz.savefig(image_address, extension='.png') #dz.display_fig() # output_pickle = '{objFolder}{stepCode}_{objCode}_{ext}'.format(objFolder=ouput_folder, stepCode=script_code, objCode=objName, ext='Telluric correction') # dz.save_manager(output_pickle, save_pickle = True) # dz.savefig('/home/vital/Dropbox/Astrophysics/Seminars/Angeles_Seminar/' + '8_telluric_correction', extension='.png')
objName = catalogue_df.iloc[i].name if objName == '8': #Joining pointing joining_wavelength = catalogue_df.iloc[i].join_wavelength #Treat each arm file blue_fits_file = catalogue_df.iloc[i]['zBlue_file'] red_fits_file = catalogue_df.iloc[i]['zRed_file'] CodeName_Blue, FileName_Blue, FileFolder_Blue = dz.Analyze_Address(blue_fits_file) CodeName_Red, FileName_Red, FileFolder_Red = dz.Analyze_Address(red_fits_file) wave_Blue, flux_Blue, ExtraData_Blue = dz.get_spectra_data(blue_fits_file) wave_Red, flux_Red, ExtraData_Red = dz.get_spectra_data(red_fits_file) idx_blue = searchsorted(wave_Blue, joining_wavelength) idx_red = searchsorted(wave_Red, joining_wavelength) wave_comb = concatenate([wave_Blue[0:idx_blue], wave_Red[idx_red:-1]]) flux_comb = concatenate([flux_Blue[0:idx_blue], flux_Red[idx_red:-1]]) dz.data_plot(wave_Blue, flux_Blue, label = 'WHT blue arm') dz.data_plot(wave_Red, flux_Red, label = 'WHT red arm') dz.insert_image('/home/vital/Dropbox/Astrophysics/Seminars/Angeles_Seminar/8.png', Image_Coordinates = [0.85,0.70], Zoom=0.20, Image_xyCoords = 'axes fraction') dz.FigWording(r'Wavelength $(\AA)$', 'Flux ' + r'$(erg\,cm^{-2} s^{-1} \AA^{-1})$', 'HII galaxy: SDSSJ024815.93-081716.5, WHT observation') dz.display_fig() #dz.savefig('/home/vital/Dropbox/Astrophysics/Seminars/Angeles_Seminar/' + '8_WHT', extension='.png')