Skip to content

Commit

Permalink
add the basic lookuptable required for selecting things from the vamdc
Browse files Browse the repository at this point in the history
database
  • Loading branch information
keflavich committed Mar 9, 2016
1 parent 7155a87 commit bdd493e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions astroquery/vamdc/load_species_table.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy import log
from ..splatalogue.load_species_table import SpeciesLookuptable


def species_lookuptable():

log.info("Loading molecular line ID database")

from vamdclib import nodes
from vamdclib import request as r

nl = nodes.Nodelist()
nl.findnode('cdms')
cdms = nl.findnode('cdms')

request = r.Request(node=cdms)

# Retrieve all species from CDMS
result = request.getspecies()
molecules = result.data['Molecules']

lookuptable = SpeciesLookuptable({molecules[key].OrdinaryStructuralFormula: key
for key in molecules})

return lookuptable

0 comments on commit bdd493e

Please sign in to comment.