Example #1
0
 def show_plot(self, e):
     """Call the class to plot Spectrum, Time profile, Spectrogram;
     parameters are taken from .fits file, chosen(loaded) by user"""
     plots = plotting.Input(self.name)
     #if user pick in Plot Units section 'Rate' and 'Spectrum', plot:
     if self.var.get() == 'Rate':
         if e == 'spec':
             plots.plot_spectrum_rate()
         #Rate and Time Profile:
         elif e == 'time':
             plots.rate_vs_time_plotting()
         #Rate and Time Spectrogram:
         elif e == 'specgr':
             plots.plot_spectrogram_rate()
     #if 'Counts' and 'Spectrum', plot:
     if self.var.get() == 'Counts':
         if e == 'spec':
             plots.plot_spectrum_counts()
         #if 'Counts' and 'Time Profile', plot:
         elif e == 'time':
             plots.counts_vs_time_plotting()
         #if 'Counts' and 'Spectrogram', plot:
         elif e == 'specgr':
             plots.plot_spectrogram_counts()
     #if 'Flux' and 'Spectrum', plot:
     if self.var.get() == 'Flux':
         if e == 'spec':
             plots.plot_spectrum_flux()
         #if 'Flux' and 'Time Profile', plot:
         elif e == 'time':
             plots.flux_vs_time_plotting()
         #if 'Flux' and 'Spectrogram', plot:
         elif e == 'specgr':
             plots.plot_spectrogram_flux()
Example #2
0
    def show_backgroundplot(self, e, i):

        if self.sepBkVar.get() == 1:
            if BackgroundWindow.fname is not None:
                plots = background_plot.Input(BackgroundWindow.fname)
                if self.var.get() == 'Rate':
                    if e == 'time':
                        #plots.rate_vs_time_plotting()
                        plots.backg_plot_vs_time('rate', i)
##            elif e == 'show':
##                plots.rate_vs_time_plotting()
##            elif e == 'specgr':
##                plots.plot_spectrogram_rate()
                if self.var.get() == 'Counts':
                    if e == 'time':
                        plots.backg_plot_vs_time('counts', i)
##          elif e == 'show':
##             plots.rate_vs_time_plotting()
##          elif e == 'specgr':
##               plots.plot_spectrogram_rate()
                if self.var.get() == 'Flux':
                    if e == 'time':
                        plots.backg_plot_vs_time('flux', i)
##            elif e == 'show':
##                plots.flux_vs_time_plotting()
##            elif e == 'specgr':
##                plots.plot_spectrogram_flux()

##
        else:
            plots = plotting.Input(BackgroundWindow.fname)

            if self.var.get() == 'Rate':
                if e == 'time':
                    plots.rate_vs_time_plotting()
##            elif e == 'show':
##                plots.rate_vs_time_plotting()
##            elif e == 'specgr':
##                plots.plot_spectrogram_rate()
            if self.var.get() == 'Counts':
                if e == 'time':
                    plots.counts_vs_time_plotting()
##          elif e == 'show':
##             plots.rate_vs_time_plotting()
##          elif e == 'specgr':
##               plots.plot_spectrogram_rate()
            if self.var.get() == 'Flux':
                if e == 'time':
                    plots.flux_vs_time_plotting()
 def show_plot(self, e):
     plots = plotting.Input(self.name)
     if self.var.get() == 'Rate':
         if e == 'spec':
             plots.plot_spectrum_rate()
         elif e == 'time':
             plots.rate_vs_time_plotting()
         elif e == 'specgr':
             plots.plot_spectrogram_rate()
     if self.var.get() == 'Counts':
         if e == 'spec':
             plots.plot_spectrum_counts()
         elif e == 'time':
             plots.counts_vs_time_plotting()
         elif e == 'specgr':
             plots.plot_spectrogram_counts()
     if self.var.get() == 'Flux':
         if e == 'spec':
             plots.plot_spectrum_flux()
         elif e == 'time':
             plots.flux_vs_time_plotting()
         elif e == 'specgr':
             plots.plot_spectrogram_flux()
Example #4
0
    def show_backgroundplot(self, e, i, showTime): #make plots (plot vs time, plot spectrum ... ) 

         energyLab = ['3.0 to 6.0 keV', '6.0 to 12.0 keV', '12.0 to 25.0 keV', '25.0 to 50.0 keV',
                      '50.0 to 100.0 keV', '100.0 to 300.0 keV' ]


         if self.MethodVars is not None:
             print('separa in showplot', self.sepBkVar.get(), self.var.get(), self.MethodVars[0].get())

         
         BackgroundWindow.plotType = 'time' if e == 'time' else 'specgr'
         print('show valll', BackgroundWindow.plotType)
        
      
         if BackgroundWindow.bkgTimeInterv is not None:
             print('time interv', BackgroundWindow.bkgTimeInterv)         
         if self.sepBkVar.get() == 1:
          if BackgroundWindow.fname is not None:          
           plots = bkgPlots.BackgPlots() #background_plot.Input(BackgroundWindow.fname)
           if self.var.get() == 'Rate':
            if e == 'time':
                #plots.rate_vs_time_plotting()
                plots.plot(BackgroundWindow.bkgTimeInterv, 'Rate', i, self.MethodVars[i].get(), showTime) #plots.backg_plot_vs_time('counts', i)
##            elif e == 'show':
##                plots.rate_vs_time_plotting()
##            elif e == 'specgr':
##                plots.plot_spectrogram_rate()
           if self.var.get() == 'Counts':
            if e == 'time':
               plots.plot(BackgroundWindow.bkgTimeInterv, 'Counts', i, self.MethodVars[i].get(), showTime) #plots.backg_plot_vs_time('counts', i)
##          elif e == 'show':
##             plots.rate_vs_time_plotting()
##          elif e == 'specgr':
##               plots.plot_spectrogram_rate()
           if self.var.get() == 'Flux':
            if e == 'time':
                plots.plot(BackgroundWindow.bkgTimeInterv, 'Flux', i, self.MethodVars[i].get(), showTime) #plots.backg_plot_vs_time('flux', i)
##            elif e == 'show':
##                plots.flux_vs_time_plotting()
##            elif e == 'specgr':
##                plots.plot_spectrogram_flux()

##                
         else:
           plots = plotting.Input(BackgroundWindow.fname)
          
           if self.var.get() == 'Rate':
            if e == 'time':
                plots.rate_vs_time_plotting()
##            elif e == 'show':
##                plots.rate_vs_time_plotting()
##            elif e == 'specgr':
##                plots.plot_spectrogram_rate()
           if self.var.get() == 'Counts':
            if e == 'time':
               plots.counts_vs_time_plotting()
##          elif e == 'show':
##             plots.rate_vs_time_plotting()
##          elif e == 'specgr':
##               plots.plot_spectrogram_rate()
           if self.var.get() == 'Flux':
            if e == 'time':
                plots.flux_vs_time_plotting()