Closed mdredyanahmed closed 5 months ago
Hi,
It seems like you were able to successfully install the code and were able to run it.
I just updated the master branch to fix the SyntaxWarning code (which arose starting with Python 3.8), as well as the iteritems() compatibility issue (which arose starting with pandas 1.5). This addresses the issue in your second example.
In your other two examples, you're running SpecMatch-Emp from the command line. Unfortunately, that command-line interface only works out of the box with HIRES spectra.
Thanks for bringing my attention to those two compatibility issues. In the future, it would be really helpful if you could include the versions of the packages you're using (e.g. the output of conda list
). Also, including the errors not as a screenshot or plaintext but as a markdown code block (enclosing it in triple backticks: ``` output ```) would help make it more readable.
Sam
Thanks for the suggestions. Should I remove all of the previous installations directories and git clone again and reinstall it? Could you please tell me how can I run the command line code with spectrums to get the parameters as you mentioned it may not work without boxes?
Could you give me some examples?
You can simply run a git pull
in the specmatch-emp folder and run the setup.py script again. The quickstart documentation page provides an example of running the code not through the command-line interface but through the python interface. You'll need to implement your own code to read your spectrum though.
I have tried to install with guideline mentioned in the website but am unable to use specmatch-emp. I am having problem when I tried to run these commands:
(GW) mdredyanahmed@Redyans-MacBook-Pro specmatch-emp % smemp specmatch -o ./ -p -s spectrum TIC0461591646S-ab20221009.fits /Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/SpecMatch_Emp-0.3-py3.11.egg/specmatchemp/plots.py:102: SyntaxWarning: "is" with a literal. Did you mean "=="? /Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/SpecMatch_Emp-0.3-py3.11.egg/specmatchemp/plots.py:108: SyntaxWarning: "is" with a literal. Did you mean "=="? /Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/SpecMatch_Emp-0.3-py3.11.egg/specmatchemp/plots.py:111: SyntaxWarning: "is" with a literal. Did you mean "=="? /Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/SpecMatch_Emp-0.3-py3.11.egg/specmatchemp/plots.py:117: SyntaxWarning: "is" with a literal. Did you mean "=="? /Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/SpecMatch_Emp-0.3-py3.11.egg/specmatchemp/plots.py:102: SyntaxWarning: "is" with a literal. Did you mean "=="? /Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/SpecMatch_Emp-0.3-py3.11.egg/specmatchemp/plots.py:108: SyntaxWarning: "is" with a literal. Did you mean "=="? /Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/SpecMatch_Emp-0.3-py3.11.egg/specmatchemp/plots.py:111: SyntaxWarning: "is" with a literal. Did you mean "=="? /Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/SpecMatch_Emp-0.3-py3.11.egg/specmatchemp/plots.py:117: SyntaxWarning: "is" with a literal. Did you mean "=="? Traceback (most recent call last): File "/Users/mdredyanahmed/mambaforge/envs/GW/bin/smemp", line 33, in
sys.exit(load_entry_point('SpecMatch-Emp==0.3', 'console_scripts', 'smemp')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/SpecMatch_Emp-0.3-py3.11.egg/specmatchemp/cli.py", line 147, in main
File "/Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/SpecMatch_Emp-0.3-py3.11.egg/specmatchemp/cli.py", line 29, in specmatch_spectrum
File "/Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/SpecMatch_Emp-0.3-py3.11.egg/specmatchemp/core.py", line 45, in specmatch_spectrum
File "/Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/SpecMatch_Emp-0.3-py3.11.egg/specmatchemp/spectrum.py", line 581, in read_hires_fits
File "/Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/astropy/io/fits/hdu/hdulist.py", line 385, in getitem
raise e
File "/Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/astropy/io/fits/hdu/hdulist.py", line 379, in getitem
return self._try_while_unread_hdus(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/astropy/io/fits/hdu/hdulist.py", line 1246, in _try_while_unread_hdus
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
(GW) mdredyanahmed@Redyans-MacBook-Pro specmatch-emp % smemp shift -o ./ -f -p -s spectrum TIC0461591646S-ab20221009.fits /Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/SpecMatch_Emp-0.3-py3.11.egg/specmatchemp/plots.py:102: SyntaxWarning: "is" with a literal. Did you mean "=="? /Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/SpecMatch_Emp-0.3-py3.11.egg/specmatchemp/plots.py:108: SyntaxWarning: "is" with a literal. Did you mean "=="? /Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/SpecMatch_Emp-0.3-py3.11.egg/specmatchemp/plots.py:111: SyntaxWarning: "is" with a literal. Did you mean "=="? /Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/SpecMatch_Emp-0.3-py3.11.egg/specmatchemp/plots.py:117: SyntaxWarning: "is" with a literal. Did you mean "=="? /Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/SpecMatch_Emp-0.3-py3.11.egg/specmatchemp/plots.py:102: SyntaxWarning: "is" with a literal. Did you mean "=="? /Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/SpecMatch_Emp-0.3-py3.11.egg/specmatchemp/plots.py:108: SyntaxWarning: "is" with a literal. Did you mean "=="? /Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/SpecMatch_Emp-0.3-py3.11.egg/specmatchemp/plots.py:111: SyntaxWarning: "is" with a literal. Did you mean "=="? /Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/SpecMatch_Emp-0.3-py3.11.egg/specmatchemp/plots.py:117: SyntaxWarning: "is" with a literal. Did you mean "=="? Traceback (most recent call last): File "/Users/mdredyanahmed/mambaforge/envs/GW/bin/smemp", line 33, in
sys.exit(load_entry_point('SpecMatch-Emp==0.3', 'console_scripts', 'smemp')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/SpecMatch_Emp-0.3-py3.11.egg/specmatchemp/cli.py", line 147, in main
File "/Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/SpecMatch_Emp-0.3-py3.11.egg/specmatchemp/cli.py", line 47, in shift_spectrum
File "/Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/SpecMatch_Emp-0.3-py3.11.egg/specmatchemp/core.py", line 482, in shift_spectrum
File "/Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/SpecMatch_Emp-0.3-py3.11.egg/specmatchemp/spectrum.py", line 581, in read_hires_fits
File "/Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/astropy/io/fits/hdu/hdulist.py", line 385, in getitem
raise e
File "/Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/astropy/io/fits/hdu/hdulist.py", line 379, in getitem
return self._try_while_unread_hdus(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/mdredyanahmed/mambaforge/envs/GW/lib/python3.11/site-packages/astropy/io/fits/hdu/hdulist.py", line 1246, in _try_while_unread_hdus
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
I have also attached the errrors as a screenshot. Can anyone help me to make specmatch-emp work?