Example #1
0
 def plot_theory_stuff(self):
     """[summary]
     
     [description]
     """
     if not self.view_modes:
         return
     data_table_tmp = DataTable(self.axarr)
     data_table_tmp.num_columns = 2
     nmodes = self.parameters["nmodes"].value
     data_table_tmp.num_rows = nmodes
     data_table_tmp.data = np.zeros((nmodes, 2))
     tau = np.logspace(self.parameters["logtmin"].value,
                       self.parameters["logtmax"].value, nmodes)
     data_table_tmp.data[:, 0] = tau
     for i in range(nmodes):
         if self.stop_theory_flag:
             break
         data_table_tmp.data[i, 1] = np.power(
             10, self.parameters["logJ%02d" % i].value)
     view = self.parent_dataset.parent_application.current_view
     try:
         x, y, success = view.view_proc(data_table_tmp, None)
     except TypeError as e:
         print(e)
         return
     self.graphicmodes.set_data(x, y)
     for i in range(data_table_tmp.MAX_NUM_SERIES):
         for nx in range(len(self.axarr)):
             self.axarr[nx].lines.remove(data_table_tmp.series[nx][i])
Example #2
0
    def plot_theory_stuff(self):
        """[summary]
        
        [description]
        """
        data_table_tmp = DataTable(self.axarr)
        data_table_tmp.num_columns = 2
        data_table_tmp.num_rows = 100
        data_table_tmp.data = np.zeros((100, 2))

        times = np.logspace(-2, 3, 100)
        data_table_tmp.data[:, 0] = times
        data_table_tmp.data[:, 1] = 0
        fparamaux = {}
        fparamaux["gdot"] = 1e-8

        G = self.parameters["G"].value
        tauD = self.parameters["tauD"].value
        data_table_tmp.data[:, 1] += G * fparamaux["gdot"] * tauD * (
            1 - np.exp(-times / tauD))
        if self.flow_mode == FlowMode.uext:
            data_table_tmp.data[:, 1] *= 3.0
        view = self.parent_dataset.parent_application.current_view
        try:
            x, y, success = view.view_proc(data_table_tmp, fparamaux)
        except TypeError as e:
            print(e)
            return
        self.LVEenvelopeseries.set_data(x[:, 0], y[:, 0])
Example #3
0
 def get_non_extended_th_table(self, f):
     """return a copy of the theory table associated with f, where the extra rows are delete"""
     if f.with_extra_x:
         tmp_dt = DataTable(axarr=[])
         nrow = self.tables[f.file_name_short].num_rows
         tmp_dt.data = self.tables[f.file_name_short].data[
             f.nextramin:nrow - f.nextramax, :]
         tmp_dt.num_rows = tmp_dt.data.shape[0]
         tmp_dt.num_columns = tmp_dt.data.shape[1]
         return tmp_dt
     else:
         return self.tables[f.file_name_short]
Example #4
0
    def update_current_view_xrange(self):
        view = self.parent_dataset.parent_application.current_view
        tmp_dt = DataTable(axarr=[])
        tmp_dt.data = np.empty((1, 3))
        tmp_dt.data[:] = np.nan
        tmp_dt.num_rows = 1
        tmp_dt.num_columns = 3
        try:
            xmin = float(self.th_xmin.text())
        except ValueError:
            self.view_xmin.setText('N/A')
        else:
            tmp_dt.data[0, 0] = xmin
            x, y, success = view.view_proc(tmp_dt, self.file.file_parameters)
            self.view_xmin.setText("%.4g" % x[0, 0])

        try:
            xmax = float(self.th_xmax.text())
        except ValueError:
            self.view_xmax.setText('N/A')
        else:
            tmp_dt.data[0, 0] = xmax
            x, y, success = view.view_proc(tmp_dt, self.file.file_parameters)
            self.view_xmax.setText("%.4g" % x[0, 0])