Catalogue_Instructions = CatalogueFolder + py_w.SpectraTreating + Fm.Extensions_dictionary['Reduction Instructions'] Fm.select_Table(Catalogue_Instructions, 1, loadheaders_check = True) Objects, Redshifts = Fm.get_ColumnData(['CodeName', 'Dopcor'], 1, StringIndexes = True, datatype = str, unpack_check = True) #Generate plot frame and colors pv.FigFormat_One(ColorConf='Night1') #Loop through files for i in range(len(FilesList)): #WARNING NOT THE BEST APPROACH... CLEAN: if ('obj' in FilesList[i]): CodeName, FileName, FileFolder = pv.FileAnalyzer(FilesList[i]) z = py_w.getTaskConfiguration(CodeName, Objects, Redshifts, ConfAttributes = {'Operation' : 'Redshift correction', 'FileFolder' : FileFolder}) #Calibration with the global curve Object_DopcorCorrected = py_w.Dopcortask(FileName, None, FileFolder, z) #Extract the data for the plots Wave, Int, ExtraData_Single = pv.File2Data(FileFolder, Object_DopcorCorrected) #Plotting the data pv.DataPloter_One(Wave, Int, CodeName.upper() + ' spectrum', pv.Color_Vector[2][1]) #format of the graphs pv.Labels_Legends_One(Plot_Title = 'Object '+ CodeName + ' Redshift corrected') pv.SaveManager(SavingName = Object_DopcorCorrected.replace('.fits', '') , SavingFolder = FileFolder, ForceDisplay=False, ForceSave=True) pv.ResetPlot()
) # Find and organize files from terminal command or .py file FilesList = Fm.Folder_Explorer(Pattern, CatalogueFolder, CheckComputer=False) # Generate plot frame and colors pv.FigFormat_One(ColorConf="Night1") # Loop through files for i in range(len(FilesList)): CodeName, FileName, FileFolder = pv.FileAnalyzer(FilesList[i]) w_min, w_max = py_w.getTaskConfiguration( CodeName, Objects, Trimming_wavelengths, ConfAttributes={"Operation": "Wavelength trimming", "FileFolder": FileFolder}, ) print "-- The object", CodeName, "has new limits", w_min, w_max # CTrim the spectrum Object_TrimmedSpectrum = py_w.ScopyTask(FileName, None, Fits_Folder=FileFolder, Wmin=w_min, Wmax=w_max) # Extract the data for the plots Wave_Single, Int_Single, ExtraData_Single = pv.File2Data(FileFolder, Object_TrimmedSpectrum) # Plotting the data pv.DataPloter_One(Wave_Single, Int_Single, CodeName.upper() + " spectrum calibration", pv.Color_Vector[2][3]) # format of the graphs
Objects, TelluricStar_List = Fm.get_ColumnData(['CodeName', 'Telluric_Star'], 1, StringIndexes = True, datatype = str, unpack_check = True) #Find and organize files from terminal command or .py file FilesList = Fm.Folder_Explorer(Pattern, CatalogueFolder, CheckComputer = False) #Generate plot frame and colors pv.FigFormat_One(ColorConf='Night1') #Loop through files for i in range(len(FilesList)): #WARNING NOT THE BEST APPROACH... CLEAN: print FilesList[i] if ('obj' in FilesList[i]) and ('Red' in FilesList[i]): print 'hola' CodeName, FileName, FileFolder = pv.FileAnalyzer(FilesList[i]) TelluricStar = py_w.getTaskConfiguration(CodeName, Objects, TelluricStar_List, ConfAttributes = {'Operation' : 'Telluric correction'}) StarNormalizedSpectrum = 'std' + TelluricStar + '_clean_N.fits' #Calibration with the global curve Object_TelluricCorrectedSectrum = py_w.SarithTask(FileName, StarNormalizedSpectrum, '/', OutputFile=None, FitsFolder=FileFolder) print 'Object_TelluricCorrectedSectrum', Object_TelluricCorrectedSectrum #Extract the data for the plots Wave, Int, ExtraData_Single = pv.File2Data(FileFolder, Object_TelluricCorrectedSectrum) #Plotting the data pv.DataPloter_One(Wave, Int, CodeName.upper() + ' telluric correction', pv.Color_Vector[2][1]) #format of the graphs