Replies: 1 comment 4 replies
-
I checked to see if it might just be undocumented, but no, there currently isn't a way to pass custom interpretations to But still, it would be a complicated interface. If a branch name is misspelled in that dict, it just wouldn't take effect. Uproot 3 combined the list of branches to read with custom interpretations by accepting it as a dict, rather than a list, but those strings were real branch names, not expressions, in Uproot 3, so such an interface made more sense. Here, it would have to be a separate dict, which increases the possibility of error. Also, passing custom interpretations is uncommon. I see why you're doing it for this timestamp—you happen to know that timestamps are just 4-byte integers, but the streamer is being interpreted otherwise. Actually, can you print out the file.file.show_streamers("TTimeStamp") to see how it's being interpreted? Looking at its header file, it ought to be a pair of 32-bit integers, not just one 32-bit integer. 266 bytes doesn't evenly divide into either 4 or 8. Its prime factorization is 2 × 7 × 19. I doubt the struct size is 2 or 7 (or anything larger), so maybe the basket this is obtaining is wrong somehow? The timestamp is in a branch by itself, right? |
Beta Was this translation helpful? Give feedback.
-
Hi, I am trying to find out how to use
uproot.iterate
on existing root files containing branches for which the correct interpretation is not discovered automatically.On a single file, I can read the data doing something like:
Is there a straightforward possibility to pass the interpretation information for the branches throwing errors (*) also to
uproot.iterate
?Thanks a lot for suggestions!
(*) I am getting errors like: ValueError: basket 0 in tree/branch /some_tree:some_branch has the wrong number of bytes (266) for interpretation AsStridedObjects(Model_TTimeStamp_v1)
Beta Was this translation helpful? Give feedback.
All reactions