Skip to content

Commit

Permalink
Merge pull request #25 from cta-observatory/fix_longi
Browse files Browse the repository at this point in the history
Fix reading of longitudinal blocks, fixes #24
  • Loading branch information
maxnoe authored Mar 10, 2023
2 parents 029bcb6 + 2127d55 commit d921446
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions corsikaio/subblocks/longitudinal.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
Field(10, "n_cherenkov", shape="f4"),
]

longitudinal_header_dtype = build_dtype(longitudinal_header_fields)
longitudinal_data_dtype = build_dtype(longitudinal_data_fields)
longitudinal_header_dtype = build_dtype(longitudinal_header_fields, itemsize=None)
longitudinal_data_dtype = build_dtype(longitudinal_data_fields, itemsize=None)
6 changes: 3 additions & 3 deletions tests/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ def test_particle_longi():
with CorsikaParticleFile('tests/resources/corsika757_particle') as f:
assert f.run_end['n_events'] == 10

e = next(f)

assert e.header['event_number'] == 1
for i, e in enumerate(f, start=1):
assert e.header['event_number'] == i
assert np.all(e.longitudinal['vertical_depth'] == np.arange(20, 801, 20))


def test_particle_no_parse():
Expand Down

0 comments on commit d921446

Please sign in to comment.