def plot_peaks(self, x, y): try: polar_angles, azimuthal_angles = self.refine.calculate_angles(x, y) if polar_angles[0] > polar_angles[-1]: polar_angles = polar_angles[::-1] azimuthal_angles = azimuthal_angles[::-1] azimuthal_field = NXfield(azimuthal_angles, name='azimuthal_angle') azimuthal_field.long_name = 'Azimuthal Angle' polar_field = NXfield(polar_angles, name='polar_angle') polar_field.long_name = 'Polar Angle' plotview = get_plotview() plotview.plot( NXdata(azimuthal_field, polar_field, title='Peak Angles')) except NeXusError as error: report_error("Plotting Lattice", error)
def plot_peaks(self): try: x, y = (self.refine.xp[self.refine.idx], self.refine.yp[self.refine.idx]) polar_angles, azimuthal_angles = self.refine.calculate_angles(x, y) if polar_angles[0] > polar_angles[-1]: polar_angles = polar_angles[::-1] azimuthal_angles = azimuthal_angles[::-1] azimuthal_field = NXfield(azimuthal_angles, name='azimuthal_angle') azimuthal_field.long_name = 'Azimuthal Angle' polar_field = NXfield(polar_angles, name='polar_angle') polar_field.long_name = 'Polar Angle' plotview = get_plotview() plotview.plot(NXdata(azimuthal_field, polar_field, title=f'{self.refine.name} Peak Angles'), xmax=self.get_polar_max()) except NeXusError as error: report_error('Plotting Lattice', error)
def get_data(self): group = NXgroup(name=self.groupbox.text()) group.nxclass = self.groupcombo.selected for i, col in enumerate( [c for c in self.data if self.data[c]['signal'] != 'exclude']): name = self.data[col]['name'] group[name] = NXfield(self.data[col]['data'], dtype=self.data[col]['dtype']) if self.header and name != self.headers[i]: group[name].long_name = self.headers[i] if isinstance(group, NXdata): if self.data[col]['signal'] == 'signal': group.nxsignal = group[name] elif self.data[col]['signal'] == 'axis': group.nxaxes = [group[name]] elif self.data[col]['signal'] == 'signal': group.nxerrors = group[name] return NXentry(group)