-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake_data.py
More file actions
60 lines (55 loc) · 1.64 KB
/
Copy pathmake_data.py
File metadata and controls
60 lines (55 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import math
import meta_data
import gvar as gv
import util_files as uf
import util_funcs as ut
from make_data_db import make_data_db
#from make_data_raw import make_data_raw
from make_data_raw import make_data_raw_fast,make_tag_data_raw_fast
def make_data (mdp,do_makedata,do_db=True,filename=""):
"""
--'filename' specifies list of files to import data from
-- takes data from those files and imports to gv.dataset object
"""
## -- for database objects (missing)
if do_db:
if do_makedata:
print "Making data from database"
make_data_db()
## -- for raw fnal-type correlators
else:
if do_makedata:
print "Making data from raw correlators"
import_file = filename
#make_data_raw(mdp,do_makedata,import_file)
make_data_raw_fast(mdp,do_makedata,import_file)
#
data_file_out = mdp.output_path + '/' + mdp.output_fname
print "Output data file : "+data_file_out
dset = gv.dataset.Dataset(data_file_out)
return gv.dataset.avg_data(dset),dset
## ------
##
def make_tag_data (mdp,filename):
"""
-- filename specifies list of files to import data from
-- takes data from those files and imports to gv.dataset object
"""
## -- for database objects (missing)
print "Making data from raw correlators..."
import_file = filename
make_tag_data_raw_fast(mdp,import_file)
data_file_out = mdp.output_path + '/' + mdp.output_fname
print "Output data file : "+data_file_out
dset = gv.dataset.Dataset(data_file_out)
return dset
## ------
##
def import_corfit_file(fname):
"""
-- import a corrfitter-formatted file and return the data
-- perhaps more parsing later
"""
return gv.dataset.Dataset('/project/axial/data/fit-in/'+fname)
## ------
##