diff --git a/iop4lib/iop4.py b/iop4lib/iop4.py index d98f739c..a3ffc9af 100644 --- a/iop4lib/iop4.py +++ b/iop4lib/iop4.py @@ -79,6 +79,13 @@ def process_epochs(epochname_list: Iterable[str], args): epoch.compute_relative_photometry() epoch.compute_relative_polarimetry() + logger.info("Auto-flagging points.") + + for result in PhotoPolResult.objects.filter(epoch__in=epoch_L).all(): + if result.p is not None and not (0 <= result.p <= 1): + result.flags.add(PhotoPolResult.FLAGS.ERROR_POLARIMETRY) + result.save() + logger.info("Applying corrections.") for epoch in epoch_L: