Ejemplo n.º 1
0
    def add_intermediate(self):
        """
        This method stores any intermediate objects within the final data set after fully reading the set.

        :param parent: The NXclass name for the h5py Group object that just finished being processed
        """

        if self.parent_class == u'SASprocess':
            self.current_datainfo.process.append(self.process)
            self.process = Process()
        elif self.parent_class == u'SASdetector':
            self.current_datainfo.detector.append(self.detector)
            self.detector = Detector()
        elif self.parent_class == u'SAStransmission_spectrum':
            self.current_datainfo.trans_spectrum.append(self.trans_spectrum)
            self.trans_spectrum = TransmissionSpectrum()
        elif self.parent_class == u'SAScollimation':
            self.current_datainfo.collimation.append(self.collimation)
            self.collimation = Collimation()
        elif self.parent_class == u'SASaperture':
            self.collimation.aperture.append(self.aperture)
            self.aperture = Aperture()
        elif self.parent_class == u'SASdata':
            if type(self.current_dataset) is plottable_2D:
                self.data2d.append(self.current_dataset)
            elif type(self.current_dataset) is plottable_1D:
                self.data1d.append(self.current_dataset)
Ejemplo n.º 2
0
 def add_aperture(self, event):
     """
     Append empty aperture to data's list of aperture
     """
     collimation, _, _ = self.get_current_collimation()
     if not self.aperture_cbox.IsEnabled():
         self.aperture_cbox.Enable()
     aperture = Aperture()
     collimation.aperture.append(aperture)
     position = self.aperture_cbox.Append(str(aperture.name))
     self.aperture_cbox.SetClientData(position, aperture)
     self.aperture_cbox.SetSelection(position)
     self.enable_aperture()
Ejemplo n.º 3
0
 def reset_state(self):
     self.current_dataset = plottable_1D(np.empty(0), np.empty(0), np.empty(0), np.empty(0))
     self.current_datainfo = DataInfo()
     self.datasets = []
     self.raw_data = None
     self.errors = set()
     self.logging = []
     self.output = []
     self.detector = Detector()
     self.collimation = Collimation()
     self.aperture = Aperture()
     self.process = Process()
     self.source = Source()
     self.sample = Sample()
     self.trans_spectrum = TransmissionSpectrum()
     self.upper = 5
     self.lower = 5
Ejemplo n.º 4
0
 def reset_class_variables(self):
     """
     Create the reader object and define initial states for class variables
     """
     self.current_datainfo = None
     self.current_dataset = None
     self.data1d = []
     self.data2d = []
     self.raw_data = None
     self.errors = set()
     self.logging = []
     self.output = []
     self.parent_class = u''
     self.detector = Detector()
     self.collimation = Collimation()
     self.aperture = Aperture()
     self.process = Process()
     self.trans_spectrum = TransmissionSpectrum()