Skip to content
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

Open
wants to merge 9 commits into
base: winter23
Choose a base branch
from

Conversation

pietro14
Copy link
Contributor

No description provided.

To solve error issue when using h5 files (old python digitization)  

AttributeError: 'Values' object has no attribute 'tmpname'
@pietro14
Copy link
Contributor Author

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))
Copy link
Collaborator

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
Copy link
Collaborator

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

@pietro14
Copy link
Contributor Author

Now everything should be better. The actual changes are only in the recostruction.py at:

line 499
line 899

The rest (spaces and blank lines) must be a bug of github

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants