<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_new_T_PI_parameters(self, event):
 """ calcualte statisics when temperatures are selected """


        # remember the last saved interpretation
        if "saved" in list(self.pars.keys()):
            if self.pars['saved']:
                self.last_saved_pars = {}
                for key in list(self.pars.keys()):
                    self.last_saved_pars[key] = self.pars[key]
        self.pars['saved'] = False
        t1 = self.tmin_box.GetValue()
        t2 = self.tmax_box.GetValue()

        if (t1 == "" or t2 == ""):
            print("empty interpretation bounds")
            return
        if float(t2) < float(t1):
            print("upper bound less than lower bound")
            return

        index_1 = self.T_list.index(t1)
        index_2 = self.T_list.index(t2)

        # if (index_2-index_1)+1 >= self.acceptance_criteria['specimen_int_n']:
        if (index_2 - index_1) + 1 >= 3:
            if self.Data[self.s]['T_or_MW'] != "MW":
                self.pars = thellier_gui_lib.get_PI_parameters(self.Data, self.acceptance_criteria, self.preferences, self.s, float(
                    t1) + 273., float(t2) + 273., self.GUI_log, THERMAL, MICROWAVE)
                self.Data[self.s]['pars'] = self.pars
            else:
                self.pars = thellier_gui_lib.get_PI_parameters(
                    self.Data, self.acceptance_criteria, self.preferences, self.s, float(t1), float(t2), self.GUI_log, THERMAL, MICROWAVE)
                self.Data[self.s]['pars'] = self.pars
            self.update_GUI_with_new_interpretation()
            self.Add_text(self.s)