pysilcam/silcamgui/interactive_summary.py
def load_data(self):
        '''handles loading of data, depending on what is available'''
        self.datadir = os.path.split(self.configfile)[0]

        self.stats_filename = ''
        self.stats_filename = QFileDialog.getOpenFileName(self,
                                                          caption='Load a *-STATS.csv file',
                                                          directory=self.datadir,
                                                          filter=(('*-STATS.csv'))
                                                          )[0]
        if self.stats_filename == '':
            return

        timeseriesgas_file = self.stats_filename.replace('-STATS.csv', '-TIMESERIESgas.xlsx')

        if os.path.isfile(timeseriesgas_file):
            ws = waitsplash()
            self.load_from_timeseries()
            ws.close()
        else:

            msgBox = QMessageBox()
            msgBox.setText('The STATS data appear not to have been exported to TIMSERIES.xlsx' +
                           '\n We can use the STATS file anyway (which might take a while)' +
                           '\n or we can convert the data to TIMSERIES.xls now,'
                           '\n which can be used quickly if you want to load these data another time.')
            msgBox.setIcon(QMessageBox.Question)
            msgBox.setWindowTitle('What to do?')
            load_stats_button = msgBox.addButton('Load stats anyway',
                                                 QMessageBox.ActionRole)
            convert_stats_button = msgBox.addButton('Convert and save timeseries',
                                                    QMessageBox.ActionRole)
            msgBox.addButton(QMessageBox.Cancel)
            msgBox.exec_()
            if self.configfile == '':
                self.configfile = QFileDialog.getOpenFileName(self,
                                                                  caption='Load config ini file',
                                                                  directory=self.datadir,
                                                                  filter=(('*.ini'))
                                                                  )[0]
                if self.configfile == '':
                    return
            if (msgBox.clickedButton() == load_stats_button):
                self.settings = PySilcamSettings(self.configfile)
                self.av_window = pd.Timedelta(seconds=self.settings.PostProcess.window_size)

                ws = waitsplash()
                self.load_from_stats()
                ws.close()

            elif (msgBox.clickedButton() == convert_stats_button):
                ws = waitsplash()
                export_timeseries(self.configfile, self.stats_filename)

                self.load_from_timeseries()
                ws.close()
            else:
                return

        self.mid_time = min(self.u) + (max(self.u) - min(self.u)) / 2
        self.setup_figure()
handles loading of data, depending on what is available
handles loading of data, depending on what is available
handles loading of data depending on what is available
def load_data(self):
        self.datadir = os.path.split(self.configfile)[0]
        self.stats_filename = ''
        self.stats_filename = QFileDialog.getOpenFileName(self,
                                                          caption='Load a *-STATS.csv file',
                                                          directory=self.datadir,
                                                          filter=(('*-STATS.csv'))
                                                          )[0]
        if self.stats_filename == '':
            return
        timeseriesgas_file = self.stats_filename.replace('-STATS.csv', '-TIMESERIESgas.xlsx')
        if os.path.isfile(timeseriesgas_file):
            ws = waitsplash()
            self.load_from_timeseries()
            ws.close()
        else:
            msgBox = QMessageBox()
            msgBox.setText('The STATS data appear not to have been exported to TIMSERIES.xlsx' +
                           '\n We can use the STATS file anyway (which might take a while)' +
                           '\n or we can convert the data to TIMSERIES.xls now,'
                           '\n which can be used quickly if you want to load these data another time.')
            msgBox.setIcon(QMessageBox.Question)
            msgBox.setWindowTitle('What to do?')
            load_stats_button = msgBox.addButton('Load stats anyway',
                                                 QMessageBox.ActionRole)
            convert_stats_button = msgBox.addButton('Convert and save timeseries',
                                                    QMessageBox.ActionRole)
            msgBox.addButton(QMessageBox.Cancel)
            msgBox.exec_()
            if self.configfile == '':
                self.configfile = QFileDialog.getOpenFileName(self,
                                                                  caption='Load config ini file',
                                                                  directory=self.datadir,
                                                                  filter=(('*.ini'))
                                                                  )[0]
                if self.configfile == '':
                    return
            if (msgBox.clickedButton() == load_stats_button):
                self.settings = PySilcamSettings(self.configfile)
                self.av_window = pd.Timedelta(seconds=self.settings.PostProcess.window_size)
                ws = waitsplash()
                self.load_from_stats()
                ws.close()
            elif (msgBox.clickedButton() == convert_stats_button):
                ws = waitsplash()
                export_timeseries(self.configfile, self.stats_filename)
                self.load_from_timeseries()
                ws.close()
            else:
                return
        self.mid_time = min(self.u) + (max(self.u) - min(self.u)) / 2
        self.setup_figure()
def load_data ( self ) : self . datadir = os . path . split ( self . configfile ) [ 0 ] self . stats_filename = '' self . stats_filename = QFileDialog . getOpenFileName ( self , caption = 'Load a *-STATS.csv file' , directory = self . datadir , filter = ( ( '*-STATS.csv' ) ) ) [ 0 ] if self . stats_filename == '' : return timeseriesgas_file = self . stats_filename . replace ( '-STATS.csv' , '-TIMESERIESgas.xlsx' ) if os . path . isfile ( timeseriesgas_file ) : ws = waitsplash ( ) self . load_from_timeseries ( ) ws . close ( ) else : msgBox = QMessageBox ( ) msgBox . setText ( 'The STATS data appear not to have been exported to TIMSERIES.xlsx' + '\n We can use the STATS file anyway (which might take a while)' + '\n or we can convert the data to TIMSERIES.xls now,' '\n which can be used quickly if you want to load these data another time.' ) msgBox . setIcon ( QMessageBox . Question ) msgBox . setWindowTitle ( 'What to do?' ) load_stats_button = msgBox . addButton ( 'Load stats anyway' , QMessageBox . ActionRole ) convert_stats_button = msgBox . addButton ( 'Convert and save timeseries' , QMessageBox . ActionRole ) msgBox . addButton ( QMessageBox . Cancel ) msgBox . exec_ ( ) if self . configfile == '' : self . configfile = QFileDialog . getOpenFileName ( self , caption = 'Load config ini file' , directory = self . datadir , filter = ( ( '*.ini' ) ) ) [ 0 ] if self . configfile == '' : return if ( msgBox . clickedButton ( ) == load_stats_button ) : self . settings = PySilcamSettings ( self . configfile ) self . av_window = pd . Timedelta ( seconds = self . settings . PostProcess . window_size ) ws = waitsplash ( ) self . load_from_stats ( ) ws . close ( ) elif ( msgBox . clickedButton ( ) == convert_stats_button ) : ws = waitsplash ( ) export_timeseries ( self . configfile , self . stats_filename ) self . load_from_timeseries ( ) ws . close ( ) else : return self . mid_time = min ( self . u ) + ( max ( self . u ) - min ( self . u ) ) / 2 self . setup_figure ( )
handles loading of data, depending on what is available
handles loading of data depending on what is available
'''handles loading of data, depending on what is available'''
self