ebachelet / pyLIMA

GNU General Public License v3.0
30 stars 8 forks source link

PSPL with parallax fit failure #38

Closed Nijaid closed 5 years ago

Nijaid commented 5 years ago

When fitting a PSPL event with parallax using Earth and Space telescopes, the DE method fails to give a sensible solution, converging upon something with parameters way off from the non-parallax with LM fit, even outputting 'nan' for the parameter errors. How can I start looking for what is going wrong? If it's of any help, the Space data is mostly at the event peak, while the Earth data covers the peak and baseline. Also, the Space data is entered in as flux rather than magnitude.

ebachelet commented 5 years ago

Hi Nijaid.

Do you have a subset of the code ? There is several points where it could go wrong :

Nijaid commented 5 years ago

Here is my input. From what I can see, I did follow those specifications.

ogle = telescopes.Telescope(name='OGLE', camera_filter='I', light_curve_magnitude=ogle_dat) myevent.telescopes.append(ogle)

spitz3[:, 0] += 2450000.0 # pyLIMA requires HJD

spitzer = telescopes.Telescope(name='SPITZER', camera_filter='IRAC1',light_curve_flux=spitz3)

spitzer.location = 'Space'

spitzer.spacecraft_name = 'Spitzer'

myevent.telescopes.append(spitzer)

ebachelet commented 5 years ago

Try with lightcurve_magnitude and lightcurve_flux instead of light_curve_magnitude and light_curve_flux

Nijaid commented 5 years ago

light_curve_magnitudeand light_curve_flux are the keywords for initializing the telescope object, though. Do you mean specifying it after initialization?

Nijaid commented 5 years ago

If I try telescopes.Telescope(name='OGLE', camera_filter='I', lightcurve_magnitude=ogle_dat) I get TypeError: __init__() got an unexpected keyword argument 'lightcurve_magnitude'

ebachelet commented 5 years ago

Ah yes sorry you right, forgot what I said. What are the format of your Spitzer flux? If this is difference flux (i.e you have some negative values) you might want to add a reference_flux to obtain positive values. Also, you can set clean_the_lightcurve='No' to avoid automatic outlier rejection.

Nijaid commented 5 years ago

The flux is in arbitrary units, but they're all positive. I also tried turning off the cleaning, but obtained the same results.

ebachelet commented 5 years ago

Did you set the event.ra and event.dec?

Also, what is you DE_population? What is your parallax model? Did you set t0_par close to the event peak?

Nijaid commented 5 years ago

I did set the RA and DEC, although I didn't show it when copying the code above. The parallax model is 'Full' and I set t0_par as the rounded value of the non-parallax fit t0, as was done in Example 5. However, I don't know how to check what the DE_population is.

ebachelet commented 5 years ago

Hi Nijaid

If you send me the materials you use, I can have a closer look to what went wrong.

Cheers

On Mon, Jun 24, 2019 at 2:46 PM Nijaid Arredondo notifications@github.com wrote:

I did set the RA and DEC, although I didn't show it when copying the code above. The parallax model is 'Full' and I set t0_par as the rounded value of the non-parallax fit t0, as was done in Example 5.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/ebachelet/pyLIMA/issues/38?email_source=notifications&email_token=ADRO2DNLNDDY4MLHAZNXFA3P4E6C5A5CNFSM4H3CGJY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYOKNXY#issuecomment-505194207, or mute the thread https://github.com/notifications/unsubscribe-auth/ADRO2DL44VIKSTFRIDOLORDP4E6C5ANCNFSM4H3CGJYQ .

Nijaid commented 5 years ago

Sure, could you let me know the email to send it to? Thank you very much for working on this.

On Mon, Jun 24, 2019, 2:51 PM ebachelet notifications@github.com wrote:

Hi Nijaid

If you send me the materials you use, I can have a closer look to what went wrong.

Cheers

On Mon, Jun 24, 2019 at 2:46 PM Nijaid Arredondo <notifications@github.com

wrote:

I did set the RA and DEC, although I didn't show it when copying the code above. The parallax model is 'Full' and I set t0_par as the rounded value of the non-parallax fit t0, as was done in Example 5.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub < https://github.com/ebachelet/pyLIMA/issues/38?email_source=notifications&email_token=ADRO2DNLNDDY4MLHAZNXFA3P4E6C5A5CNFSM4H3CGJY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYOKNXY#issuecomment-505194207 , or mute the thread < https://github.com/notifications/unsubscribe-auth/ADRO2DL44VIKSTFRIDOLORDP4E6C5ANCNFSM4H3CGJYQ

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ebachelet/pyLIMA/issues/38?email_source=notifications&email_token=AFMUFZRQRUOME3DY3NO6GKDP4E6X5A5CNFSM4H3CGJY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYOKZ6A#issuecomment-505195768, or mute the thread https://github.com/notifications/unsubscribe-auth/AFMUFZWI4NBB2KSWZLEXTK3P4E6X5ANCNFSM4H3CGJYQ .

ebachelet commented 5 years ago

etibachelet@gmail.com

ebachelet commented 5 years ago

Is this resolve now?

Nijaid commented 5 years ago

It is! Thank you for letting me know how to constrain the parameters.

On Tue, Jun 25, 2019 at 10:48 AM ebachelet notifications@github.com wrote:

Is this resolve now?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ebachelet/pyLIMA/issues/38?email_source=notifications&email_token=AFMUFZTKRJDWJ7MJQIBXACDP4JK57A5CNFSM4H3CGJY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYRBQ7Q#issuecomment-505550974, or mute the thread https://github.com/notifications/unsubscribe-auth/AFMUFZRB63GYJRXRRUA5NHTP4JK57ANCNFSM4H3CGJYQ .

ebachelet commented 5 years ago

For the record, to constrain a parameter i for the DE fit:

Model.parameters_boundaries[i] = [min_i,max_i]