Пример #1
0
for i in range(len(FilesList)):

    #Load the file
    CodeName, FileName, FileFolder  = dz.Analyze_Address(FilesList[i])
    Wave, Flux, ExtraData           = dz.File_to_data(FileFolder, FileName)

    #Get the emission line location
    Line_label, line_wavelength     = 'N2_6548A', 6548.050
    Line_selections                 = dz.RangesR([], line_wavelength, FileFolder + CodeName + '_WHT_LinesLog_v3.txt')
    print 'selections', Line_selections
      
    Line_selections                 = [6485.44, 6515.86, 6535.03, 6593.01, 6601.26, 6616.07]
    subWave, subFlux, line_heith, line_exploc = dz.Emission_Threshold(5016.0, Wave, Flux)
    
    #Fit the line
    Fitting_single = dz.command_LineMesuring(subWave, subFlux, Line_selections, line_wavelength, Line_label, Measuring_Method = 'lmfit', store_data = False)
    
    #Plotting data
    dz.data_plot(Wave, Flux, label = CodeName + ' spectrum', color=dz.ColorVector[2][0], linestyle='step')
    dz.data_plot(Wave[dz.ind3:dz.ind4], Fitting_single['ContinuumFlux'][dz.ind3:dz.ind4], label = CodeName + ' spectrum', color=dz.ColorVector[2][0], linestyle='step')
    dz.data_plot(Fitting_single['x_resample'], Fitting_single['y_resample'][0], label = 'Simple fitting', color=dz.ColorVector[2][1])
    dz.data_plot(Fitting_single['x_resample'], Fitting_single['zerolev_resample'], label = 'simple zero level', linestyle= ':', color=dz.ColorVector[2][1])
    dz.data_plot(subWave[dz.ind3:dz.ind4][dz.Fitting_dict['wide mask']], subFlux[dz.ind3:dz.ind4][dz.Fitting_dict['wide mask']], label = CodeName + ' original', color='red', markerstyle='o')
    dz.data_plot(dz.Fitting_dict['Maxima_Waves'], dz.Fitting_dict['Maxima_peaks'], label = 'Maxima peaks = ' + str(len(dz.Fitting_dict['Maxima_peaks'])), color='orange', markerstyle='o')
#     dz.data_plot(dz.Fitting_dict['Maxima_Waves_pu'], dz.Fitting_dict['Maxima_peaks_pu'], label = 'Maxima peaks = ' + str(len(dz.Fitting_dict['Maxima_Waves_pu'])), color='black', markerstyle='o')
    #dz.data_plot(subWave[dz.ind3:dz.ind4], dz.Fitting_dict['emis_limpio'] * dz.Fitting_dict['y_scaler'], label = CodeName + ' original', color='green', markerstyle='o')

#     #Plot the masks regions
#     sigmas_limits = [1.5,4,3]
#     for k in [0,1,2]:
#         index_str = str(k)