Update load_1D.py

added the data type to dict, it is necessary for adding dat files into ccl dicts
This commit is contained in:
JakHolzer
2020-10-05 15:32:59 +02:00
committed by GitHub
parent e0227fb7e6
commit 456a15a365

View File

@ -18,8 +18,10 @@ META_VARS_STR = (
"proposal_user", "proposal_user",
"proposal_title", "proposal_title",
"proposal_email", "proposal_email",
"detectorDistance",
) )
META_VARS_FLOAT = ( META_VARS_FLOAT = (
"omega",
"mf", "mf",
"2-theta", "2-theta",
"chi", "chi",
@ -40,7 +42,6 @@ META_VARS_FLOAT = (
"mcvl", "mcvl",
"momu", "momu",
"mcvu", "mcvu",
"detectorDistance",
"snv", "snv",
"snh", "snh",
"snvm", "snvm",
@ -96,6 +97,7 @@ def parse_1D(fileobj, data_type):
# read data # read data
if data_type == ".ccl": if data_type == ".ccl":
metadata['data_type'] = data_type
measurements = {} measurements = {}
decimal = list() decimal = list()
data = fileobj.readlines() data = fileobj.readlines()
@ -160,6 +162,7 @@ def parse_1D(fileobj, data_type):
elif data_type == ".dat": elif data_type == ".dat":
# skip the first 2 rows, the third row contans the column names # skip the first 2 rows, the third row contans the column names
metadata['data_type'] = data_type
next(fileobj) next(fileobj)
next(fileobj) next(fileobj)
col_names = next(fileobj).split() col_names = next(fileobj).split()