Skip to content

Commit 7ffe123

Browse files
authored
Merge pull request #2960 from keflavich/splatalogue_feb2024
API: Fix splatalogue module with upstream changes
2 parents 8e7c6af + 9f2c437 commit 7ffe123

File tree

13 files changed

+399
-477
lines changed

13 files changed

+399
-477
lines changed

CHANGES.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ mpc
1313

1414
- Parse star catalog information when querying observations database [#2957]
1515

16+
splatalogue
17+
^^^^^^^^^^^
18+
19+
- Fix incompatibilities with the major changes made to the Splatalogue's upstream server in March 2024. [#2960]
20+
1621
vizier
1722
^^^^^^
1823

astroquery/splatalogue/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ class Conf(_config.ConfigNamespace):
2121
'Splatalogue SLAP interface URL (not used).')
2222
base_url = 'https://splatalogue.online'
2323
query_url = _config.ConfigItem(
24-
f'{base_url}/c_export.php',
25-
# defunct as of Sep 4, 2020? (keeping because this is likely the true host)
26-
# 'https://www.cv.nrao.edu/php/splat/c_export.php',
24+
f'{base_url}/splata-slap/advanceded/false',
2725
'Splatalogue web interface URL.')
2826
timeout = _config.ConfigItem(
2927
60,

astroquery/splatalogue/core.py

Lines changed: 185 additions & 150 deletions
Large diffs are not rendered by default.

astroquery/splatalogue/setup_package.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
def get_package_data():
8-
paths_test = [os.path.join('data', 'CO_colons.csv'),
8+
paths_test = [os.path.join('data', 'CO.json'),
99
]
1010

1111
paths_data = [os.path.join('data', '*.json'),

astroquery/splatalogue/slap.py

Lines changed: 0 additions & 58 deletions
This file was deleted.

astroquery/splatalogue/templates.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
from .core import SplatalogueClass
77

88
SplatalogueKelvins = SplatalogueClass(energy_max=500, energy_type='eu_k',
9-
energy_levels=['el4'],
10-
line_strengths=['ls4'],
9+
energy_levels=['Four'],
10+
line_strengths=['CDMSJPL'],
1111
only_NRAO_recommended=True, noHFS=True)

astroquery/splatalogue/tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from astroquery.utils.mocks import MockResponse
77

88

9-
SPLAT_DATA = 'CO_colons.csv'
9+
SPLAT_DATA = 'CO.json'
1010

1111

1212
def data_path(filename):
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"species_id": 990, "name": "CO <font color=\"red\">v = 1</font>", "chemical_name": "Carbon Monoxide", "resolved_QNs": " 1- 0", "linelist": "CDMS", "LovasASTIntensity": " ", "lower_state_energy": 2143.2711, "upper_state_energy": 2147.08113, "sijmu2": 0.00723, "sij": 1.0, "aij": -7.37879, "intintensity": "-9.7069", "Lovas_NRAO": 1, "orderedfreq": 114221.7523, "lower_state_energy_K": 3083.67129, "upper_state_energy_K": 3089.15304, "orderedFreq": "114221.7523 (0.0013), <span style = 'color: #DC143C'>114221.7523</span>", "measFreq": " <span style = 'color: #DC143C'></span>", "upperStateDegen": "3", "moleculeTag": 28512, "qnCode": 1202, "labref_Lovas_NIST": " ", "rel_int_HFS_Lovas": " ", "unres_quantum_numbers": " 1 1 0 1", "lineid": 6187001, "transition_in_space": 0, "transition_in_G358": 0, "obsref_Lovas_NIST": " ", "source_Lovas_NIST": " ", "telescope_Lovas_NIST": " ", "orderFreqColName": "Freq in GHz (Err)<br>(rest frame, <p class = 'search-results-red search-results-para'>redshifted<span class = 'search-results-black search-results-para'>)</span></p>", "measFreqColName": "Meas Freq in GHz (Err)<br>(rest frame, <p class = 'search-results-red search-results-para'>redshifted<span class = 'search-results-black search-results-para'>)</span></p>", "transitionBandColor": "datatableskyblue", "searchErrorMessage": "", "sqlquery": null}, {"species_id": 990, "name": "CO <font color=\"red\">v = 1</font>", "chemical_name": "Carbon Monoxide", "resolved_QNs": " 1- 0", "linelist": "SLAIM", "LovasASTIntensity": " ", "lower_state_energy": 2143.272, "upper_state_energy": 2147.08203, "sijmu2": 0.01212, "sij": 1.0, "aij": -7.15428, "intintensity": "", "Lovas_NRAO": 0, "orderedfreq": 114221.757, "lower_state_energy_K": 3083.67258, "upper_state_energy_K": 3089.15433, "orderedFreq": "114221.757 (0.003), <span style = 'color: #DC143C'>114221.757</span>", "measFreq": "114221.74 (0.04), <span style = 'color: #DC143C'>114221.74</span>", "upperStateDegen": "3", "moleculeTag": 0, "qnCode": 0, "labref_Lovas_NIST": " Dix77", "rel_int_HFS_Lovas": "", "unres_quantum_numbers": " 1 - 0 v=1", "lineid": 3768099, "transition_in_space": 0, "transition_in_G358": 0, "obsref_Lovas_NIST": " ", "source_Lovas_NIST": " ", "telescope_Lovas_NIST": " ", "orderFreqColName": null, "measFreqColName": null, "transitionBandColor": "datatableskyblue", "searchErrorMessage": "", "sqlquery": null}, {"species_id": 204, "name": "CO <font color=\"red\">v = 0</font>", "chemical_name": "Carbon Monoxide", "resolved_QNs": "1-0", "linelist": "CDMS", "LovasASTIntensity": "60.0", "lower_state_energy": 0.0, "upper_state_energy": 3.84503, "sijmu2": 0.01212, "sij": 1.0, "aij": -7.14246, "intintensity": "-5.0105", "Lovas_NRAO": 1, "orderedfreq": 115271.2018, "lower_state_energy_K": 0.0, "upper_state_energy_K": 5.53211, "orderedFreq": " <span style = 'color: #DC143C'></span>", "measFreq": "115271.2018 (5.0E-4), <span style = 'color: #DC143C'>115271.2018</span>", "upperStateDegen": "3", "moleculeTag": -28503, "qnCode": 101, "labref_Lovas_NIST": " ", "rel_int_HFS_Lovas": " ", "unres_quantum_numbers": "J=1-0", "lineid": 363613, "transition_in_space": 0, "transition_in_G358": 0, "obsref_Lovas_NIST": "Uli76", "source_Lovas_NIST": " OriMC-1", "telescope_Lovas_NIST": " NRAO 11m", "orderFreqColName": null, "measFreqColName": null, "transitionBandColor": "datatableskyblue", "searchErrorMessage": "", "sqlquery": null}, {"species_id": 204, "name": "CO <font color=\"red\">v = 0</font>", "chemical_name": "Carbon Monoxide", "resolved_QNs": "1-0", "linelist": "JPL", "LovasASTIntensity": " ", "lower_state_energy": 0.0, "upper_state_energy": 3.84503, "sijmu2": 0.01212, "sij": 1.0, "aij": -7.14246, "intintensity": "-5.0105", "Lovas_NRAO": 0, "orderedfreq": 115271.2018, "lower_state_energy_K": 0.0, "upper_state_energy_K": 5.53211, "orderedFreq": " <span style = 'color: #DC143C'></span>", "measFreq": "115271.2018 (5.0E-4), <span style = 'color: #DC143C'>115271.2018</span>", "upperStateDegen": "3", "moleculeTag": -28001, "qnCode": 101, "labref_Lovas_NIST": " ", "rel_int_HFS_Lovas": " ", "unres_quantum_numbers": "J=1-0", "lineid": 824116, "transition_in_space": 0, "transition_in_G358": 0, "obsref_Lovas_NIST": " ", "source_Lovas_NIST": " ", "telescope_Lovas_NIST": " ", "orderFreqColName": null, "measFreqColName": null, "transitionBandColor": "datatableskyblue", "searchErrorMessage": "", "sqlquery": null}, {"species_id": 204, "name": "CO <font color=\"red\">v = 0</font>", "chemical_name": "Carbon Monoxide", "resolved_QNs": "1-0", "linelist": "Lovas/NIST", "LovasASTIntensity": "60.0", "lower_state_energy": 0.0, "upper_state_energy": 0.0, "sijmu2": 0.0, "sij": 0.0, "aij": 0.0, "intintensity": "", "Lovas_NRAO": 0, "orderedfreq": 115271.202, "lower_state_energy_K": 0.0, "upper_state_energy_K": 0.0, "orderedFreq": "115271.202 (0.001), <span style = 'color: #DC143C'>115271.202</span>", "measFreq": " <span style = 'color: #DC143C'></span>", "upperStateDegen": "", "moleculeTag": 0, "qnCode": 0, "labref_Lovas_NIST": "", "rel_int_HFS_Lovas": " ", "unres_quantum_numbers": "1-0", "lineid": 3732287, "transition_in_space": 0, "transition_in_G358": 0, "obsref_Lovas_NIST": "Uli76", "source_Lovas_NIST": " OriMC-1", "telescope_Lovas_NIST": " NRAO 11m", "orderFreqColName": null, "measFreqColName": null, "transitionBandColor": "datatableskyblue", "searchErrorMessage": "", "sqlquery": null}, {"species_id": 204, "name": "CO <font color=\"red\">v = 0</font>", "chemical_name": "Carbon Monoxide", "resolved_QNs": " 1- 0", "linelist": "SLAIM", "LovasASTIntensity": "60.0", "lower_state_energy": 0.0, "upper_state_energy": 3.84503, "sijmu2": 0.01212, "sij": 1.0, "aij": -7.14236, "intintensity": "", "Lovas_NRAO": 0, "orderedfreq": 115271.202, "lower_state_energy_K": 0.0, "upper_state_energy_K": 5.53211, "orderedFreq": "115271.202, <span style = 'color: #DC143C'>115271.202</span>", "measFreq": "115271.202 (0.001), <span style = 'color: #DC143C'>115271.202</span>", "upperStateDegen": "3", "moleculeTag": 0, "qnCode": 0, "labref_Lovas_NIST": " Win97", "rel_int_HFS_Lovas": "", "unres_quantum_numbers": " 1 - 0 v=0", "lineid": 3768098, "transition_in_space": 1, "transition_in_G358": 0, "obsref_Lovas_NIST": " ", "source_Lovas_NIST": " ", "telescope_Lovas_NIST": " ", "orderFreqColName": null, "measFreqColName": null, "transitionBandColor": "datatableskyblue", "searchErrorMessage": "", "sqlquery": null}, {"species_id": null, "name": null, "chemical_name": null, "resolved_QNs": null, "linelist": null, "LovasASTIntensity": null, "lower_state_energy": null, "upper_state_energy": null, "sijmu2": null, "sij": null, "aij": null, "intintensity": null, "Lovas_NRAO": null, "orderedfreq": null, "lower_state_energy_K": null, "upper_state_energy_K": null, "orderedFreq": null, "measFreq": null, "upperStateDegen": null, "moleculeTag": null, "qnCode": null, "labref_Lovas_NIST": null, "rel_int_HFS_Lovas": null, "unres_quantum_numbers": null, "lineid": null, "transition_in_space": null, "transition_in_G358": null, "obsref_Lovas_NIST": null, "source_Lovas_NIST": null, "telescope_Lovas_NIST": null, "orderFreqColName": null, "measFreqColName": null, "transitionBandColor": null, "searchErrorMessage": null, "sqlquery": "SELECT /*+ MAX_EXECUTION_TIME(60000) */species.species_id, species.name, species.chemical_name, main.resolved_QNs, main.frequency, main.uncertainty, main.measfreq, main.measerrfreq, main.rel_int_HFS_Lovas, main.quantum_numbers, main.upper_state_degeneracy, main.molecule_tag, main.qn_code, main.labref_Lovas_NIST, main.line_id ,main.transition_in_space, main.transition_in_G358, main.obsref_Lovas_NIST, main.source_Lovas_NIST, main.telescope_Lovas_NIST , linelists.linelist, main.lower_state_energy ,main.upper_state_energy ,main.upper_state_energy_K ,main.lower_state_energy_K , main.sijmu2, main.aij, main.sij, main.intintensity, main.obsintensity_Lovas_NIST as LovasASTIntensity , main.Lovas_NRAO, main.orderedfreq, main.lower_state_energy_K, main.upper_state_energy_K FROM main INNER JOIN species ON main.species_id = species.species_id INNER JOIN linelists ON main.ll_id = linelists.ll_id AND main.ll_id IN ( 10 ,11 , 12 ,14 ,15 ,16 ,17 ,18 ,19 ) AND (main.species_id = 204 OR main.species_id = 990 OR main.species_id = 991 OR main.species_id = 1343) AND (main.`v3.0` != 0) AND((main.orderedfreq >= 114000.0 AND main.orderedfreq <= 116000.0)) ORDER BY main.orderedfreq"}]

astroquery/splatalogue/tests/data/CO_colons.csv

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)