def __init__(self, *args, **kwargs): """Basic unit of data in the program. Spectrums can be any dimension of array but all of the data should be of the same type from the same area... (Maybe define this better later... You can use it kind of however you want though) Extends the Signal2D Class from hyperspy so there is that added functionality Parameters ---------- data : numpy array The signal data. It can be an array of any dimensions. axes : dictionary (optional) Dictionary to define the axes (see the documentation of the AxesManager class for more details). attributes : dictionary (optional) A dictionary whose items are stored as attributes. metadata : dictionary (optional) A dictionary containing a set of parameters that will to stores in the `metadata` attribute. Some parameters might be mandatory in some cases. original_metadata : dictionary (optional) A dictionary containing a set of parameters that will to stores in the `original_metadata` attribute. It typically contains all the parameters that has been imported from the original data file. Notes: For more parameters see hyperspy's Signal2D Class """ Signal2D.__init__(self, *args, **kwargs) self.manav = MaskSlicer(self, isNavigation=True) self.masig = MaskSlicer(self, isNavigation=False) self.mask_passer= None
def __init__(self, *args, **kwargs): Signal2D.__init__(self, *args, **kwargs) # Attributes defaults if 'Acquisition_instrument.TEM' not in self.metadata: if 'Acquisition_instrument.SEM' in self.metadata: self.metadata.set_item( "Acquisition_instrument.TEM", self.metadata.Acquisition_instrument.SEM) del self.metadata.Acquisition_instrument.SEM self.decomposition.__func__.__doc__ = BaseSignal.decomposition.__doc__
def __init__(self, *args, **kwargs): Signal2D.__init__(self, *args, **kwargs) # Set default attributes if 'Acquisition_instrument' in self.metadata.as_dictionary(): if 'SEM' in self.metadata.as_dictionary()['Acquisition_instrument']: self.metadata.set_item( "Acquisition_instrument.TEM", self.metadata.Acquisition_instrument.SEM) del self.metadata.Acquisition_instrument.SEM self.decomposition.__func__.__doc__ = BaseSignal.decomposition.__doc__
def __init__(self, *args, **kwargs): """ If a hyperspy Signal2D is given, it is transformed into a ModifiedImage. In that case, additional *args and **kwargs are discarded. """ if len(args) > 0 and isinstance(args[0], Image): # Pretend it is a hs signal, copy axes and metadata sdict = args[0]._to_dictionary() Image.__init__(self, **sdict) else: Image.__init__(self, *args, **kwargs)
def __init__(self, *args, **kwargs): Signal2D.__init__(self, *args, **kwargs) self.vectors = None
def __init__(self, *args, **kwargs): Signal2D.__init__(self, *args, **kwargs)