Skip to content

Commit

Permalink
refactor array initialisation
Browse files Browse the repository at this point in the history
  • Loading branch information
RobBuchananCompPhys committed Feb 21, 2025
1 parent 8224191 commit 3a405ca
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions MDANSE/Src/MDANSE/Mathematics/Signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -972,13 +972,11 @@ def power_spectrum(
output = {"romega": instrument_resolution["romega"]}

for element in atom_selection["unique_names"]:
output["pacf_%s" % element] = np.zeros(
np.array(range(frames["n_frames"])).shape
)
output["pps_%s" % element] = np.zeros(output["romega"].shape)
output[f"pacf_{element}"] = np.zeros(frames["n_frames"])
output[f"pps_{element}"] = np.zeros_like(output["romega"])

output["pacf_total"] = np.zeros(np.array(range(frames["n_frames"])).shape)
output["pps_total"] = np.zeros(output["romega"].shape)
output["pacf_total"] = np.zeros(frames["n_frames"])
output["pps_total"] = np.zeros_like(output["romega"])

for index in range(num_atoms):
indexes = atom_selection["indices"][index]
Expand Down

0 comments on commit 3a405ca

Please sign in to comment.