From 083a84ebfd67da3f36abe93b577e7cd1851c5624 Mon Sep 17 00:00:00 2001 From: Tom Aldcroft Date: Mon, 3 Feb 2020 07:28:16 -0500 Subject: [PATCH] Ensure copy of ACATable is a deep copy Previously astropy Table was making a deep copy of meta attributes but this changed for improved efficiency. --- proseco/catalog.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/proseco/catalog.py b/proseco/catalog.py index 0be8974a..0386e326 100644 --- a/proseco/catalog.py +++ b/proseco/catalog.py @@ -1,6 +1,7 @@ import traceback import numpy as np from itertools import count +import copy from astropy.table import Column, Table @@ -191,6 +192,12 @@ class ACATable(ACACatalogTable): t_ccd_eff_acq = MetaAttribute(is_kwarg=False) t_ccd_eff_guide = MetaAttribute(is_kwarg=False) + def __copy__(self): + # Astropy Table now does a light key-only copy of the `meta` dict, so + # copy.copy(aca) does not copy the underlying table attributes. Force + # a deepcopy instead. + return copy.deepcopy(self) + @property def t_ccd(self): # For top-level ACATable object use the guide temperature, which is always