I’m curious what Catalog.append(record)
does in Python? Is the record deep copied or shallow-copied, assuming the two catalogs have the same schema?
This comes up in the context of star selectors. BaseStarSelector.run
would like to set a flag in the input catalog and the returned subset catalog for every source in the returned subset catalog. Is it safe to simply set the flag for every source in that subset catalog (that would work if the subset contains shallow copies of records)?
Also, setting the flag using an explicit loop is quite slow (even using a key) and I’m wondering if there is a better way. I’d like to use the numpy array interface, but can a catalog containing shallow pointers to records be contiguous? Obviously it could be done in C++ but a full suite of optimized functions would be huge (get flag, set flag, comparison operators…).
Also, for my own record: update the documentation of BaseStarSelector.run
and .selectStars
to say whether the returned catalog contains shallow or deep copies of records. The lack of documentation suggests “deep” but explicit is better than implicit.