def testFormat(): infile = dataDir + "Ref_Gold.segy" ais = ArrayInputStream(infile) ais.skipBytes(nhead + nbhed) ais.skipBytes(nthed) xi = zeroint(n1) ais.readInts(xi) ais.close() x1 = zerofloat(n1) x2 = zerofloat(n1) Convert.ibmToFloat(xi, x1) Convert.ieeeToFloat(xi, x2) SimplePlot.asPoints(x1) SimplePlot.asPoints(x2)
def testFormat(): infile = dataDir+"Ref_Gold.segy" ais = ArrayInputStream(infile) ais.skipBytes(nhead+nbhed) ais.skipBytes(nthed) xi = zeroint(n1) ais.readInts(xi) ais.close() x1 = zerofloat(n1) x2 = zerofloat(n1) Convert.ibmToFloat(xi,x1) Convert.ieeeToFloat(xi,x2) SimplePlot.asPoints(x1) SimplePlot.asPoints(x2)
def convertSegy(infile, outfile): infile = dataDir + infile outfile = dataDir + outfile ais = ArrayInputStream(infile) aos = ArrayOutputStream(outfile) ais.skipBytes(nhead + nbhed) xi = zeroint(n1i) x = zerofloat(n1i) y = zerofloat(n1) ais.skipBytes(k2 * (nthed + 4 * n1i)) for i2 in range(n2): ais.skipBytes(nthed) ais.readInts(xi) Convert.ibmToFloat(xi, x) copy(n1, k1, x, 0, y) aos.writeFloats(y) ais.close() aos.close()
def convertSegy(infile,outfile): infile = dataDir+infile; outfile = dataDir+outfile ais = ArrayInputStream(infile) aos = ArrayOutputStream(outfile) ais.skipBytes(nhead+nbhed) xi = zeroint(n1i) x = zerofloat(n1i) y = zerofloat(n1) ais.skipBytes(k2*(nthed+4*n1i)) for i2 in range(n2): ais.skipBytes(nthed) ais.readInts(xi) Convert.ibmToFloat(xi,x) copy(n1,k1,x,0,y) aos.writeFloats(y) ais.close() aos.close()