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

Header keys missing in read_corsika_headers.py? #18

Open
4 tasks
jebuss opened this issue May 27, 2019 · 4 comments
Open
4 tasks

Header keys missing in read_corsika_headers.py? #18

jebuss opened this issue May 27, 2019 · 4 comments
Labels

Comments

@jebuss
Copy link
Member

jebuss commented May 27, 2019

Is it possible that the following header keys are missing in read_corsika_headers.py?

  • n_showers
  • x_scatter
  • scatter_radius
  • scatter_radius_unit

run_header_columns = [
'run_number',
'date',
'energy_spectrum_slope',
'energy_min',
'energy_max',
]

I saw in pyfact that they are needed:

https://github.com/fact-project/pyfact/blob/91273b419e296e1d94e5b85f1d257872c5d5ac1b/fact/io.py#L484

@maxnoe
Copy link
Member

maxnoe commented May 27, 2019

Ah yes, I did not add them in the read_corsika_headers script, only created the new eventio script

@maxnoe
Copy link
Member

maxnoe commented May 27, 2019

But: x_scatter is note saved into the old headers. So you need to add it manually using h5py.

with h5py.File(file, mode='r+') as f:
    f['corsika_headers'].attrs['scatter_radius'] = 270
    f['corsika_headers'].attrs['scatter_radius_unit'] = 'm'

@jebuss
Copy link
Member Author

jebuss commented May 28, 2019

I see. THX

@maxnoe
Copy link
Member

maxnoe commented May 28, 2019

Also in the fact io function, it looks for either n_showers or n_events, the meaning is the same.

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

No branches or pull requests

2 participants