kevin218 / Eureka

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

[Bug]: GPs not working #555

Closed gmorello closed 10 months ago

gmorello commented 1 year ago

FAQ check

Instrument

Light curve fitting (Stages 4-6)

What happened?

Hi,

I am trying to fit spectral light curves using batman_tr, linramp, GP, but I get the error reported below. I have tried both with celerite and george, and using free or shared GP parameters (A, WN, m1). My last trial was: A -5 'shared' -20. 20. U WN -15 'free' -20. 20. U m1 -5 'shared' -20. 20. U

Error traceback output

s5_meta = s5.fitlc(eventlabel, ecf_path=ecf_path, s4_meta=s4_meta)

File "/home/gmorello/.conda/envs/eureka/lib/python3.9/site-packages/eureka/S5_lightcurve_fitting/s5_fit.py", line 399, in fitlc meta, params = fit_channel(meta, time, flux, 0, flux_err, File "/home/gmorello/.conda/envs/eureka/lib/python3.9/site-packages/eureka/S5_lightcurve_fitting/s5_fit.py", line 768, in fit_channel t_GP = m.GPModel(meta.kernel_class, meta.kernel_inputs, lc_model, File "/home/gmorello/.conda/envs/eureka/lib/python3.9/site-packages/eureka/S5_lightcurve_fitting/models/GPModel.py", line 56, in init self._parse_coeffs() File "/home/gmorello/.conda/envs/eureka/lib/python3.9/site-packages/eureka/S5_lightcurve_fitting/models/GPModel.py", line 71, in _parse_coeffs elif self.nchan > 1: AttributeError: 'GPModel' object has no attribute 'nchan'

What operating system are you using?

No response

What version of Python are you running?

No response

What Python packages do you have installed?

No response

Code of Conduct

taylorbell57 commented 1 year ago

By chance I happened to try using the GP model myself last week and encountered the same error. I've got a messy patch in a local branch already, and I'll try to get a pull request ready soon

gmorello commented 1 year ago

Thanks, waiting for the updates.

Witchblade101 commented 12 months ago

I just encountered the same error

kevin218 commented 12 months ago

PR #557 solves the issues with GPs. It just needs to be merged into main.

taylorbell57 commented 12 months ago

Indeed, I just need to make some changes to the documentation, and then this should be patched very soon

Witchblade101 commented 12 months ago

I tried the branch gp_fixes, but got the following errors:

(eureka_gp) minmei:Obs1 dlong$ python run_eureka_1.py 2023-08-31 17:45:12,426 - stpipe - WARNING - /Users/dlong/miniconda3/envs/eureka_gp/lib/python3.9/site-packages/stcal/jump/jump.py:17: UserWarning: Could not import opencv-python; certain snowball detection and usage of ellipses will be inoperable warnings.warn('Could not import opencv-python; '

Traceback (most recent call last): File "/Users/dlong/miniconda3/envs/eureka_gp/lib/python3.9/site-packages/theano/configparser.py", line 238, in fetch_val_for_key return self._theano_cfg.get(section, option) File "/Users/dlong/miniconda3/envs/eureka_gp/lib/python3.9/configparser.py", line 781, in get d = self._unify_values(section, vars) File "/Users/dlong/miniconda3/envs/eureka_gp/lib/python3.9/configparser.py", line 1149, in _unify_values raise NoSectionError(section) from None configparser.NoSectionError: No section: 'blas'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/dlong/miniconda3/envs/eureka_gp/lib/python3.9/site-packages/theano/configparser.py", line 354, in get val_str = cls.fetch_val_for_key(self.name, delete_key=delete_key) File "/Users/dlong/miniconda3/envs/eureka_gp/lib/python3.9/site-packages/theano/configparser.py", line 242, in fetch_val_for_key raise KeyError(key) KeyError: 'blas__ldflags'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/dlong/DataAnalysis/JWST/eureka/t1e/Obs1/run_eureka_1.py", line 2, in import eureka.lib.plots File "/Users/dlong/Eureka/src/eureka/init.py", line 28, in from . import S5_lightcurve_fitting File "/Users/dlong/Eureka/src/eureka/S5_lightcurve_fitting/init.py", line 6, in from . import differentiable_models File "/Users/dlong/Eureka/src/eureka/S5_lightcurve_fitting/differentiable_models/init.py", line 1, in from .PyMC3Models import PyMC3Model, CompositePyMC3Model File "/Users/dlong/Eureka/src/eureka/S5_lightcurve_fitting/differentiable_models/PyMC3Models.py", line 7, in import theano File "/Users/dlong/miniconda3/envs/eureka_gp/lib/python3.9/site-packages/theano/init.py", line 83, in from theano import scalar, tensor File "/Users/dlong/miniconda3/envs/eureka_gp/lib/python3.9/site-packages/theano/tensor/init.py", line 20, in from theano.tensor import nnet # used for softmax, sigmoid, etc. File "/Users/dlong/miniconda3/envs/eureka_gp/lib/python3.9/site-packages/theano/tensor/nnet/init.py", line 3, in from . import opt File "/Users/dlong/miniconda3/envs/eureka_gp/lib/python3.9/site-packages/theano/tensor/nnet/opt.py", line 32, in from theano.tensor.nnet.conv import ConvOp, conv2d File "/Users/dlong/miniconda3/envs/eureka_gp/lib/python3.9/site-packages/theano/tensor/nnet/conv.py", line 20, in from theano.tensor import blas File "/Users/dlong/miniconda3/envs/eureka_gp/lib/python3.9/site-packages/theano/tensor/blas.py", line 163, in from theano.tensor.blas_headers import blas_header_text, blas_header_version File "/Users/dlong/miniconda3/envs/eureka_gp/lib/python3.9/site-packages/theano/tensor/blas_headers.py", line 1016, in if not config.blasldflags: File "/Users/dlong/miniconda3/envs/eureka_gp/lib/python3.9/site-packages/theano/configparser.py", line 358, in get val_str = self.default() File "/Users/dlong/miniconda3/envs/eureka_gp/lib/python3.9/site-packages/theano/link/c/cmodule.py", line 2621, in default_blas_ldflags blas_info = numpy.distutils.config.blas_opt_info AttributeError: module 'numpy.distutils.config__' has no attribute 'blas_opt_info'

taylorbell57 commented 12 months ago

@Witchblade101, my best guess is that the updates to the main branch related to installing Eureka! haven't yet been merged into the gp_fixes branch. Please try again once we've merged the gp_fixes branch into the main branch (should hopefully be merged quite soon)