kevin218 / Eureka

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

[Bug]: S3 Window Refinement leading to TypeError #725

Closed sstamer23 closed 4 days ago

sstamer23 commented 4 days ago

FAQ check

Instrument

NIRSpec (Stages 1-3)

What happened?

So I'm trying to fix my window for this new data I've received, and I'm getting the following error. I saw the discussion in #685 and was able to get that error to go away by refining my window further, but now I'm getting this one.

Error traceback output

Starting Stage 3 Reduction

Input directory: /Users/sarahstamer/Desktop/Grad/2024-2025/Research/LTT-9779b_Eureka_Analysis/Data/NRS2Calints/ Found 7 data file(s) ending in calints.fits Output directory: /Users/sarahstamer/Desktop/Grad/2024-2025/Research/LTT-9779b_Eureka_Analysis/Data/Stage3/S3_2024-11-22_nirspec_fs_template_run21/ap6_bg7/ Using ap=6, bg=7, expand=1 Copying S3 control file Starting file 1 of 7 Reading file 1... Masking NaNs/infs in data arrays... FLUX has 411673 NaNs/infs, which is 2.25% of all pixels. ERR has 411673 NaNs/infs, which is 2.25% of all pixels. V0 has 411673 NaNs/infs, which is 2.25% of all pixels. Locating source position... Traceback (most recent call last): File "/Users/sarahstamer/Desktop/Grad/2024-2025/Research/LTT-9779b_Eureka_Analysis/DataAnalysis/Code/run_eureka.py", line 28, in spec, meta = s3.reduce(eventlabel, ecf_path=ecf_path) File "/opt/miniconda3/envs/eureka/lib/python3.10/site-packages/eureka-1.1.dev0+gf09c39a8.d20241108-py3.10.egg/eureka/S3_data_reduction/s3_reduce.py", line 350, in reduce File "/opt/miniconda3/envs/eureka/lib/python3.10/site-packages/eureka-1.1.dev0+gf09c39a8.d20241108-py3.10.egg/eureka/S3_data_reduction/source_pos.py", line 101, in source_pos_wrapper File "/opt/miniconda3/envs/eureka/lib/python3.10/site-packages/eureka-1.1.dev0+gf09c39a8.d20241108-py3.10.egg/eureka/S3_data_reduction/source_pos.py", line 162, in source_pos File "/opt/miniconda3/envs/eureka/lib/python3.10/site-packages/eureka-1.1.dev0+gf09c39a8.d20241108-py3.10.egg/eureka/S3_data_reduction/source_pos.py", line 413, in source_pos_gauss File "/opt/miniconda3/envs/eureka/lib/python3.10/site-packages/scipy/optimize/_minpack_py.py", line 832, in curve_fit raise TypeError(f"The number of func parameters={n} must not" TypeError: The number of func parameters=4 must not exceed the number of data points=3

What operating system are you using?

MacOS Sequoia 15.1

What version of Python are you running?

Python 3.10.14

What Python packages do you have installed?

packages in environment at /opt/miniconda3/envs/eureka:

#

Name Version Build Channel

aesara-theano-fallback 0.1.0 pypi_0 pypi alabaster 1.0.0 pypi_0 pypi appnope 0.1.4 pyhd8ed1ab_0 conda-forge arviz 0.20.0 pypi_0 pypi asciitree 0.3.3 pypi_0 pypi asdf 3.4.0 pypi_0 pypi asdf-astropy 0.6.1 pypi_0 pypi asdf-coordinates-schemas 0.3.0 pypi_0 pypi asdf-standard 1.1.1 pypi_0 pypi asdf-transform-schemas 0.5.0 pypi_0 pypi asdf-wcs-schemas 0.4.0 pypi_0 pypi asteval 1.0.2 pypi_0 pypi astraeus 0.3 pypi_0 pypi astropy 6.1.2 pypi_0 pypi astropy-healpix 1.0.3 pypi_0 pypi astropy-iers-data 0.2024.8.19.0.32.16 pypi_0 pypi astroquery 0.4.7 pypi_0 pypi astroscrappy 1.2.0 pypi_0 pypi asttokens 2.4.1 pyhd8ed1ab_0 conda-forge attrs 24.2.0 pypi_0 pypi babel 2.16.0 pypi_0 pypi backports-tarfile 1.2.0 pypi_0 pypi batman-package 2.4.9 pypi_0 pypi bayesicfitting 3.2.1 pypi_0 pypi beautifulsoup4 4.12.3 pypi_0 pypi bokeh 2.4.3 pypi_0 pypi bottleneck 1.4.0 pypi_0 pypi bzip2 1.0.8 h6c40b1e_6
ca-certificates 2024.8.30 h8857fd0_0 conda-forge cachetools 5.5.0 pypi_0 pypi ccdproc 2.4.2 pypi_0 pypi celerite 0.4.3 pypi_0 pypi celerite2 0.3.2 pypi_0 pypi certifi 2024.7.4 pypi_0 pypi cftime 1.6.4 pypi_0 pypi charset-normalizer 3.3.2 pypi_0 pypi click 8.1.7 pypi_0 pypi cloudpickle 3.0.0 pypi_0 pypi comm 0.2.2 pyhd8ed1ab_0 conda-forge contourpy 1.2.1 pypi_0 pypi corner 2.2.2 pypi_0 pypi crds 11.18.1 pypi_0 pypi cycler 0.12.1 pypi_0 pypi dask 2024.8.1 pypi_0 pypi debugpy 1.8.6 py310h53e7c6a_0 conda-forge decorator 5.1.1 pyhd8ed1ab_0 conda-forge dill 0.3.8 pypi_0 pypi docutils 0.21.2 pypi_0 pypi drizzle 1.15.3 pypi_0 pypi dynesty 2.1.4 pypi_0 pypi emcee 3.1.6 pypi_0 pypi eureka 1.0 pypi_0 pypi exceptiongroup 1.2.2 pyhd8ed1ab_0 conda-forge executing 2.0.1 pypi_0 pypi exoplanet 0.6.0 pypi_0 pypi exotic-ld 3.2.0 pypi_0 pypi fasteners 0.19 pypi_0 pypi fastprogress 1.0.3 pypi_0 pypi filelock 3.15.4 pypi_0 pypi fleck 1.1.2 pypi_0 pypi fonttools 4.53.1 pypi_0 pypi fsspec 2024.6.1 pypi_0 pypi future 1.0.0 pypi_0 pypi george 0.4.3 pypi_0 pypi gwcs 0.21.0 pypi_0 pypi h5netcdf 1.3.0 pypi_0 pypi h5py 3.11.0 pypi_0 pypi html5lib 1.1 pypi_0 pypi idna 3.7 pypi_0 pypi imageio 2.35.1 pypi_0 pypi imagesize 1.4.1 pypi_0 pypi importlib-metadata 8.4.0 pypi_0 pypi iniconfig 2.0.0 pypi_0 pypi ipykernel 6.29.5 pyh57ce528_0 conda-forge ipython 8.26.0 pypi_0 pypi jaraco-classes 3.4.0 pypi_0 pypi jaraco-context 6.0.1 pypi_0 pypi jaraco-functools 4.0.2 pypi_0 pypi jedi 0.19.1 pyhd8ed1ab_0 conda-forge jinja2 3.1.4 pypi_0 pypi jmespath 1.0.1 pypi_0 pypi jsonschema 4.23.0 pypi_0 pypi jsonschema-specifications 2023.12.1 pypi_0 pypi jupyter_client 8.6.3 pyhd8ed1ab_0 conda-forge jupyter_core 5.7.2 pyh31011fe_1 conda-forge jwst 1.15.1 pypi_0 pypi keyring 25.3.0 pypi_0 pypi kiwisolver 1.4.5 pypi_0 pypi krb5 1.21.3 h37d8d59_0 conda-forge lazy-loader 0.4 pypi_0 pypi libcxx 19.1.0 hf95d169_0 conda-forge libedit 3.1.20191231 h0678c8f_2 conda-forge libffi 3.4.4 hecd8cb5_1
libsodium 1.0.20 hfdf4475_0 conda-forge lmfit 1.3.2 pypi_0 pypi locket 1.0.0 pypi_0 pypi markupsafe 2.1.5 pypi_0 pypi matplotlib 3.9.2 pypi_0 pypi matplotlib-inline 0.1.7 pyhd8ed1ab_0 conda-forge mc3 3.2.0 pypi_0 pypi more-itertools 10.4.0 pypi_0 pypi ncurses 6.4 hcec6c5f_0
nest-asyncio 1.6.0 pyhd8ed1ab_0 conda-forge netcdf4 1.6.5 pypi_0 pypi networkx 3.3 pypi_0 pypi numcodecs 0.13.0 pypi_0 pypi numpy 1.24.4 pypi_0 pypi numpydoc 1.8.0 pypi_0 pypi opencv-python-headless 4.10.0.84 pypi_0 pypi openssl 3.3.2 hd23fc13_0 conda-forge packaging 24.1 pyhd8ed1ab_0 conda-forge pandas 2.2.2 pypi_0 pypi parsley 1.3 pypi_0 pypi parso 0.8.4 pyhd8ed1ab_0 conda-forge partd 1.4.2 pypi_0 pypi patsy 0.5.6 pypi_0 pypi pexpect 4.9.0 pyhd8ed1ab_0 conda-forge photutils 1.13.0 pypi_0 pypi pickleshare 0.7.5 py_1003 conda-forge pillow 10.4.0 pypi_0 pypi pip 24.2 py310hecd8cb5_0
platformdirs 4.3.6 pyhd8ed1ab_0 conda-forge pluggy 1.5.0 pypi_0 pypi poppy 1.1.1 pypi_0 pypi prompt-toolkit 3.0.47 pyha770c72_0 conda-forge psutil 6.0.0 py310h837254d_1 conda-forge ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge pure_eval 0.2.3 pyhd8ed1ab_0 conda-forge pyerfa 2.0.1.4 pypi_0 pypi pygments 2.18.0 pyhd8ed1ab_0 conda-forge pymc3 3.11.4 pypi_0 pypi pymc3-ext 0.1.1 pypi_0 pypi pyparsing 3.1.2 pypi_0 pypi pysynphot 2.0.0 pypi_0 pypi pytest 8.3.2 pypi_0 pypi python 3.10.14 h5ee71fb_1
python-dateutil 2.9.0.post0 pypi_0 pypi python_abi 3.10 2_cp310 conda-forge pytz 2024.1 pypi_0 pypi pyvo 1.5.2 pypi_0 pypi pyyaml 6.0.2 pypi_0 pypi pyzmq 26.2.0 py310hfe2c05e_2 conda-forge readline 8.2 hca72f7f_0
referencing 0.35.1 pypi_0 pypi reproject 0.14.0 pypi_0 pypi requests 2.32.3 pypi_0 pypi rpds-py 0.20.0 pypi_0 pypi scikit-image 0.24.0 pypi_0 pypi scipy 1.9.3 pypi_0 pypi semantic-version 2.10.0 pypi_0 pypi semver 3.0.2 pypi_0 pypi setuptools 72.1.0 py310hecd8cb5_0
setuptools-scm 8.1.0 pypi_0 pypi shapely 2.0.6 pypi_0 pypi six 1.16.0 pyh6c4a22f_0 conda-forge snowballstemmer 2.2.0 pypi_0 pypi soupsieve 2.6 pypi_0 pypi spherical-geometry 1.3.2 pypi_0 pypi sphinx 8.0.2 pypi_0 pypi sphinxcontrib-applehelp 2.0.0 pypi_0 pypi sphinxcontrib-devhelp 2.0.0 pypi_0 pypi sphinxcontrib-htmlhelp 2.1.0 pypi_0 pypi sphinxcontrib-jsmath 1.0.1 pypi_0 pypi sphinxcontrib-qthelp 2.0.0 pypi_0 pypi sphinxcontrib-serializinghtml 2.0.0 pypi_0 pypi sqlite 3.45.3 h6c40b1e_0
stack-data 0.6.3 pypi_0 pypi stack_data 0.6.2 pyhd8ed1ab_0 conda-forge stcal 1.7.3 pypi_0 pypi stdatamodels 2.0.0 pypi_0 pypi stpipe 0.6.0 pypi_0 pypi stsci-image 2.3.9 pypi_0 pypi stsci-imagestats 1.8.3 pypi_0 pypi stsci-stimage 0.2.9 pypi_0 pypi svo-filters 0.4.4 pypi_0 pypi synphot 1.4.0 pypi_0 pypi tabulate 0.9.0 pypi_0 pypi tifffile 2024.8.10 pypi_0 pypi tk 8.6.14 h4d00af3_0
tomli 2.0.1 pypi_0 pypi toolz 0.12.1 pypi_0 pypi tornado 6.4.1 py310h837254d_1 conda-forge tqdm 4.66.5 pypi_0 pypi traitlets 5.14.3 pyhd8ed1ab_0 conda-forge tweakwcs 0.8.8 pypi_0 pypi typing_extensions 4.12.2 pyha770c72_0 conda-forge tzdata 2024.1 pypi_0 pypi uncertainties 3.2.2 pypi_0 pypi urllib3 2.2.2 pypi_0 pypi wcwidth 0.2.13 pyhd8ed1ab_0 conda-forge webencodings 0.5.1 pypi_0 pypi wheel 0.43.0 py310hecd8cb5_0
wiimatch 0.3.2 pypi_0 pypi xarray 2024.7.0 pypi_0 pypi xarray-einstats 0.8.0 pypi_0 pypi xz 5.4.6 h6c40b1e_1
zarr 2.18.2 pypi_0 pypi zeromq 4.3.5 hb33e954_5 conda-forge zipp 3.20.0 pypi_0 pypi zlib 1.2.13 h4b97444_1

Code of Conduct

sstamer23 commented 4 days ago

Actually, made one number change on my window and now it's running, I'll reopen if I run into any further issues

sstamer23 commented 4 days ago

Never mind, it's back but with a new semaphore warning?

The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/Users/sarahstamer/Desktop/Grad/2024-2025/Research/LTT-9779b_Eureka_Analysis/DataAnalysis/Code/run_eureka.py", line 28, in spec, meta = s3.reduce(eventlabel, ecf_path=ecf_path) File "/opt/miniconda3/envs/eureka/lib/python3.10/site-packages/eureka-1.1.dev0+gf09c39a8.d20241108-py3.10.egg/eureka/S3_data_reduction/s3_reduce.py", line 418, in reduce File "/opt/miniconda3/envs/eureka/lib/python3.10/site-packages/eureka-1.1.dev0+gf09c39a8.d20241108-py3.10.egg/eureka/S3_data_reduction/source_pos.py", line 89, in source_pos_wrapper File "/opt/miniconda3/envs/eureka/lib/python3.10/multiprocessing/pool.py", line 774, in get raise self._value TypeError: The number of func parameters=4 must not exceed the number of data points=3 /opt/miniconda3/envs/eureka/lib/python3.10/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 9 leaked semaphore objects to clean up at shutdown warnings.warn('resource_tracker: There appear to be %d '

kevin218 commented 4 days ago

What aperture size are you using (spec_hw)? The source pos routine can fail if it is too small.

sstamer23 commented 4 days ago

That's set to 6 for me

sstamer23 commented 4 days ago

I think I got it fixed, just needed to do a complete update of Eureka.