fixing LD bug for joint fits#744
Conversation
|
also adding a minor fix for fleck. Currently if you set the star rotation (spotrot) in the s5 fit params epf file then fleck_fast is never set to anything and the code crashes, this adds the lines to set fleck_fast when spotrot is defined in the epf |
|
I haven't yet confirmed where this bug arises, but as it stands I don't think this patch is quite right. If there's a bug (which I'm certainly willing to believe, though it hasn't arisen for non-multwhite fits), it must be in the interactions between these snippets of code: Eureka/src/eureka/S5_lightcurve_fitting/models/AstroModel.py Lines 146 to 171 in a8b3a8a Eureka/src/eureka/S5_lightcurve_fitting/models/AstroModel.py Lines 306 to 309 in a8b3a8a Eureka/src/eureka/S5_lightcurve_fitting/models/BatmanModels.py Lines 38 to 73 in a8b3a8a If the bug is specifically with loading-in exotic-ld results (and/or custom ld files), then my pretty strong suspicion is that the bug is in the last of those three snippets (from |
|
I added tons of print statements to confirm that the code you reference in BatmanModels sets things up in properly when reading from the exotic values and that the bug arises when BatmanModels.py calls AstroModel/PlanetParams to initialize the planet. AstroModel line 308/309 was previously only looking for u1/u2, never u1_ch1/u2_ch1 and the result was that both visits used the same limb darkening (confirmed with the print statements, visually with the plots, and by switching the order of the visits to see which LD values were used in that case) |
|
I really would've thought that the ld parameters would be populated with the values for ch1 based on the snippet below which is used to set (in the pretend case of some parameter called Eureka/src/eureka/S5_lightcurve_fitting/models/AstroModel.py Lines 149 to 155 in a8b3a8a It is the same snippet that is used for every other variable, with the only exception being that lower down there's a snippet that allows ld parameters and spot parameters to be the same between different planets. |
|
The lines to which you are referring: Eureka/src/eureka/S5_lightcurve_fitting/models/AstroModel.py Lines 308 to 309 in a8b3a8a use |
|
yeah unfortunately they are not set to parameterObject.u1_ch1. self.u1 returns the actual u1 value. If there's a different way you want to fix this happy to do that instead, but as it stands it's not working as expected. |
|
Ahh I see the issue. Lines 149-155 in AstroModel that you linked only set self.u1 to parameterObject.u1_ch1 if the parameter is free. But We often fix to the exotic-values, in which case it doesn't append the channel id. |
|
Ahh yeah, that'd do it! Honestly maybe we don't need that |
|
@erinmmay, can you click the "allow maintainers to push edits to this pull request" (or whatever the exact wording is) button so that I can make some small formatting tweaks at some point tomorrow? |
|
On my end it says that's already enabled. |
|
Okay thanks, must just be an issue with the online GitHub Codespaces then - I'll try using my local git installation later |
|
@erinmmay, I just reworked this patch to (hopefully) more generally catch similar issues with fixed parameters during shared or multwhite fits. Can you please test this new code and make sure it still resolves your original problem? |
|
@erinmmay, have you had the chance to test my edits to this PR? I'd like to get this patch merged if it's good-to-go |
|
@kevin218, do you want to review this PR - it works for me, but would be good to get a second set of eyes on this |
addressing bug #743
I believe this is how we want to do it, limb darkening should have channel id appended regardless of if it's a free fit since we can fix them to different values.