kevin218 / Eureka

Eureka! is a data reduction and analysis pipeline intended for time-series observations with JWST.
https://eurekadocs.readthedocs.io/
MIT License
56 stars 44 forks source link

[Bug]: Mismatch in S5_.log #576

Closed cdfortenbach closed 8 months ago

cdfortenbach commented 8 months ago

FAQ check

Instrument

Light curve fitting (Stages 4-6)

What happened?

I've been working with the WASP-39b data for G395H_nrs1. I made a run (S2-S6) with fairly good results. I was checking the S5.log vs the datafile output and there seems to be a mismatch. I guess this might be inconsequential, but it is confusing. I'm probably just missing something obvious.

Specifically, for S5, the _fitparams_ch000.csv, and the _ap4_bg6_Table_Save_ch000.txt, do not seem to agree with the S5.log which starts with Channel 1 of 142. I looked at channel 2 and 3 and there is no agreement. It would help if the Channels in the files and the log were from the same starting point (000), but they aren't. It would also be helpful if the "Bandpasses" in S4 (starts with 0) agreed with the "Channels" in S5 (starts with 1). That doesn't seem to be the problem. The detailed parameters don't seem to agree. It would be helpful if you could take a look.

Error traceback output

No errors, per se.

What operating system are you using?

Ubuntu 18.04

What version of Python are you running?

3.9.7

What Python packages do you have installed?

#

Name Version Build Channel

_libgcc_mutex 0.1 main
_openmp_mutex 5.1 1_gnu
alabaster 0.7.13 pypi_0 pypi asdf 2.15.0 pypi_0 pypi asdf-astropy 0.4.0 pypi_0 pypi asdf-coordinates-schemas 0.2.0 pypi_0 pypi asdf-standard 1.0.3 pypi_0 pypi asdf-transform-schemas 0.3.0 pypi_0 pypi asdf-unit-schemas 0.1.0 pypi_0 pypi asdf-wcs-schemas 0.1.1 pypi_0 pypi asteval 0.9.29 pypi_0 pypi astraeus 0.3 pypi_0 pypi astropy 5.2.2 pypi_0 pypi astropy-healpix 0.7 pypi_0 pypi astroquery 0.4.6 pypi_0 pypi astroscrappy 1.1.0 pypi_0 pypi asttokens 2.2.1 pypi_0 pypi attrs 23.1.0 pypi_0 pypi babel 2.12.1 pypi_0 pypi backcall 0.2.0 pypi_0 pypi batman-package 2.4.9 pypi_0 pypi bayesicfitting 3.1.1 pypi_0 pypi beautifulsoup4 4.12.2 pypi_0 pypi bokeh 2.4.3 pypi_0 pypi bottleneck 1.3.7 pypi_0 pypi ca-certificates 2023.01.10 h06a4308_0
ccdproc 2.4.0 pypi_0 pypi celerite 0.4.2 pypi_0 pypi certifi 2022.5.18.1 pypi_0 pypi cffi 1.15.1 pypi_0 pypi cftime 1.6.2 pypi_0 pypi charset-normalizer 3.1.0 pypi_0 pypi cloudpickle 2.2.1 pypi_0 pypi contourpy 1.0.7 pypi_0 pypi corner 2.2.2 pypi_0 pypi crds 11.16.22 pypi_0 pypi cryptography 40.0.2 pypi_0 pypi cycler 0.11.0 pypi_0 pypi cython 0.29.34 pypi_0 pypi dask 2022.6.0 pypi_0 pypi decorator 5.1.1 pypi_0 pypi docutils 0.19 pypi_0 pypi drizzle 1.13.7 pypi_0 pypi dynesty 2.1.1 pypi_0 pypi emcee 3.1.4 pypi_0 pypi eureka 0.9 pypi_0 pypi exceptiongroup 1.1.1 pypi_0 pypi executing 1.2.0 pypi_0 pypi exotic-ld 3.0.0 pypi_0 pypi filelock 3.12.0 pypi_0 pypi fonttools 4.39.3 pypi_0 pypi fsspec 2023.4.0 pypi_0 pypi future 0.18.3 pypi_0 pypi george 0.4.0 pypi_0 pypi gwcs 0.18.3 pypi_0 pypi h5netcdf 1.1.0 pypi_0 pypi h5py 3.1.0 pypi_0 pypi html5lib 1.1 pypi_0 pypi idna 3.4 pypi_0 pypi imageio 2.27.0 pypi_0 pypi imagesize 1.4.1 pypi_0 pypi importlib-metadata 6.5.0 pypi_0 pypi importlib-resources 5.12.0 pypi_0 pypi iniconfig 2.0.0 pypi_0 pypi ipython 8.12.0 pypi_0 pypi jaraco-classes 3.2.3 pypi_0 pypi jedi 0.18.2 pypi_0 pypi jeepney 0.8.0 pypi_0 pypi jinja2 3.1.2 pypi_0 pypi jmespath 1.0.1 pypi_0 pypi jsonschema 4.9.1 pypi_0 pypi jwst 1.8.2 pypi_0 pypi keyring 23.13.1 pypi_0 pypi kiwisolver 1.4.4 pypi_0 pypi lazy-loader 0.2 pypi_0 pypi ld_impl_linux-64 2.38 h1181459_1
libffi 3.3 he6710b0_2
libgcc-ng 11.2.0 h1234567_1
libgomp 11.2.0 h1234567_1
libstdcxx-ng 11.2.0 h1234567_1
lmfit 1.2.0 pypi_0 pypi locket 1.0.0 pypi_0 pypi markupsafe 2.1.2 pypi_0 pypi matplotlib 3.7.1 pypi_0 pypi matplotlib-inline 0.1.6 pypi_0 pypi more-itertools 9.1.0 pypi_0 pypi ncurses 6.4 h6a678d5_0
netcdf4 1.6.3 pypi_0 pypi networkx 3.1 pypi_0 pypi numpy 1.22.0 pypi_0 pypi numpydoc 1.5.0 pypi_0 pypi openssl 1.1.1t h7f8727e_0
packaging 23.1 pypi_0 pypi pandas 2.0.0 pypi_0 pypi parsley 1.3 pypi_0 pypi parso 0.8.3 pypi_0 pypi partd 1.4.0 pypi_0 pypi pexpect 4.8.0 pypi_0 pypi photutils 1.7.0 pypi_0 pypi pickleshare 0.7.5 pypi_0 pypi pillow 9.5.0 pypi_0 pypi pip 23.0.1 py39h06a4308_0
pluggy 1.0.0 pypi_0 pypi poppy 1.0.3 pypi_0 pypi prompt-toolkit 3.0.38 pypi_0 pypi psutil 5.9.5 pypi_0 pypi ptyprocess 0.7.0 pypi_0 pypi pure-eval 0.2.2 pypi_0 pypi pycparser 2.21 pypi_0 pypi pyerfa 2.0.0.3 pypi_0 pypi pygments 2.15.1 pypi_0 pypi pyparsing 3.0.9 pypi_0 pypi pyrsistent 0.19.3 pypi_0 pypi pysynphot 2.0.0 pypi_0 pypi pytest 7.3.1 pypi_0 pypi python 3.9.7 h12debd9_1
python-dateutil 2.8.2 pypi_0 pypi pytz 2023.3 pypi_0 pypi pyvo 1.4.1 pypi_0 pypi pywavelets 1.4.1 pypi_0 pypi pyyaml 6.0 pypi_0 pypi readline 8.2 h5eee18b_0
reproject 0.10.0 pypi_0 pypi requests 2.28.2 pypi_0 pypi scikit-image 0.20.0 pypi_0 pypi scipy 1.9.1 pypi_0 pypi secretstorage 3.3.3 pypi_0 pypi semantic-version 2.10.0 pypi_0 pypi setuptools 67.6.1 pypi_0 pypi setuptools-scm 7.1.0 pypi_0 pypi six 1.16.0 pypi_0 pypi snowballstemmer 2.2.0 pypi_0 pypi soupsieve 2.4.1 pypi_0 pypi spherical-geometry 1.2.23 pypi_0 pypi sphinx 6.1.3 pypi_0 pypi sphinxcontrib-applehelp 1.0.4 pypi_0 pypi sphinxcontrib-devhelp 1.0.2 pypi_0 pypi sphinxcontrib-htmlhelp 2.0.1 pypi_0 pypi sphinxcontrib-jsmath 1.0.1 pypi_0 pypi sphinxcontrib-qthelp 1.0.3 pypi_0 pypi sphinxcontrib-serializinghtml 1.1.5 pypi_0 pypi sqlite 3.41.2 h5eee18b_0
stack-data 0.6.2 pypi_0 pypi stcal 1.2.2 pypi_0 pypi stdatamodels 0.4.5 pypi_0 pypi stpipe 0.5.0 pypi_0 pypi stsci-image 2.3.5 pypi_0 pypi stsci-imagestats 1.6.3 pypi_0 pypi stsci-stimage 0.2.6 pypi_0 pypi svo-filters 0.4.4 pypi_0 pypi tifffile 2023.4.12 pypi_0 pypi tk 8.6.12 h1ccaba5_0
tomli 2.0.1 pypi_0 pypi toolz 0.12.0 pypi_0 pypi tornado 6.3 pypi_0 pypi tqdm 4.65.0 pypi_0 pypi traitlets 5.9.0 pypi_0 pypi tweakwcs 0.8.2 pypi_0 pypi typing-extensions 4.5.0 pypi_0 pypi tzdata 2023.3 pypi_0 pypi uncertainties 3.1.7 pypi_0 pypi urllib3 1.26.15 pypi_0 pypi wcwidth 0.2.6 pypi_0 pypi webencodings 0.5.1 pypi_0 pypi wheel 0.38.4 py39h06a4308_0
wiimatch 0.3.1 pypi_0 pypi xarray 2023.4.1 pypi_0 pypi xz 5.2.10 h5eee18b_1
zipp 3.15.0 pypi_0 pypi zlib 1.2.13 h5eee18b_0

Code of Conduct

cdfortenbach commented 8 months ago

S5_dynesty_fitparams_ch000.csv S5_dynesty_fitparams_ch001.csv S5_wasp39b.log

taylorbell57 commented 8 months ago

This isn't a bug per se, but just a bit of a clash in conventions. I'm partial to zero-based numbering, but I get that one-based numbering might be more comfortable in the log (e.g. if the printed log says something like "starting channel 0/49" some people might be surprised that it's starting from zero and others might be surprised that it says 49 when they asked for 50 channels). @kevin218 do you figure we're better off changing the file names or the numbers in the log?

cdfortenbach commented 8 months ago

Forgive my poorly worded comment. The channel numbering is only a minor part of the problem. The real problem is that the parameter output numbers (e.g., rp, ..., scatter_mult, etc.) don't agree. Please compare the .csv files to the log. They are not the same. Shouldn't they be?

taylorbell57 commented 8 months ago

Ah, so the numbers printed in the log are the 50th percentile (median) with errors calculated using the difference between the 16th and 50th percentile for the lower uncertainty and 84th and 50th percentile for the upper uncertainty. Those values printed in the log are typically the best ones to use since they should agree with the -1 and +1 sigma intervals when the posterior is Gaussian while they will be more reasonable uncertainties when the posterior is non-Gaussian. But for completeness, we put a bunch of parameters into that fitparams CSV file so folks can do what they want

cdfortenbach commented 8 months ago

Got it. The numbers tie out now. Thanks. There is still the minor "convention" issue of starting with channel 0 or 1 so I'll leave the issue open. I think it could be either way as long as it was consistent for all Stages.