def on_er_data(self, event): if self.data_model_num == 2: if not os.path.isfile(os.path.join(self.WD, 'magic_measurements.txt')): print('-W- {} is missing'.format(os.path.join(self.WD, 'magic_measurements.txt'))) pw.simple_warning("Your working directory must have a magic_measurements.txt file to run this step. Make sure you have fully completed step 1 (import magnetometer file), by combining all imported magnetometer files into one magic_measurements file.") return False #self.ErMagic_frame = ErMagicBuilder.MagIC_model_builder(self.WD, self, self.ErMagic_data)#,self.Data,self.Data_hierarchy) wait = wx.BusyInfo('Compiling required data, please wait...') wx.Yield() self.ErMagic_frame = ErMagicBuilder.MagIC_model_builder(self.WD, self, self.er_magic)#,self.Data,self.Data_hierarchy) elif self.data_model_num == 3: if not os.path.isfile(os.path.join(self.WD, 'measurements.txt')): pw.simple_warning("Your working directory must have a 3.0. format measurements.txt file to run this step. Make sure you have fully completed step 1 (import magnetometer file) and ALSO converted to 3.0., if necessary), then try again.") return False wait = wx.BusyInfo('Compiling required data, please wait...') wx.Yield() self.ErMagic_frame = ErMagicBuilder.MagIC_model_builder3(self.WD, self, self.contribution) self.ErMagic_frame.Show() self.ErMagic_frame.Center() size = wx.DisplaySize() size = (size[0] - 0.3 * size[0], size[1] - 0.3 * size[1]) # gets total available screen space - 10% self.ErMagic_frame.Raise() del wait
def on_btn_metadata(self, event): """ Initiate the series of windows to add metadata to the contribution. """ # make sure we have a measurements file if not self.check_for_meas_file(): return # make sure all files of the same type have been combined if not self.check_for_uncombined_files(): return if self.data_model_num == 2: wait = wx.BusyInfo('Compiling required data, please wait...') wx.SafeYield() self.ErMagic_frame = ErMagicBuilder.MagIC_model_builder( self.WD, self, self.er_magic) elif self.data_model_num == 3: wait = wx.BusyInfo('Compiling required data, please wait...') wx.SafeYield() self.ErMagic_frame = ErMagicBuilder.MagIC_model_builder3( self.WD, self, self.contribution) # self.ErMagic_frame.Show() self.ErMagic_frame.Center() # gets total available screen space - 10% size = wx.DisplaySize() size = (size[0] - 0.3 * size[0], size[1] - 0.3 * size[1]) self.ErMagic_frame.Raise() del wait
def on_er_data(self, event): if not os.path.isfile(os.path.join(self.WD, 'magic_measurements.txt')): import dialogs.pmag_widgets as pw pw.simple_warning( "Your working directory must have a magic_measurements.txt file to run this step. Make sure you have fully completed step 1 (import magnetometer file), by combining all imported magnetometer files into one magic_measurements file." ) return False #self.ErMagic_frame = ErMagicBuilder.MagIC_model_builder(self.WD, self, self.ErMagic_data)#,self.Data,self.Data_hierarchy) wait = wx.BusyInfo('Compiling required data, please wait...') wx.Yield() self.ErMagic_frame = ErMagicBuilder.MagIC_model_builder( self.WD, self, self.er_magic) #,self.Data,self.Data_hierarchy) self.ErMagic_frame.Show() self.ErMagic_frame.Center() size = wx.DisplaySize() size = (size[0] - 0.3 * size[0], size[1] - 0.3 * size[1] ) # gets total available screen space - 10% self.ErMagic_frame.Raise() del wait