winter-telescope / mirar

Modular Image Reduction and Analysis Resource (MIRAR)
MIT License
6 stars 7 forks source link

[BUG] Something wrong in aperture photometry #560

Open robertdstein opened 11 months ago

robertdstein commented 11 months ago

Describe the bug

Error for processor mirar.processors.photometry.aperture_photometry at 2023-07-28 16:22:09.464771 (local time):
   File "/Users/robertstein/Code/mirar/mirar/processors/base_processor.py", line 217, in apply_to_batch
    batch = self.apply(batch)
            ^^^^^^^^^^^^^^^^^
  File "/Users/robertstein/Code/mirar/mirar/processors/base_processor.py", line 243, in apply
    batch = self._apply(batch)
            ^^^^^^^^^^^^^^^^^^
  File "/Users/robertstein/Code/mirar/mirar/processors/base_processor.py", line 513, in _apply
    return self._apply_to_sources(batch)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/robertstein/Code/mirar/mirar/processors/photometry/aperture_photometry.py", line 64, in _apply_to_sources
    fluxes, fluxuncs = self.aperture_photometer.perform_photometry(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/robertstein/Code/mirar/mirar/processors/photometry/base_photometry.py", line 111, in perform_photometry
    flux, fluxunc = aper_photometry(
                    ^^^^^^^^^^^^^^^^
  File "/Users/robertstein/Code/mirar/mirar/processors/photometry/utils.py", line 243, in aper_photometry
    annulus_data_1d = annulus_data[mask > 0]
                      ~~~~~~~~~~~~^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
  This error affected the following files: ['WINTERcamera_20230711-104001-501_mef.fits', 'WINTERcamera_20230711-104207-744_mef.fits', 'WINTERcamera_20230711-104413-375_mef.fits', 'WINTERcamera_20230711-104619-828_mef.fits', 'WINTERcamera_20230711-104826-016_mef.fits']
robertdstein commented 11 months ago

Probably needs a check on size/len somewhere