-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solve minor issue for h5 files #268
base: winter23
Are you sure you want to change the base?
Conversation
To solve error issue when using h5 files (old python digitization) AttributeError: 'Values' object has no attribute 'tmpname'
I found an easier way to fix this. Just by not flipping the image when reading h5 files. I'll update the PR soon. Hopefully h5 fiels won't be used anymore. |
@@ -892,7 +892,7 @@ def reconstruct(self,evrange=(-1,-1,-1)): | |||
postfix = 'mid.gz' | |||
options.tmpname = "%s/%s%05d.%s" % (tmpdir,prefix,int(options.run),postfix) | |||
else: | |||
if options.rawdata_tier == 'root': | |||
if options.rawdata_tier == 'root' or options.rawdata_tier == 'h5': | |||
file_url = sw.swift_root_file(options.tag, int(options.run)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this added? swift_root_file returns a .root address which cannot work for h5, right?. If you are not downloading the h5 files, I would add a if statement and a print with a sys.exit() in case you reach this part of the code and it seems you need to download a h5 file. Now h5 is not downloadable and we will add this feature when/if it will be necessary. Does this make sense?
utilities.py
Outdated
if rawdata_tier == 'h5': | ||
img_fr = rootfile[key][:].T #necessary because uproot inverts column and rows with x and y | ||
else: | ||
img_fr = rootfile[key].values().T #necessary because uproot inverts column and rows with x and y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the if tag=='MAN' needs to be inside the root tier case
This way there is no need to change the utilities.py
Now everything should be better. The actual changes are only in the recostruction.py at: line 499 The rest (spaces and blank lines) must be a bug of github |
No description provided.