Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB stored incorrectly, when data includes iso_id's >=10 #16

Open
okz opened this issue Feb 14, 2020 · 0 comments
Open

DB stored incorrectly, when data includes iso_id's >=10 #16

okz opened this issue Feb 14, 2020 · 0 comments

Comments

@okz
Copy link

okz commented Feb 14, 2020

The issue prevents loading DB's, even when they are downloaded with HAPI directly. e.g:

import hapi
import os

# start a fresh DB and download CO2=2, isotopologue=10
pathstr = './hapi/test'
hapi.db_begin(pathstr)
hapi.fetch('testme', 2, 10, 2250, 2251)
hapi.db_commit()

# open the DB path, loading the stored databases
hapi.db_begin(pathstr)    #  !this will cause an Exception

Viewing the data file, it seems HAPI saves the hitran file iso_id's in decimal, unlike the hitran web downloads:

#HAPI download
 210 2250.088119 1.280E-28 1.699E+02.06740.083 1682.20280.76-.002884       1 0 0 12       1 0 0 02                    R 36e     3777642231 5 4 5 7   150.0  146.0

#Hitran download
 20 2250.088119 1.280E-28 1.699e+02.06740.083 1682.20280.76-.002884       1 0 0 12       1 0 0 02                    R 36e     3777642231 5 4 5 7   150.0  146.0

During loads, HAPI expects the iso id's at a fixed location, and 1 digits. The Hitran Web downloads are loaded correctly, but files fetched with HAPI fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant