code: def on_menu_criteria_file(self, event):
          
          if self.data_model == 3:
              default_file = "criteria.txt"
          else:
              default_file = "pmag_criteria.txt"
          read_sucsess = False
          dlg = wx.FileDialog(
              self, message="choose pmag criteria file",
              defaultDir=self.WD,
              defaultFile=default_file,
              style=wx.FD_OPEN | wx.FD_CHANGE_DIR
          )
          if self.show_dlg(dlg) == wx.ID_OK:
              criteria_file = dlg.GetPath()
              print(("-I- Read new criteria file: %s" % criteria_file))
  
              # check if this is a valid pmag_criteria file
              try:
                  mag_meas_data, file_type = pmag.magic_read(criteria_file)
              except:
                  dlg = wx.MessageDialog(
                      self, caption="Error", message="not a valid pmag_criteria file", style=wx.OK)
                  result = self.show_dlg(dlg)
                  if result == wx.ID_OK:
                      dlg.Destroy()
                  dlg.Destroy()
                  return
  
              # initialize criteria
              self.acceptance_criteria = self.read_criteria_file(criteria_file)
              read_sucsess = True
  
          dlg.Destroy()
          if read_sucsess:
              self.on_menu_change_criteria(None)
docs: read pmag_criteria.txt file
          and open changecriteria dialog