示例#1
0
 def read_extended_header (self) :
     ret = {}
     buf = self.read_buf (60)
     
     e = segy_h.Seg (self.endianess)
     keys = segy_h.Seg ().__keys__
     if self.ext_hdr_type == 'U' :
         e = segy_h.Menlo (self.endianess)
         keys = segy_h.Menlo ().__keys__
     elif self.ext_hdr_type == 'S' :
         e = segy_h.Seg (self.endianess)
         keys = segy_h.Seg ().__keys__
     elif self.ext_hdr_type == 'P' :
         e = segy_h.Passcal (self.endianess)
         keys = segy_h.Passcal ().__keys__
     elif self.ext_hdr_type == 'I' :
         e = segy_h.Sioseis (self.endianess)
         keys = segy_h.Sioseis ().__keys__
     elif self.ext_hdr_type == 'N' :
         e = segy_h.iNova (self.endianess)
         keys = segy_h.iNova ().__keys__
     
     container = e.parse (buf)
     
     for k in keys :
         what = "container.{0}".format (k)
         ret[k] = eval (what)
         
     return ret
示例#2
0
文件: dumpsgy.py 项目: thecassion/PH5
def print_extended_header(container):
    if TYPE == 'U':
        keys = segy_h.Menlo().__keys__
    elif TYPE == 'S':
        keys = segy_h.Seg().__keys__
    elif TYPE == 'P':
        keys = segy_h.Passcal().__keys__
    elif TYPE == 'I':
        keys = segy_h.Sioseis().__keys__
    elif TYPE == 'N':
        keys = segy_h.iNova().__keys__
    else:
        return None

    tt = 180
    print "---------- Extended Header ----------"
    for k in keys:
        what = "container.{0}".format(k)

        try:
            if tt == 9999: raise
            s = SIZEOF[k] / 8
            if s < 1: raise
            foffset = "{0:<3} - {1:>3}".format(tt, tt + s - 1)
            tt += s
        except:
            tt = 9999
            foffset = "{0:<3} - {1:>3}".format('_', '_')

        print "{2} {0:<20}\t---\t{1}".format(k, eval(what), foffset)
示例#3
0
 def set_ext_header_sioseis(self):
     '''   Use SIOSEIS extended header   '''
     ext = {}
     self.extended_header = segy_h.Sioseis()
     ext['sampleInt'] = 1.0 / self.sample_rate
     '''
     if self.seq >= traces :
         ext['endOfRp'] = 
     '''
     return ext
示例#4
0
文件: dumpsgy.py 项目: thecassion/PH5
def read_extended_header():
    buf = FH.read(60)

    if TYPE == 'U':
        e = segy_h.Menlo(ENDIAN)
    elif TYPE == 'S':
        e = segy_h.Seg(ENDIAN)
    elif TYPE == 'P':
        e = segy_h.Passcal(ENDIAN)
    elif TYPE == 'I':
        e = segy_h.Sioseis(ENDIAN)
    elif TYPE == 'N':
        e = segy_h.iNova(ENDIAN)
    else:
        return None

    return e.parse(buf)