Module Expr Str ImportFrom alias Import alias Import alias Assign NameStore Str FunctionDef arguments args defaults body Expr Call NameLoad Str NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call NameLoad Expr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call NameLoad Expr Call NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Expr Call NameLoad Expr Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr decorator_list Assign NameStore Str ImportFrom alias ImportFrom alias Assign NameStore Str ClassDef bases NameLoad body Assign NameStore Call NameLoad Num Assign NameStore Call NameLoad Assign NameStore Call NameLoad Assign NameStore Call NameLoad Assign NameStore Call NameLoad Assign NameStore Call NameLoad Assign NameStore Call NameLoad Assign NameStore Call NameLoad decorator_list Assign NameStore Str Assign NameStore Call NameLoad Str keyword Str keyword Str Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Str Str Str Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str NameLoad Str Expr Call NameLoad NameLoad Expr Call NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr For NameStore Call NameLoad Num body Assign SubscriptStore NameLoad Index Str BinOpMod Str NameLoad Assign SubscriptStore NameLoad Index Str BinOpMod NameLoad Num Assign SubscriptStore NameLoad Index Str BinOpMod BinOpMult NameLoad Num BinOpLShift Num Num Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str BinOpSub Num NameLoad Assign SubscriptStore NameLoad Index Str Call NameLoad BinOpMult NameLoad NameLoad Assign SubscriptStore NameLoad Index Str Call NameLoad BinOpPow SubscriptLoad NameLoad Index Str Num Assign SubscriptStore NameLoad Index Str BinOpMult NameLoad BinOpPow Num Num Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign NameStore Str Assign NameStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore ListComp SubscriptLoad NameLoad Index Str comprehension NameStore NameLoad BoolOpAnd CompareGt SubscriptLoad NameLoad Index Str Num CompareLtELt Num SubscriptLoad NameLoad Index Str Num Expr Call NameLoad NameLoad Assign NameStore ListComp SubscriptLoad NameLoad Index Str comprehension NameStore NameLoad BoolOpAnd CompareGt SubscriptLoad NameLoad Index Str Num CompareLtELt Num SubscriptLoad NameLoad Index Str Num Expr Call NameLoad NameLoad Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str Str Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad Str Call NameLoad NameLoad Str Expr Call NameLoad Call AttributeLoad NameLoad attr Str Str NameLoad Str Expr Call NameLoad NameLoad Assign NameStore Str Expr Call AttributeLoad NameLoad attr Expr Call NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Str Assign NameStore Str Assign NameStore Call NameLoad Str Str Expr Call NameLoad NameLoad Expr Call NameLoad For NameStore NameLoad body Expr Call NameLoad NameLoad Expr Call NameLoad For NameStore Call AttributeLoad NameLoad attr Str body Expr Call NameLoad NameLoad Expr Call NameLoad For NameStore Call AttributeLoad NameLoad attr Str body For NameStore Call AttributeLoad NameLoad attr NameLoad keyword Str body Expr Call NameLoad NameLoad Expr Call NameLoad For NameStore Call AttributeLoad NameLoad attr Str Str body Expr Call NameLoad NameLoad Expr Call NameLoad For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str body Expr Call NameLoad NameLoad Assign NameStore Str Assign NameStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign AttributeStore AttributeLoad NameLoad attr attr Str Assign AttributeStore AttributeLoad NameLoad attr attr Num Assign AttributeStore AttributeLoad NameLoad attr attr Str Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore AttributeLoad NameLoad attr attr ListLoad Num TupleLoad Num Num Str Expr Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr Delete AttributeDel AttributeLoad NameLoad attr attr Expr Call NameLoad AttributeLoad NameLoad attr Expr Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Expr Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr TryExcept body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str handlers ExceptHandler body Expr Call NameLoad Expr Call AttributeLoad NameLoad attr Expr Call NameLoad Expr Call AttributeLoad NameLoad attr Str Assign NameStore Str Expr Call NameLoad Expr Call NameLoad Str NameLoad Expr Call NameLoad Expr Call NameLoad Str AttributeLoad NameLoad attr Expr Call NameLoad Expr Call NameLoad Str AttributeLoad NameLoad attr Expr Call NameLoad Expr Call NameLoad Str AttributeLoad NameLoad attr Expr Call NameLoad Expr Call NameLoad Str Expr Call NameLoad For NameStore AttributeLoad NameLoad attr body Expr Call NameLoad NameLoad BinOpMod Str TupleLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Expr Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str Str Expr Call NameLoad Expr Call NameLoad Str Call NameLoad NameLoad Expr Call NameLoad Expr Call NameLoad Str AttributeLoad NameLoad attr Expr Call NameLoad Expr Call NameLoad Str AttributeLoad NameLoad attr Expr Call NameLoad Expr Call NameLoad Str AttributeLoad NameLoad attr Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call NameLoad NameLoad Expr Call NameLoad Expr Call NameLoad Str Call NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr Expr Call NameLoad NameLoad Expr Call NameLoad Str Call NameLoad NameLoad Expr Call NameLoad Str Expr Call NameLoad For NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body Expr Call NameLoad SubscriptLoad NameLoad Index NameLoad Str SubscriptLoad NameLoad Index NameLoad Expr Call NameLoad AttributeLoad NameLoad attr Assign NameStore Str Assign NameStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore AttributeLoad NameLoad attr For NameStore Call NameLoad Num Num body Assign SubscriptStore NameLoad Index Str BinOpMod Str NameLoad Assign SubscriptStore NameLoad Index Str BinOpMod NameLoad Num Assign SubscriptStore NameLoad Index Str BinOpMod BinOpMult NameLoad Num BinOpLShift Num Num Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str BinOpSub Num NameLoad Assign SubscriptStore NameLoad Index Str Call NameLoad BinOpMult NameLoad NameLoad Assign SubscriptStore NameLoad Index Str Call NameLoad BinOpPow SubscriptLoad NameLoad Index Str Num Assign SubscriptStore NameLoad Index Str BinOpMult NameLoad BinOpPow Num Num Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call NameLoad For NameStore NameLoad body Expr Call NameLoad BinOpMod Str TupleLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Expr Call NameLoad Call AttributeLoad NameLoad attr Num Num Expr Call AttributeLoad NameLoad attr
N/A N/A Small but quite comprehensive example showing the use of PyTables.

The program creates an output file, 'tutorial1.h5'.  You can view it
with any HDF5 generic utility.

 __future__ print_function N/A os N/A traceback N/A SECTION I HAVE NO TITLE tutsep N/A N/A N/A N/A N/A N/A print ----8<---- SECTION ----8<---- N/A tutprint N/A N/A obj N/A N/A N/A N/A tutsep N/A N/A print obj N/A tutrepr N/A N/A obj N/A N/A N/A N/A tutsep N/A N/A print N/A repr obj N/A tutexc N/A N/A N/A N/A N/A N/A tutsep N/A N/A N/A traceback print_exc file N/A sys stdout N/A N/A SECTION Importing tables objects numpy * tables * N/A SECTION Declaring a Column Descriptor Particle N/A IsDescription N/A N/A name N/A StringCol 16 N/A idnumber N/A Int64Col N/A ADCcount N/A UInt16Col N/A TDCcount N/A UInt8Col N/A grid_i N/A Int32Col N/A grid_j N/A IntCol N/A pressure N/A Float32Col N/A energy N/A FloatCol N/A N/A SECTION Creating a PyTables file from scratch N/A h5file N/A open_file tutorial1.h5 mode w title Test file N/A SECTION Creating a new group N/A group N/A N/A h5file create_group / detector Detector information N/A SECTION Creating a new table N/A table N/A N/A h5file create_table group readout Particle Readout example N/A N/A tutprint h5file N/A N/A tutrepr h5file N/A particle N/A table row N/A i N/A range 10 N/A N/A N/A particle N/A name N/A Particle: %6d i N/A N/A particle N/A TDCcount N/A i 256 N/A N/A particle N/A ADCcount N/A N/A i 256 N/A 1 16 N/A N/A particle N/A grid_i i N/A N/A particle N/A grid_j N/A 10 i N/A N/A particle N/A pressure N/A float N/A i i N/A N/A particle N/A energy N/A float N/A N/A particle N/A pressure 4 N/A N/A particle N/A idnumber N/A i N/A 2 34 N/A N/A N/A particle append N/A N/A N/A table flush N/A SECTION Reading (and selecting) data in a table N/A table N/A N/A N/A h5file root detector readout N/A pressure N/A N/A x N/A pressure N/A x table N/A N/A N/A x N/A TDCcount 3 N/A 20 N/A x N/A pressure 50 N/A N/A tutrepr pressure N/A names N/A N/A x N/A name N/A x table N/A N/A N/A x N/A TDCcount 3 N/A 20 N/A x N/A pressure 50 N/A N/A tutrepr names N/A SECTION Creating new array objects N/A gcolumns N/A N/A h5file create_group N/A h5file root columns Pressure and Name N/A N/A tutrepr N/A N/A h5file create_array gcolumns pressure N/A array pressure Pressure column selection N/A N/A tutrepr N/A N/A h5file create_array /columns name names Name column selection N/A N/A tutprint h5file N/A SECTION Closing the file and looking at its content N/A N/A N/A h5file close N/A N/A tutsep N/A N/A N/A os system h5ls -rd tutorial1.h5 N/A N/A tutsep N/A N/A N/A os system ptdump tutorial1.h5 N/A This example shows how to browse the object tree and enlarge tables.

Before to run this program you need to execute first tutorial1-1.py
that create the tutorial1.h5 file needed here.

 N/A SECTION Traversing the object tree N/A h5file N/A open_file tutorial1.h5 a N/A N/A tutprint h5file N/A N/A tutsep N/A node h5file N/A N/A N/A print node N/A N/A tutsep N/A group N/A N/A h5file walk_groups / N/A N/A N/A print group N/A N/A tutsep N/A group N/A N/A h5file walk_groups / N/A N/A array N/A N/A h5file list_nodes group classname Array N/A N/A N/A print array N/A N/A tutsep N/A array N/A N/A h5file walk_nodes / Array N/A N/A N/A print array N/A N/A tutsep N/A leaf N/A N/A N/A h5file root detector Leaf N/A N/A N/A print leaf N/A SECTION Setting and getting user attributes N/A table N/A N/A N/A h5file root detector readout N/A N/A N/A table attrs gath_date Wed, 06/12/2003 18:33 N/A N/A N/A table attrs temperature 18.4 N/A N/A N/A table attrs temp_scale Celsius N/A detector N/A N/A h5file root detector N/A N/A N/A detector _v_attrs stuff N/A 5 N/A 2.3 4.5 Integer and tuple N/A N/A tutrepr N/A N/A table attrs gath_date N/A N/A tutrepr N/A N/A table attrs temperature N/A N/A tutrepr N/A N/A table attrs temp_scale N/A N/A tutrepr N/A N/A detector _v_attrs stuff N/A N/A N/A table attrs gath_date N/A N/A tutrepr N/A table attrs N/A N/A tutprint N/A N/A N/A table attrs _f_list user N/A N/A tutprint N/A N/A N/A table attrs _f_list sys N/A N/A N/A N/A table attrs _f_rename temp_scale tempScale N/A N/A tutprint N/A N/A N/A table attrs _f_list N/A N/A N/A N/A N/A N/A table attrs _f_rename VERSION version N/A N/A N/A N/A N/A tutexc N/A N/A N/A h5file flush N/A N/A tutsep N/A N/A N/A os system h5ls -vr tutorial1.h5/detector/readout N/A SECTION Getting object metadata N/A N/A tutsep N/A N/A print Object: table N/A N/A tutsep N/A N/A print Table name: N/A table name N/A N/A tutsep N/A N/A print Table title: N/A table title N/A N/A tutsep N/A N/A print Number of rows in table: N/A table nrows N/A N/A tutsep N/A N/A print Table variable names with their type and shape: N/A N/A tutsep N/A name N/A table colnames N/A N/A N/A print name N/A := %s, %s N/A N/A N/A table coltypes N/A name N/A N/A table colshapes N/A name N/A N/A tutprint N/A table __doc__ N/A pressureObject N/A N/A h5file get_node /columns pressure N/A N/A tutsep N/A N/A print Info on the object: N/A repr pressureObject N/A N/A tutsep N/A N/A print  shape: ==> N/A pressureObject shape N/A N/A tutsep N/A N/A print  title: ==> N/A pressureObject title N/A N/A tutsep N/A N/A print  type: ==> N/A pressureObject type N/A SECTION Reading data from Array objects N/A pressureArray N/A N/A pressureObject read N/A N/A tutrepr pressureArray N/A N/A tutsep N/A N/A print pressureArray is an object of type: N/A type pressureArray N/A nameArray N/A N/A N/A N/A N/A h5file root columns name read N/A N/A tutrepr nameArray N/A N/A print nameArray is an object of type: N/A type nameArray N/A N/A tutprint Data on arrays nameArray and pressureArray: N/A N/A tutsep N/A i N/A range N/A N/A pressureObject shape N/A 0 N/A N/A N/A print N/A nameArray N/A i --> N/A pressureArray N/A i N/A N/A tutrepr N/A pressureObject name N/A SECTION Appending data to an existing table N/A table N/A N/A N/A h5file root detector readout N/A particle N/A table row N/A i N/A range 10 15 N/A N/A N/A particle N/A name N/A Particle: %6d i N/A N/A particle N/A TDCcount N/A i 256 N/A N/A particle N/A ADCcount N/A N/A i 256 N/A 1 16 N/A N/A particle N/A grid_i i N/A N/A particle N/A grid_j N/A 10 i N/A N/A particle N/A pressure N/A float N/A i i N/A N/A particle N/A energy N/A float N/A N/A particle N/A pressure 4 N/A N/A particle N/A idnumber N/A i N/A 2 34 N/A N/A N/A particle append N/A N/A N/A table flush N/A N/A tutsep N/A r table N/A N/A N/A print N/A %-16s | %11.1f | %11.4g | %6d | %6d | %8d | N/A N/A r N/A name N/A r N/A pressure N/A r N/A energy N/A r N/A grid_i N/A r N/A grid_j N/A r N/A TDCcount N/A N/A tutrepr N/A N/A table remove_rows 5 10 N/A N/A N/A h5file close