LCOGT / mop

Microlensing Observation Portal
GNU General Public License v3.0
0 stars 7 forks source link

Real time modeling is lacking #179

Open ebachelet opened 2 months ago

ebachelet commented 2 months ago

I came across this event that has not be fitted since 22 days... https://mop.lco.global/targets/42858/ And this one is 18 days ago https://mop.lco.global/targets/42876/

rachel3834 commented 2 months ago

From the logs, the automatic modeling process is hitting the following exception:

Fitting event: OGLE-2024-BLG-0136
FIT: Found 2 datasets and a total of 1364 datapoints to model for event OGLE-2024-BLG-0136
FITTOOLS: established event
pyLIMA found (and eliminate) some bad_data for telescope Tel_1, please check your_telescope.bad_data
FITTOOLS: appended 2 telescopes
ERROR : There is no associated lightcurve in magnitude or flux with this telescopes : Tel_1, add one with telescope.lightcurve = your_data
Job failed: OGLE-2024-BLG-0136
ebachelet commented 2 months ago

This seems pyLIMA found all data are "bad" for this Tel_1 telescope. Looking inside MOP, I would guess this is g_ZTF datasets that looks indeed kind of bad. A pre_cleaning before pyLIMA might be the way to solve this image

rachel3834 commented 2 months ago

Did you remove the ZTF data from MOP for OGLE-2024-BLG-0134? It does seem to be there now and indeed PyLIMA is able to fit the event happily.

ebachelet commented 2 months ago

LOL no!

rachel3834 commented 2 months ago

OK follow-up question: does PyLIMA have an exceptions library that I can import? It would make it easier to catch this specific error instead of having over-broad try-except clauses.

ebachelet commented 2 months ago

I am afraid no.... Might want to raise an issue on this

rachel3834 commented 2 months ago

In the meantime, I've added more exception handling which should hopefully intercept this case gracefully, but it is proving hard to reproduce the error.

rachel3834 commented 1 month ago

I've found another example of this issue with logging data to prove it: OGLE-2024-BLG-0676

Current time is JD=2460532.347 Timestamp of latest available datapoint is 2460507.76962 Timestamp of latest model is 2460509.93923

When this event is considered for fitting by fit_need_events_PSPL, the logs record: FIT_NEED_EVENTS: Need to fit OGLE-2024-BLG-0676: False, reason: Up to date model FIT_NEED_EVENTS: evaluated target OGLE-2024-BLG-0676, 0 out of 100

This decision is made by the MicrolensingTarget.check_need_to_fit, which compares the timestamp of the latest model and that of the latest data and if the model is more recent, assumes that the current model fit is the best possible.

When I force a new fit for this event using fit_event_PSPL, the resulting fitted model is pretty similar to the old one, since there are no newer datapoints to provide further constraints.

In this case I would argue that MOP is doing the right thing and not using CPU cycles to refit events unnecessarily.