def split_hdf_path(fname, subgroup=None):
	"""Split an hdf path of the form path.hdf/group, where the group part is
	optional, into the path and the group parts. If subgroup is specified, then
	it will be appended to the group informaiton. returns fname, group. The
	fname will be a string, and the group will be a string or None. Raises
	a ValueError if the fname is not recognized as a hdf file."""
	for suf in [".hdf", ".h5"]:
		name, _, group = fname.rpartition(suf)
		if not name: continue
		name += suf
		if not group: return name, subgroup
		elif group[0] == "/":
			group = group[1:]
			if subgroup: group += "/" + subgroup
			return name, group
	raise ValueError("Not an hdf path")