old_contents: #initial tests to see if pytables is
  #suitable for storing seismic data
  # sf, 1-jul-2013
  
  import tables as tb
  import numpy as np
  
  class Trace(tb.IsDescription):
  	tracr =  tb.Int32Col()
  	fldr =  tb.Int32Col()
  	tracf =  tb.Int32Col()
  	ep =  tb.Int32Col()
  	cdp =  tb.Int32Col()
  	cdpt =  tb.Int32Col()
  	trid =  tb.Int16Col()
  	nvs =  tb.Int16Col()
  	nhs =  tb.Int16Col()
  	duse =  tb.Int16Col()
  	offset =  tb.Int32Col()
  	gelev =  tb.Int32Col()
  	selev =  tb.Int32Col()
  	sdepth =  tb.Int32Col()
  	gdel =  tb.Int32Col()
  	sdel =  tb.Int32Col()
  	swdep =  tb.Int32Col()
  	gwdep =  tb.Int32Col()
  	scalel =  tb.Int16Col()
  	scalco =  tb.Int16Col()
  	sx =  tb.Int32Col()
  	sy =  tb.Int32Col()
  	gx =  tb.Int32Col()
  	gy =  tb.Int32Col()
  	counit =  tb.Int16Col()
  	wevel =  tb.Int16Col()
  	swevel =  tb.Int16Col()
  	sut =  tb.Int16Col()
  	gut =  tb.Int16Col()
  	sstat =  tb.Int16Col()
  	gstat =  tb.Int16Col()
  	tstat =  tb.Int16Col()
  	laga =  tb.Int16Col()
  	lagb =  tb.Int16Col()
  	delrt =  tb.Int16Col()
  	muts =  tb.Int16Col()
  	mute =  tb.Int16Col()
  	ns =  tb.UInt16Col() 
  	dt =  tb.UInt16Col() 
  	gain =  tb.Int16Col()
  	igc =  tb.Int16Col()
  	igi =  tb.Int16Col()
  	corr =  tb.Int16Col()
  	sfs =  tb.Int16Col()
  	sfe =  tb.Int16Col()
  	slen =  tb.Int16Col()
  	styp =  tb.Int16Col()
  	stas =  tb.Int16Col()
  	stae =  tb.Int16Col()
  	tatyp =  tb.Int16Col()
  	afilf =  tb.Int16Col()
  	afils =  tb.Int16Col()
  	nofilf =  tb.Int16Col()
  	nofils =  tb.Int16Col()
  	lcf =  tb.Int16Col()
  	hcf =  tb.Int16Col()
  	lcs =  tb.Int16Col()
  	hcs =  tb.Int16Col()
  	year =  tb.Int16Col()
  	day =  tb.Int16Col()
  	hour =  tb.Int16Col()
  	minute =  tb.Int16Col()
  	sec =  tb.Int16Col()
  	timebas =  tb.Int16Col()
  	trwf =  tb.Int16Col()
  	grnors =  tb.Int16Col()
  	grnofr =  tb.Int16Col()
  	grnlof =  tb.Int16Col()
  	gaps =  tb.Int16Col()
  	otrav =  tb.Int16Col() 
  	d1 = tb.Float32Col() 
  	f1 = tb.Float32Col() 
  	d2 = tb.Float32Col() 
  	f2 = tb.Float32Col() 
  	ShotPoint =  tb.Int32Col() 
  	unscale =  tb.Int16Col() 
  	TraceValueMeasurementUnit =  tb.Int16Col()
  	TransductionConstantMantissa =  tb.Int32Col()
  	TransductionConstantPower =  tb.Int16Col()
  	TransductionUnit =  tb.Int16Col()
  	TraceIdentifier =  tb.Int16Col()
  	ScalarTraceHeader =  tb.Int16Col()
  	SourceType =  tb.Int16Col()
  	SourceEnergyDirectionMantissa =  tb.Int32Col()
  	SourceEnergyDirectionExponent =  tb.Int16Col()
  	SourceMeasurementMantissa =  tb.Int32Col()
  	SourceMeasurementExponent =  tb.Int16Col()
  	SourceMeasurementUnit =  tb.Int16Col()
  	UnassignedInt1 =  tb.Int32Col()
  	ns1 =  tb.Int32Col()
  	data = tb.Float32Col(2000) 
  	
  h5file = tb.openFile("test1.h5", mode = "w", title = "Test file")
  group = h5file.createGroup("/", 'line1', 'Line 1 Survey')
  table = h5file.createTable(group, 'data', Trace, "Trace Example")
new_contents: #initial tests to see if pytables is
  #suitable for storing seismic data
  # sf, 1-jul-2013
  
  import tables as tb
  import numpy as np
  import su
  import definitions as d
  
  	
  h5file = tb.openFile("test1.h5", mode = "w", title = "Test file")
  group = h5file.createGroup("/", 'line1', 'Line 1 Survey')
  table = h5file.createTable(group, 'data', d.Trace, "Trace Example")
  
  database = table.row
  
  tmp = su.readSU('shot-gathers.su')
  for trace in tmp:
  	for name in trace.dtype.names:
  		database[name] = trace[name]
  	database.append()
  table.flush()
  
  cdp = [x for x in table.iterrows() if x['cdp'] == 100]
subject: split test into read and write.