Skip to content

Commit

Permalink
Test and fix longitudinal reading for vertical steps
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnoe committed Nov 27, 2023
1 parent 2d4471c commit eaf4fab
Show file tree
Hide file tree
Showing 4 changed files with 454 additions and 11 deletions.
7 changes: 4 additions & 3 deletions corsikaio/longitudinal.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import re
import numpy as np

PARTICLE_HEADER_RE = re.compile(r"LONGITUDINAL DISTRIBUTION IN\s+(\d+)\s+(SLANT\s+)?STEPS OF\s+(\d+(?:.\d*)?) G\/CM\*\*2 FOR SHOWER\s+(\d+)")
ENERGY_HEADER_RE = re.compile(r"LONGITUDINAL ENERGY DEPOSIT IN\s+(\d+)\s+(SLANT\s+)?STEPS OF\s+(\d+(?:.\d*)?) G\/CM\*\*2 FOR SHOWER\s+(\d+)")
PARTICLE_HEADER_RE = re.compile(r"LONGITUDINAL DISTRIBUTION IN\s+(\d+)\s+(SLANT|VERTICAL)\s+STEPS OF\s+(\d+(?:.\d*)?) G\/CM\*\*2 FOR SHOWER\s+(\d+)")
ENERGY_HEADER_RE = re.compile(r"LONGITUDINAL ENERGY DEPOSIT IN\s+(\d+)\s+(SLANT|VERTICAL)\s+STEPS OF\s+(\d+(?:.\d*)?) G\/CM\*\*2 FOR SHOWER\s+(\d+)")

ENERGY_COLUMNS = [
"depth",
Expand Down Expand Up @@ -72,7 +72,8 @@ def read_longitudinal_distributions(path):
n_steps = int(match.group(1))
longi = dict(
shower=int(match.group(4)),
slant=match.group(2) is not None,
n_steps=n_steps,
slant=match.group(2) == "SLANT",
step_width=float(match.group(3)),
)

Expand Down
File renamed without changes.
Loading

0 comments on commit eaf4fab

Please sign in to comment.