예제 #1
0
# pv.Current_Ion                      = 'He1'
# pv.Current_TheoLoc                  = 5016.0
# pv.Current_Label                  = 'O3_5007A'
# pv.Current_Ion                    = '[OIII]'
# pv.Current_TheoLoc                = 5006.843
# pv.Current_Label                    = 'O2_7319A'
# pv.Current_Ion                      = '[OII]'
# pv.Current_TheoLoc                  = 7319.000
# 
# pv.Current_Label                    = 'O2_7330A'
# pv.Current_Ion                      = '[OII]'
# pv.Current_TheoLoc                  = 7330.000

pv.Fitting_dict['Wide component']   = False
pv.save_to_file_check               = False
pv.Current_LinesLog                 = '/home/vital/Dropbox/Astrophysics/Data/WHT_Catalogue_SulfurRegression/Objects/SHOC579/' +  CodeName + '_WHT_LinesLog_v3.txt'

pv.Selections = pv.RangesR(Selections, pv.Current_TheoLoc, pv.Current_LinesLog)
print 'The selections', pv.Selections

pv.Selections = [6497.6857399999999, 6524.8928889999997, 6541.0, 6593.0, 6593.1912490000004, 6616.0508639999998]                             

pv.PlottingInLineMeasuring(store_data = False)

print pv.Fitting_dict['blended number']
for i in range(pv.Fitting_dict['blended number']):
    index = str(i)  
    print index, pv.Fitting_dict['A'     + index].nominal_value
    print index, pv.Fitting_dict['mu'    + index].nominal_value
    print index, pv.Fitting_dict['sigma' + index].nominal_value
    
#       Get the text file:  
        Lick_TextFileName               = CodeName + '_LickIndexes.txt'
        Lick_TextFile                   = open(FileFolder + Lick_TextFileName,"r")
        TextLines                       = Lick_TextFile.readlines()
        Lick_TextFile.close()
    
#       Several lines logs depending on the pypeline state: Untreated, Reddening, Nebular continuum, Stellar continuum 
        LogTableName                    = CodeName + DataLog_Extension
        pv.LogTableAddress              = FileFolder + LogTableName
           
        #Generate data log if emision lines log (THIS COULD BE AN ISOLATED METHOD)
        pv.CleanTableMaker(pv.LogTableAddress, pv.RemakeFiles)   
    
        #Defining lines log
        pv.Current_LinesLog             = FileFolder + LogTableName
        
#       Start to loop through recorded line
        for m in range(1, len(TextLines)):
            try:

                Line = TextLines[m].split()
                pv.Current_Label, pv.Current_Ion, pv.Current_TheoLoc        = Line[0], Line[1], float(Line[2]),
                pv.Wave1, pv.Wave2, pv.Wave3, pv.Wave4, pv.Wave5, pv.Wave6  = float(Line[4]), float(Line[5]), float(Line[6]), float(Line[7]), float(Line[8]), float(Line[9])
                pv.Selections                                               = [pv.Wave1, pv.Wave2, pv.Wave3, pv.Wave4, pv.Wave5, pv.Wave6]
                Ind_min                                                     = np_searchsorted(Wave, pv.Wave1)
                Ind_max                                                     = np_searchsorted(Wave, pv.Wave6)
                SubWave                                                     = Wave[Ind_min - 1 : Ind_max + 1]             
                SubInt                                                      = Int[Ind_min - 1 : Ind_max + 1]
                pv.ind1, pv.ind2, pv.ind3, pv.ind4, pv.ind5, pv.ind6        = np_searchsorted(SubWave, pv.Wave1), np_searchsorted(SubWave, pv.Wave2), np_searchsorted(SubWave, pv.Wave3), np_searchsorted(SubWave, pv.Wave4), np_searchsorted(SubWave, pv.Wave5), np_searchsorted(SubWave, pv.Wave6)
     
예제 #3
0
CodeName, FileName, FileFolder = pv.Analyze_Address(FilesList[0])
  
#Load fits file data
Wave, Int, ExtraData = pv.File2Data(FileFolder, FileName)


#---------------------------Complete Mode--------------------------------------------------------------------
     
pv.RemakeFiles = False
pv.Wave = Wave
pv.Int = Int
pv.Current_Code = CodeName
Selections = []
 
Line_Label          =  'N2_6548A'
pv.Current_LinesLog = '/home/vital/Dropbox/Astrophysics/Data/WHT_Catalogue/Objects/51959-092/' +  CodeName + '_WHT_LinesLog_v3.txt'
 
Ion             = pv.GetDataInTable('Line_Label',"Ion", Line_Label, pv.Current_LinesLog, pv.TableHeaderSize)
TheoWavelength  = pv.GetDataInTable('Line_Label',"TheoWavelength", Line_Label, pv.Current_LinesLog, pv.TableHeaderSize, dataype='float')
 
pv.Current_Label, pv.Current_Ion, pv.Current_TheoLoc =  Line_Label, Ion, TheoWavelength
pv.Selections = pv.RangesR(Selections, pv.Current_TheoLoc, pv.Current_LinesLog)
   
pv.PlottingInLineMeasuring()
 
pv.DisplayFigure()
  
pv = Plots_Manager()


# #---------------------------Simple Mode--------------------------------------------------------------------