Databases Reference
In-Depth Information
# Perform charge estimation
charge
=
charge_estimator
(
first_det
,
second_det
,
interval
=
dt
)
# Write charge to file
grp
.
attrs
[
'charge'
]
=
charge
print
"For group
%s
, got charge
%.2g
"
%
(
grp
.
name
,
charge
)
>>>
for
grp
in
f
.
itervalues
():
...
update_particle_group
(
grp
)
The same goes for analysis that creates output datasets instead of just scalars. The key
point here is to transition from thinking of the HDF5 container as a
file
to treating it as
a
database
.
Don't get carried away. Keep backups of your data in case you acci‐
dentally do something wrong.
We've covered the four main objects in the HDF5 universe: files, groups, datasets, and
attributes. Now it's time to take a break and talk about the HDF5
type
system, and what
it can do for you.