astropy / astropy/astroquery

Error with Splatalogue.query_lines() for specific molecules

Open
#1,407 3 comments 0 reactions 0 assignees View on GitHub
bug splatalogue
Dominant language
Python
Stars
791
Forks
451
Avg merge
1d 3h
Merged PRs (30d)
4

Description

Hello,
I am trying to use Splatalogue.query_lines() to get line intensity data for a certain frequency range. When running the following code, I run into an error as shown below. It seems that the error only happens when the query involves '2,4-Pentadiynylidyne'. I wonder if there is a way to fix this as I would like to eventually write a code to calculate the spectrum for an arbitrary frequency range.

astropy : 3.1
astroquery : 0.3.9
```
Python 3.7.1 (default, Dec 10 2018, 22:54:23) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from astroquery.splatalogue import Splatalogue
gzip was not found on your system! You should solve this issue for astroquery.eso to be at its best!
On POSIX system: make sure gzip is installed and in your path!On Windows: same for 7-zip (http://www.7-zip.org)!
>>> from astropy import units as u
>>> Splatalogue.query_lines(6.7 * u.GHz, 6.8 * u.GHz)
Traceback (most recent call last):
File "C:\Users\wheey\Anaconda3\lib\site-packages\astropy\io\ascii\ui.py", line 542, in _guess
dat = reader.read(table)
File "C:\Users\wheey\Anaconda3\lib\site-packages\astropy\io\ascii\core.py", line 1189, in read
raise InconsistentTableError(errmsg)
astropy.io.ascii.core.InconsistentTableError: Number of header columns (17) inconsistent with data columns (18) at data line 494
Header values: ['Species', 'Chemical Name', 'Freq-GHz(rest frame,redshifted)', 'Freq Err(rest frame,redshifted)', 'Meas Freq-GHz(rest frame,redshifted)', 'Meas Freq Err(rest frame,redshifted)', 'Resolved QNs', 'CDMS/JPL Intensity', 'Sijμ2 (D2)', 'Sij', 'Log10 (Aij)', 'Lovas/AST Intensity', 'E_L (cm^-1)', 'E_L (K)', 'E_U (cm^-1)', 'E_U (K)', 'Linelist']
Data values: ['l-C5D', '2,4-Pentadiynylidyne', '6.76284200', '1.2E-6', '', '', 'J-1/2', '2-1,Ω=1/2,f', '-6.03400', '95.30165', '0.00000', '-7.54376', '', '0.00000', '0.00000', '0.22558', '0.32457', 'CDMS']

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "C:\Users\wheey\Anaconda3\lib\site-packages\astroquery\utils\class_or_instance.py", line 25, in f
return self.fn(obj, *args, **kwds)
File "C:\Users\wheey\Anaconda3\lib\site-packages\astroquery\utils\process_asyncs.py", line 29, in newmethod
result = self._parse_result(response, verbose=verbose)
File "C:\Users\wheey\Anaconda3\lib\site-packages\astroquery\splatalogue\core.py", line 476, in _parse_result
format='basic')
File "C:\Users\wheey\Anaconda3\lib\site-packages\astropy\io\ascii\ui.py", line 368, in read
dat = _guess(table, new_kwargs, format, fast_reader)
File "C:\Users\wheey\Anaconda3\lib\site-packages\astropy\io\ascii\ui.py", line 574, in _guess
raise core.InconsistentTableError('\n'.join(lines))
astropy.io.ascii.core.InconsistentTableError:
ERROR: Unable to guess table format with the guesses listed below:
Reader:FastBasic delimiter: ':' fast_reader: {'enable': True} fill_values: [('', '0')]
Reader:Basic delimiter: ':' fast_reader: {'enable': True} fill_values: [('', '0')]
Reader:Basic delimiter: ':' fast_reader: {'enable': True} fill_values: [('', '0')]

************************************************************************
** ERROR: Unable to guess table format with the guesses listed above. **
** **
** To figure out why the table did not read, use guess=False and **
** fast_reader=False, along with any appropriate arguments to read(). **
** In particular specify the format and any known attributes like the **
** delimiter. **
************************************************************************
>>>
```

Contributor guide

Open the contributing guide

Research direction

Start with Splatalogue.query_lines() and astroquery/splatalogue/core.py, especially _parse_result at the traceback location. Reproduce the 6.7–6.8 GHz query and inspect the returned row for 2,4-Pentadiynylidyne. Done means the query parses successfully and returns line data without an InconsistentTableError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.