Skip to content

Commit

Permalink
Merge pull request #776 from pupperemeritus/subcs_duplication_removal
Browse files Browse the repository at this point in the history
Fixed subcs duplication
  • Loading branch information
matteobachetti authored Oct 24, 2023
2 parents 4e13786 + 1ba21e7 commit b2c2889
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/changes/776.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed subcs duplication by adding a check in the for loop that copies the attributes from table's meta items.
7 changes: 4 additions & 3 deletions stingray/crossspectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -2266,9 +2266,10 @@ def _create_crossspectrum_from_result_table(table, force_averaged=False):
cs.unnorm_cs_all = np.array(table.meta["unnorm_subcs"])

for attr, val in table.meta.items():
setattr(cs, attr, val)
setattr(cs.pds1, attr, val)
setattr(cs.pds2, attr, val)
if not attr.endswith("subcs"):
setattr(cs, attr, val)
setattr(cs.pds1, attr, val)
setattr(cs.pds2, attr, val)

cs.err_dist = "poisson"
if cs.variance is not None:
Expand Down

0 comments on commit b2c2889

Please sign in to comment.