コード例 #1
0
ファイル: m8r.py プロジェクト: AtilaSaraiva/src
 def type_form(self):
     if _swig_:
         self.type = _File.types[c_rsf.sf_gettype(self.file)]
         self.form = _File.forms[c_rsf.sf_getform(self.file)]
     else:
         self.type = self.file.gettype()
         self.form = self.file.getform()
コード例 #2
0
    def __init__(self, tag):
        if not self.file:
            # can only be used by Input and Output
            # that define self.file
            raise TypeError('Use Input or Output instead of File')
        if _swig_:
            self.type = _File.types[c_rsf.sf_gettype(self.file)]
            self.form = _File.forms[c_rsf.sf_getform(self.file)]
        else:
            self.type = self.file.gettype()
            self.form = self.file.getform()
        if self.type == 'float':
            self.datatype = np.float32
        elif self.type == 'complex':
            self.datatype = np.complex64
        elif self.type == 'int':
            self.datatype = np.int32
        else:
            raise TypeError('Unsupported type %s' % self.type)
        File.__init__(self, tag)

        # create methods line int, float, and ints
        # for extracting parameters
        for type in ('int', 'float'):
            setattr(self, type, self.__get(type))
        for type in ('int', ):
            setattr(self, type + 's', self.__gets(type))
コード例 #3
0
ファイル: m8r.py プロジェクト: stolt1/Madagascar
 def __init__(self, tag):
     if not self.file:
         raise TypeError, 'Use Input or Output instead of File'
     File.__init__(self, tag)
     self.type = _File.type[c_rsf.sf_gettype(self.file)]
     self.form = _File.form[c_rsf.sf_getform(self.file)]
コード例 #4
0
ファイル: m8r.py プロジェクト: 1014511134/src
 def __init__(self,tag):
     if not self.file:
         raise TypeError, 'Use Input or Output instead of File'
     File.__init__(self,tag)
     self.type = _File.type[c_rsf.sf_gettype(self.file)]
     self.form = _File.form[c_rsf.sf_getform(self.file)]