Project: datamanagement
Issue DM-820: Simplify copying tables while adding columns
Currently, if I want to copy a table while adding a few columns (as specified by schema in the example) I need to do something like: {code} cat = afwTable.SourceCatalog(schema) cat.table.defineCentroid(srcCat.table.getCentroidDefinition()) cat.table.definePsfFlux(srcCat.table.getPsfFluxDefinition()) # etc. scm = afwTable.SchemaMapper(srcCat.getSchema(), schema) for schEl in srcCat.getSchema(): scm.addMapping(schEl.getKey(), True) cat.extend(srcCat, True, scm) {code} Please make this easier! For example - by adding a flag to the SchemaMapper constructor that automatically does the addMapping (should this be the default?) - by making it possible to copy all the slots (maybe this'll be the case when the new alias scheme is implemented?). Maybe we just need a new method: {code} cat = srcCat.extend(schema) {code} that does all the above steps.
Story points: 4