Inserting fake moving objects into calexps using gen3

I am using the lsst_distrib version _w2021_46 and would like to insert fake moving objects in to calibrated exposures using gen3 middleware. I have a csv file of objects with ra, dec, mag, mjd, exposure and would like to insert these in the appropriate exposures. Is there any direct functionality to achieve this.

Previously, with gen2 I used to create a separate catalog per exposure, and then run the following:

processCcdWithFakes.py ../repo --calib ../repo/CALIB --rerun coadd:fakes_n1 -C processCcdWithFakes.py -c insertFakes.fakeType=Catalogs/123456.csv --id visit=123456 ccd=0..8^10..103 filter=HSC-R2 tract=tractlist

Is there a better way of doing this in gen3? I suppose the tedious route would be to register each of the Catalog files for every exposure as a dataset in a separate collection, and then pass the collection as an input to pipetask as done here: [DM-31491] Make a RC2 fakes pipeline - Jira

I am pretty sure there is a better way to do this, perhaps adding an extra dimension of exposure to fakeCat, but I suppose that will still require the code to be modified.

The documentation for self.config.insertFakes.fakeType == "snapshot" is pretty sparse and it was unclear how I could use it either? And it seemed more suited to variable object rather than moving objects.

Could some one help out with this?

The way you suggest here should work and give you a viable answer though, as you mention, it would take a bit to pipeline. This is also the only way to do it without modifying code.

If you want to modify the code slightly, you could add a cut on your mjd value to the method trimFakeCat so that the mjd is within some range of the mjd time stored in the image variable.

There are a couple of ways we could modify the code to do this, if you want to try pair coding it at some point I’d be happy to help.