Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running Stage 30 in the Quickstart Tutorial #6

Closed
astrobel opened this issue Oct 19, 2022 · 3 comments
Closed

Error when running Stage 30 in the Quickstart Tutorial #6

astrobel opened this issue Oct 19, 2022 · 3 comments

Comments

@astrobel
Copy link

Hi,

I'm currently working through the Quickstart Tutorial and come across the following error when running Stage 30. I have not altered any parameters in the PCF from the example.

Here's the output & error:

workdir:  ./run_2022-10-19_11-54-11_GJ1214_Hubble13021/
eventlabel:  GJ1214_Hubble13021
Successfully reloaded meta file
Starting s30
Spectroscopic light curve fit(s) will be performed
using most recent s21 run: ./run_2022-10-19_11-54-11_GJ1214_Hubble13021//extracted_sp/bins11_2022-10-19_12-12-10
Identified file(s) for fitting: ['./run_2022-10-19_11-54-11_GJ1214_Hubble13021//extracted_sp/bins11_2022-10-19_12-12-10/speclc1.158.txt', './run_2022-10-19_11-54-11_GJ1214_Hubble13021//extracted_sp/bins11_2022-10-19_12-12-10/speclc1.204.txt', './run_2022-10-19_11-54-11_GJ1214_Hubble13021//extracted_sp/bins11_2022-10-19_12-12-10/speclc1.250.txt', './run_2022-10-19_11-54-11_GJ1214_Hubble13021//extracted_sp/bins11_2022-10-19_12-12-10/speclc1.296.txt', './run_2022-10-19_11-54-11_GJ1214_Hubble13021//extracted_sp/bins11_2022-10-19_12-12-10/speclc1.342.txt', './run_2022-10-19_11-54-11_GJ1214_Hubble13021//extracted_sp/bins11_2022-10-19_12-12-10/speclc1.389.txt', './run_2022-10-19_11-54-11_GJ1214_Hubble13021//extracted_sp/bins11_2022-10-19_12-12-10/speclc1.435.txt', './run_2022-10-19_11-54-11_GJ1214_Hubble13021//extracted_sp/bins11_2022-10-19_12-12-10/speclc1.481.txt', './run_2022-10-19_11-54-11_GJ1214_Hubble13021//extracted_sp/bins11_2022-10-19_12-12-10/speclc1.527.txt', './run_2022-10-19_11-54-11_GJ1214_Hubble13021//extracted_sp/bins11_2022-10-19_12-12-10/speclc1.573.txt', './run_2022-10-19_11-54-11_GJ1214_Hubble13021//extracted_sp/bins11_2022-10-19_12-12-10/speclc1.619.txt']

****** File: 1/11


Removed 8 exposures because they were the first exposures in the orbit.
Removed 34 exposures because they were the first orbit in the visit.
median log10 raw flux: 6.246165202239972
The highest amount of exposures in an orbit is 18
Number of free parameters:  21
Names of free parameters:  ['t0', 'rp', 'u1', 'c', 'c', 'c', 'v', 'v', 'v', 'r1', 'r1', 'r1', 'r2', 'r2', 'r2', 'r3', 'r3', 'r3', 'scale', 'scale', 'scale']
The predicted rms is 247.26

*STARTS LEAST SQUARED*
Runs MPFIT... 
v_1      9.7091e-05      8.4716e-07
r2_0     1.1420e-05      6.5022e-10
r2_1     2.2779e-03      3.3807e-07
r3_0     6.2578e-05      5.5039e-09
r3_1     4.1557e-05      3.3397e-07
scale_0          2.8774e-02      7.4845e-05
scale_1          3.9560e-03      6.7583e-05
rms, chi2red =  267564.70429841534 1454721.5884296482
['t0', 'rp', 'u1', 'c0', 'c1', 'c0', 'v1', 'v0', 'v1', 'r10', 'r11', 'r10', 'r21', 'r20', 'r21', 'r30', 'r31', 'r30', 'scale1', 'scale0', 'scale1']

*STARTS MCMC*
Runs MPFIT... 
c_1      6.2841e+00      7.7178e-02
v_1      9.7091e-05      1.0218e-03
r2_0     1.6484e-05      1.1320e-06
r3_0     9.0327e-05      9.5821e-06
r3_1     1.7544e-01      1.8905e+00
scale_0          2.8774e-02      9.0272e-02
scale_1          3.9560e-03      8.1513e-02
rms, chi2red =  267564.70429854095 0.99999999999999
Traceback (most recent call last):
  File "/home/isy/aur/PACMAN/src/pacman/workdir/pacman_script.py", line 135, in <module>
    main()
  File "/home/isy/aur/PACMAN/src/pacman/workdir/pacman_script.py", line 131, in main
    meta = s30.run30(eventlabel, workdir)
  File "/home/isy/aur/PACMAN/src/pacman/s30_run.py", line 147, in run30
    val_mcmc, err_lower_mcmc, err_upper_mcmc, fit = mcmc_fit(data, model, params, f, meta, fit_par)
  File "/home/isy/aur/PACMAN/src/pacman/lib/mcmc.py", line 37, in mcmc_fit
    theta = util.format_params_for_sampling(params, meta, fit_par)
  File "/home/isy/aur/PACMAN/src/pacman/lib/util.py", line 706, in format_params_for_sampling
    theta = params[free_array]
IndexError: boolean index did not match indexed array along dimension 0; dimension is 46 but corresponding boolean dimension is 52

Thanks for any assistance you can provide!

@sebastian-zieba
Copy link
Owner

Hi Isabel,
thanks for the catch! I'll look into this today and tomorrow and get back to you!

@sebastian-zieba
Copy link
Owner

Hi,
the problem actually just lies in the fit_par.txt file. The template I have uploaded to GitHub is based on an old version of the documentation where I showed the user how to reduce and analyze three visits at once.

In order to save a bit on computational time and disk space, I rewrote the docs a few weeks ago to show the reduction and analysis of just two visits instead. I forgot to update the fit_par.txt file though.

I just uploaded a new version of the fit_par.txt file to GitHub: https://github.com/sebastian-zieba/PACMAN/blob/master/src/pacman/data/run_files/fit_par.txt
If you replace your fit_par.txt with this new one, it should all work out.

I also tweaked a few parameters in the pcf so that the user can run the Quickstart a bit quicker. I just decided to reduce the number of iterations performed by emcee when running this tutorial. If you want to save some time, you can adopt these changes too:

run_nsteps 4000
run_nwalkers 30
run_nburn 2000

Hope this helps!

@astrobel
Copy link
Author

It's all working now, thanks so much @sebastian-zieba!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants