From bdd493e7d8ed7e95ea2bb85768432ae7ab816c2c Mon Sep 17 00:00:00 2001 From: "Adam Ginsburg (keflavich)" Date: Wed, 9 Mar 2016 12:03:05 +0100 Subject: [PATCH] add the basic lookuptable required for selecting things from the vamdc database --- astroquery/vamdc/load_species_table.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 astroquery/vamdc/load_species_table.py diff --git a/astroquery/vamdc/load_species_table.py b/astroquery/vamdc/load_species_table.py new file mode 100644 index 0000000000..9b99dcc6fd --- /dev/null +++ b/astroquery/vamdc/load_species_table.py @@ -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