multidworlds / eigenspectra

Eigenspectra
MIT License
0 stars 5 forks source link

Change eigencurve fit to output full posteriors for error estimation #34

Open jarcangeli opened 5 years ago

meganmansfield commented 5 years ago

The new versions of eigencurves.py and lightcurves_sh.py necessary for the updates to this step are in the "megan" branch. Here are the changes to the code:

  1. You can now select to fit with a different degree spherical harmonic. The default setting is 3, but by changing degree=2 or degree=4 you can edit this.
  2. The code uses BIC to select the correct number of eigencurves to include in the fit.
  3. The code outputs a dictionary giving wavelengths and, for each wavelength, the full posterior of spherical harmonic coefficients. Here is the new syntax for using this code:

spheredict=eigencurves.eigencurves(noiseDict,plot=True,degree=3)

Let me know if you get a chance to review how this works and if you find any errors in anything!

Cheers, Megan

adadams commented 5 years ago

Hi Megan,

I pulled your new files into a separate branch and modified my code to use the dictionaries. It ran successfully!

However, I noticed that one particular coefficient always seems to be much higher than the others, consistently across samples and wavelengths. It seems to be the second coefficient! To see what I'm talking about, I did:

print(spherearray['spherical coefficients'][: , 1, :]) which shows all the second coefficients of order 1. But the rest appear to be in the range ~10^-6 to 10^-3. I think they should all be in that range judging from the previous execution...

My branch is called "eigenmaps_posterior", and the state of the notebook should show the behavior. I'm sure it's something minor!

meganmansfield commented 5 years ago

Hi Arthur,

Good catch! There was an error in how I was converting from eigencurve coefficients to spherical harmonics. I think it was just a small typo, and I've now corrected it in the version of eigencurve.py in the "megan" branch. I've tested looking at a few terms in the output to make sure they look reasonable now (on the order of 10^-3 I think), but check it out and let me know what you think!

Cheers, Megan