Closed Jayshil closed 7 months ago
Thanks for this catch! Merging...
Hey @Jayshil,
I took a deeper look after merging in dev
on this, and I remembered what happened here. The problem with your fix is that this fix makes juliet
incompatible with previous versions, in which you could just define a prior on p_p1
for instance to fit a wavelength-independant planet-to-star radius ratio.
Just a heads-up that I'm working on this so the final juliet
code might look a bit different on this part than your PR.
N.
Hi @nespinoza,
Thanks for informing me! I did not realise that the extra else
statement there was for juliet
back-compatibility. The changes you made now are a more clear way of doing this. Thanks for doing this!
Cheers, Jayshil
Hi @nespinoza,
The current version of
juliet
(master
anddev
branches, which I believe is the latest stable version) has a bug. While fitting for different parameters forfp
,p
andp1
for different instruments, the sampling will happen only for the last instruments in the list. For example, while fitting forfp_p1_instrument1
andfp_p1_instrument2
, the sampling will happen only for the later parameter and the prior would return as posterior for the former.This is because of a missing
if
statement while creatingself.fp_iname
,self.p_iname
andself.p1_iname
dictionaries in__init__
function of themodel
class (see, changes below to see what I mean). Because of this missingif
statement, thoseself.fp_iname[p1][ins]
etc. dictionaries were kept updating for eachins
in the loop and the final value ofself.fp_iname[p1][ins]
would always correspond to the last instrument in the loop. This PR fixes this issue by adding anif
statement. Let me know if you have any questions on this.Cheers, Jayshil