-
-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add the basic lookuptable required for selecting things from the vamdc
database
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |