Details
-
Type:
Improvement
-
Status: To Do
-
Resolution: Unresolved
-
Fix Version/s: None
-
Component/s: afw
-
Labels:
Description
I keep running into a problem of trying to create a "minimally useful" schema that can be used by a Task (joincal in this instance, but others in the past), and having to copy the same large block of self.someKey = self.schema.addField("blah_flux", type="D"), and then realize that the place I copied it from doesn't have one of the fields I actually need in this instance. It would be very handy to have an lsst.afw.table.makeTaskOutputSchema(), in the same vein as table.makeMinimalSchema(), to produce a well-populated table schema that represents some typical output of the stack with all the necessary slots filled in.
With that in hand, we could have an table.makeTaskOutputTestCatalog(int n) that does the above and then creates and returns a table populated with n random values.
It might be enough to have a pre-made table ready in afwdata (one may already exist?), but I'm torn on whether that might not age nicely (e.g. Sigma->Err changes).
I don't think making a "typical" schema can be the responsibility of afw.table, as the entries in typical schemas area really defined by much higher-level Task code. And that suggests one way to get a schema in test code right now: construct an instance of the CmdLineTask whose schema you're interested in, and grab its .schema attribute.
Beyond that, I actually think adding pre-made catalogs in afwdata or a successor is the right approach. But we don't have anything there now.
AFAIK, nothing in afwdata has been touched substantially in ages - we've been waiting for someone to take a stab at making a new test data package, without any clear understanding who that someone is (
DM-1102).