From 6f953d4e73875ebd1cbc9be4f6493aa8e653ee09 Mon Sep 17 00:00:00 2001 From: pupperemeritus Date: Mon, 23 Oct 2023 19:22:24 +0530 Subject: [PATCH 1/2] Fixed subcs duplication --- stingray/crossspectrum.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stingray/crossspectrum.py b/stingray/crossspectrum.py index 8af2a62f0..9a9424009 100644 --- a/stingray/crossspectrum.py +++ b/stingray/crossspectrum.py @@ -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: From 1ba21e77b9ec7afbcea592ad12ea55d54d9973a3 Mon Sep 17 00:00:00 2001 From: pupperemeritus Date: Mon, 23 Oct 2023 19:31:05 +0530 Subject: [PATCH 2/2] Added changelog --- docs/changes/776.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/changes/776.bugfix.rst diff --git a/docs/changes/776.bugfix.rst b/docs/changes/776.bugfix.rst new file mode 100644 index 000000000..b0ec56ec0 --- /dev/null +++ b/docs/changes/776.bugfix.rst @@ -0,0 +1 @@ +Fixed subcs duplication by adding a check in the for loop that copies the attributes from table's meta items. \ No newline at end of file