Exemplo n.º 1
0
 def accept(self):
     try:
         axes = self.get_axes()
         if None in axes:
             raise NeXusError("Unable to set axes")
         if len(set(axes)) < len(axes):
             raise NeXusError("Cannot have duplicate axes")
         self.group.nxsignal = self.signal
         self.group.nxaxes = axes
         super(SignalDialog, self).accept()
     except NeXusError as error:
         from nexpy.gui.mainwindow import report_error 
         report_error("Setting signal", error)
Exemplo n.º 2
0
 def fit_data(self):
     self.read_parameters()
     if self.fit_checkbox.isChecked():
         use_errors = True
     else:
         use_errors = False
     from nexpy.gui.mainwindow import report_error
     try:
         self.fit = Fit(self.data, self.functions, use_errors)
         self.fit.fit_data()
     except Exception as error:
         report_error("Fitting Data", error)
     if self.fit.result.success:
         self.fit_label.setText('Fit Successful Chi^2 = %s' % self.fit.result.redchi)
     else:
         self.fit_label.setText('Fit Failed Chi^2 = %s' % self.fit.result.redchi)
     self.write_parameters()
     if not self.fitted:
         self.action_layout.addWidget(self.report_button)
         self.action_layout.addWidget(self.restore_button)
         self.save_button.setText('Save Fit')
     self.fitted = True
Exemplo n.º 3
0
 def fit_data(self):
     self.read_parameters()
     if self.fit_checkbox.isChecked():
         use_errors = True
     else:
         use_errors = False
     from nexpy.gui.mainwindow import report_error
     try:
         self.fit = Fit(self.data, self.functions, use_errors)
         self.fit.fit_data()
     except Exception as error:
         report_error("Fitting Data", error)
     if self.fit.result.success:
         self.fit_label.setText('Fit Successful Chi^2 = %s' %
                                self.fit.result.redchi)
     else:
         self.fit_label.setText('Fit Failed Chi^2 = %s' %
                                self.fit.result.redchi)
     self.write_parameters()
     if not self.fitted:
         self.action_layout.addWidget(self.report_button)
         self.action_layout.addWidget(self.restore_button)
         self.save_button.setText('Save Fit')
     self.fitted = True
Exemplo n.º 4
0
def show_dialog(parent=None):
    try:
        dialog = ConvertDialog(parent)
        dialog.show()
    except NeXusError as error:
        report_error("Converting to (Q,E)", error)
Exemplo n.º 5
0
def show_dialog():
    try:
        dialog = ConvertDialog()
        dialog.show()
    except NeXusError as error:
        report_error("Converting to (Q,E)", error)
Exemplo n.º 6
0
def show_dialog(parent=None):
    try:
        dialog = EnergyDialog()
        dialog.show()
    except NeXusError as error:
        report_error("Getting Incident Energy", error)
Exemplo n.º 7
0
 def accept(self):
     try:
         self.parameters['Ei'].save()
     except NeXusError as error:
         report_error("Getting Incident Energy", error)
     super(EnergyDialog, self).accept()
Exemplo n.º 8
0
 def accept(self):
     try:
         self.root['entry/instrument/monochromator/energy'] = self.Ei
     except NeXusError as error:
         report_error("Getting Incident Energy", error)
     super(EnergyDialog, self).accept()
Exemplo n.º 9
0
def show_dialog(parent=None):
    try:
        dialog = EnergyDialog(parent)
        dialog.show()
    except NeXusError as error:
        report_error("Getting Incident Energy", error)
Exemplo n.º 10
0
 def accept(self):
     try:
         self.parameters["Ei"].save()
     except NeXusError as error:
         report_error("Getting Incident Energy", error)
     super(EnergyDialog, self).accept()