dirac-institute / kbmod

KBMOD (Kernel-Based Moving Object Detection)
BSD 2-Clause "Simplified" License
46 stars 14 forks source link

I-641 Added feedback on reprojection + creating work unit from fits file #670

Closed vlnistor closed 3 months ago

vlnistor commented 4 months ago

This PR aims to tackle #641. I use tqdm package for feedback

  1. Added feedback during reprojection
  2. Added feedback during the creation of a WorkUnit from fits file
vlnistor commented 4 months ago

When it comes to trying to add feedback on creating a WorkUnit from an ImageCollection I couldn't get an example to work:

  1. discrete_piles_e2e.ipynb contains an example but requires the lsst stack
  2. test_imagecollection.py has a set of mock ImageCollections but they throw when calling toWorkUnit() on them
vlnistor commented 3 months ago

Todo

Testing

Reprojecting:   0%|          | 0/3 [00:00]
Reprojecting: 100%|██████████| 3/3 [00:00]
maxwest-uw commented 3 months ago

I think the line numbers may have gotten shifted around, sorry, there should also be tqdm on this line as well in work_unit.py, the loop

for i in range(num_images):
                sci_hdu = hdul[f"SCI_{i}"]

                # Read in the layered image from different extensions.
                img = LayeredImage(
                    sci_hdu.data.astype(np.single),
                    hdul[f"VAR_{i}"].data.astype(np.single),
                    hdul[f"MSK_{i}"].data.astype(np.single),
                    PSF(hdul[f"PSF_{i}"].data),
                    sci_hdu.header["MJD"],
                )

which is the one that actually loads in the images. Everything else looks good!

vlnistor commented 3 months ago

@maxwest-uw that should all be pushed now. Let me know if anything else