Skip to content

Commit

Permalink
Long Data Profile: Optional Phase (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l authored Dec 11, 2023
1 parent 13f0e45 commit 0cf9cac
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lasy/profiles/longitudinal/longitudinal_profile_from_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ def __init__(self, data, lo, hi):
# First find central frequency
wavelength = data["axis"]
spectral_intensity = data["intensity"]
spectral_phase = data["phase"]
if data.get("phase") is None:
spectral_phase = np.zeros_like(wavelength)
else:
spectral_phase = data["phase"]
dt = data["dt"]
cwl = np.sum(spectral_intensity * wavelength) / np.sum(spectral_intensity)
cfreq = c / cwl
Expand Down Expand Up @@ -106,7 +109,10 @@ def __init__(self, data, lo, hi):
elif data["datatype"] == "temporal":
time = data["axis"]
temporal_intensity = data["intensity"]
temporal_phase = data["phase"]
if data.get("phase") is None:
temporal_phase = np.zeros_like(time)
else:
temporal_phase = data["phase"]
cwl = data["wavelength"]

else:
Expand Down

0 comments on commit 0cf9cac

Please sign in to comment.