import numpy as np
import tables as tb


class Particle(tb.IsDescription):
    ADCcount = tb.Int16Col()                # signed short integer
    TDCcount = tb.UInt8Col()                # unsigned byte
    grid_i = tb.Int32Col()                  # integer
    grid_j = tb.Int32Col()                  # integer
    idnumber = tb.Int64Col()                # signed long long
    name = tb.StringCol(16, dflt="")        # 16-character String
    pressure = tb.Float32Col(shape=2)       # float  (single-precision)
    temperature = tb.Float64Col()           # double (double-precision)

Particle2 = {
    # You can also use any of the atom factories, i.e. the one which
    # accepts a PyTables type.
    "ADCcount": tb.Col.from_type("int16"),          # signed short integer
    "TDCcount": tb.Col.from_type("uint8"),          # unsigned byte
    "grid_i": tb.Col.from_type("int32"),            # integer
    "grid_j": tb.Col.from_type("int32"),            # integer
    "idnumber": tb.Col.from_type("int64"),          # signed long long