#!/usr/bin/python

from DZ_ScreenManager import Plots_Manager

from PipeLineMethods.ManageFlow import DataToTreat
from numpy import searchsorted as np_searchsorted

# We declare the folder and files to treat
CatalogueFolder, DataType, Log_Format  = DataToTreat()
Pattern             = '_' + DataType + '_Neb_Star.fits'                #/First batch process for untreated spectra
DataLog_Extension   = '_' + DataType + '_Neb_Star_LinesLog_v3.txt' 

ListErrorFiles = []

# Importing Dazer libraries for launching the batch measurement
pv = Plots_Manager()

# Forcing the remake of new files
pv.RemakeFiles = True

#Preload list of deblending lines
# pv.List_DeblendingLines = pv.ListDeblendingLines()

#Find and organize files from terminal command or .py file
FilesList = pv.FindAndOrganize(Pattern, CatalogueFolder, CheckComputer=True)

for m in range(len(FilesList)):    
    for j in range(len(FilesList[m])):
#       Get the spectrum:              
        CodeName, FileName, FileFolder = pv.FileAnalyzer(FilesList[m][j])
        Wave, Int, ExtraData = pv.File2Data(FileFolder, FileName)
示例#2
0

#     key_press_handler(event, canvas, toolbar)


def Span_Manager(Wlow, Whig):

    print Wlow, Whig

    return


root = Tk.Tk()
root.wm_title("Dazer")

pv = Plots_Manager()

pv.FigFormat_One(ColorConf='Night', StoreParameters=False)

CodeName, FileName, FileFolder = pv.FileAnalyzer(
    '/home/vital/Dropbox/Astrophysics/Data/WHT_HII_Galaxies/08/' +
    'obj08_WHT.fits')

Wave, Int, ExtraData = pv.File2Data(FileFolder, FileName)

pv.DataPloter_One(Wave, Int, 'Flux', pv.Color_Vector[2][1])

canvas = FigureCanvasTkAgg(pv.Fig, master=root)
canvas.show()
canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)
示例#3
0
文件: Dazer.py 项目: Delosari/X_Bin
        plt.close()

        #I WOULD LIKE TO REMOVE THIS
        return
    
    #Unknown Key combination
    else:
        print '--', event.key, '-- has not been assigned a command'

    #Plot the corresponding images        
    pv.ManagePlots()

    #Redraw the image
    pv.Fig.canvas.draw()
 
pv                      = Plots_Manager()
Pattern_PlotFiles       = ".plot"

#---- Find files within root folder according to log files ".log"
pv.FilesList            = pv.FindAndOrganize(Pattern_PlotFiles, pv.Catalogue_Folder, unpack=True, CheckComputer = False)

#---- Generate Initial Frame
pv.FigFormat_One(ColorConf = 'Night', StoreParameters = False)
pv.Axis1.text(0.95, 0.05, 'Initiating visualizer', verticalalignment='bottom', horizontalalignment='right',transform = pv.Axis1.transAxes, color = pv.Color_Vector[1],fontsize=15)

#---- Generating Figure connection
Fig_Connection          = {}
Cursor                  = widgets.Cursor(pv.Axis1, color='Red', linewidth = 1, useblit = False)
Span                    = widgets.SpanSelector(pv.Axis1, Span_Manager, 'horizontal', useblit=False, rectprops=dict(alpha=1, facecolor='Blue'))
Fig_Connection['cid']   = plt.gcf().canvas.mpl_connect('key_press_event', Key_Manager)  #Create figure an connect the event to it
plt.show()