示例#1
0
 def __init__(self, frames):
     Sequence.__init__(self)
     # frames is a tuple of frame tuples: see Frame constructor for the
     # format of a frame tuple; it is reversed, because _tracemalloc
     # returns frames sorted from most recent to oldest, but the
     # Python API expects oldest to most recent
     self._frames = tuple(reversed(frames))
    def __init__(self, fname='', dat=None):
        """
        Initialization for SpectralImage can be from a filename or metadata
        dictionary.

        hdf5 filename is checked against list of supported file types.
        Dictionary supercedes loading from a file.

        Parameters
        ----------
            fname : str
                filename of hdf5 file to open
            dat : DictionaryTreeBrowser
                metadata dictionary

        """
        if dat is not None:
            assert isinstance(dat, DictionaryTreeBrowser)
            self.dat = dat.copy()
        elif self.is_supported(fname):
            self.load_h5_data(fname)
        else:
            raise Exception('No valid dictionary or filename supplied.')
            return

        self.load_from_metadata()
        Sequence.__init__(self)

        if self.is_supported(fname):
            print('Load from %s complete.' % fname)
            print('%d x %d x %d spatial x %d spectral points' %
                  (len(self.z_array), len(self.x_array), len(
                      self.y_array), len(self.spec_x_array)))
示例#3
0
 def __init__(self, frames):
     Sequence.__init__(self)
     # frames is a tuple of frame tuples: see Frame constructor for the
     # format of a frame tuple; it is reversed, because _tracemalloc
     # returns frames sorted from most recent to oldest, but the
     # Python API expects oldest to most recent
     self._frames = tuple(reversed(frames))
示例#4
0
文件: yaml.py 项目: ecleya/pyfile
    def __init__(self, file_path):
        File.__init__(self, file_path)
        Sequence.__init__(self)

        self._instance = None
示例#5
0
 def __init__(self, traces):
     Sequence.__init__(self)
     # traces is a tuple of trace tuples: see Trace constructor
     self._traces = traces
示例#6
0
 def __init__(self, frames):
     Sequence.__init__(self)
     # frames is a tuple of frame tuples: see Frame constructor for the
     # format of a frame tuple
     self._frames = frames
示例#7
0
 def __init__(self, elements: t.Sequence[t.Any], root: "NodeTree",
              tree: tuple):
     Sequence.__init__(self)
     Node.__init__(self, root, tree)
     self._elements: t.Sequence[t.Any] = elements
示例#8
0
 def __init__(self, traces):
     Sequence.__init__(self)
     self._traces = traces
示例#9
0
 def __init__(self, frames):
     Sequence.__init__(self)
     self._frames = tuple(reversed(frames))
示例#10
0
    def __init__(self, path):
        Sequence.__init__(self)

        self._path = unicodedata.normalize('NFC', str(path))
        self._instance = None
示例#11
0
 def __init__(self, traces):
     Sequence.__init__(self)
     # traces is a tuple of trace tuples: see Trace constructor
     self._traces = traces
示例#12
0
 def __init__(self, frames):
     Sequence.__init__(self)
     # frames is a tuple of frame tuples: see Frame constructor for the
     # format of a frame tuple
     self._frames = frames