-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
111 lines (92 loc) · 3.74 KB
/
setup.py
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
from setuptools import setup, Extension
from version import get_git_version
setup(name='dsa110-nsfrb',
version=get_git_version(),
#version="0.1.0",
url='http://github.com/dsa110/dsa110-nsfrb',
python_requires='>3.8',
# requirements=['seaborn', 'astropy', 'hdbscan', 'progress'],
packages=['nsfrb','simulations_and_classifications','inject','dsaT4','realtime','realtime'],
zip_safe=False,
#ext_modules=[
# Extension(
# name="rtreader",
# sources=["realtime/rtreader/rtreader.c"],
# ),
# ]
)
#set CORR_INSTALL=True if installing realtime imager on the corr nodes
CORR_INSTALL=False
#get local nsfrb directory
import os
os.system("pwd > metadata.txt")
if not CORR_INSTALL:
#make logfile directory outside of git repo
os.system("mkdir ../dsa110-nsfrb-logfiles")
logfiles = ["error_log.txt",
"inject_error_log.txt",
"pipe_log.txt",
"run_log.txt",
"search_log.txt",
"process_log.txt",
"candcutter_log.txt",
"candcuttertask_log.txt",
"candcutter_error_log.txt",
"inject_log.txt",
"time_log.txt"]
for i in range(len(logfiles)):
l = logfiles[i]
os.system("touch ../dsa110-nsfrb-logfiles/" + l)
os.system("> ../dsa110-nsfrb-logfiles/" + l)
"""
#create file to store trials for candcutter
os.system("touch ../dsa110-nsfrb-candidates/DMtrials.npy")
os.system("touch ../dsa110-nsfrb-candidates/widthtrials.npy")
os.system("touch ../dsa110-nsfrb-candidates/SNRthresh.npy")
"""
#create directory for noise stats if not created already
os.system("mkdir ../dsa110-nsfrb-noise/")
"""
#create candidates directory
os.system("mkdir ../dsa110-nsfrb-candidates/")
os.system("mkdir ../dsa110-nsfrb-candidates/raw_cands/")
os.system("mkdir ../dsa110-nsfrb-candidates/final_cands/")
os.system("mkdir ../dsa110-nsfrb-candidates/backup_raw_cands/")
"""
#create injections directory
os.system("mkdir ../dsa110-nsfrb-injections/")
#create directory for stored PSFs
os.system("mkdir ../dsa110-nsfrb-PSF/")
#create directory for observing plans
os.system("mkdir ../dsa110-nsfrb-plans/")
import csv
"""
with open("../dsa110-nsfrb-injections/injections.csv","w") as csvfile:
wr = csv.writer(csvfile,delimiter=',')
wr.writerow(['ISOT','DM','WIDTH','SNR'])
csvfile.close()
with open("../dsa110-nsfrb-injections/recoveries.csv","w") as csvfile:
wr = csv.writer(csvfile,delimiter=',')
wr.writerow(['ISOT','DM','WIDTH','SNR','PREDICT','PROB'])
csvfile.close()
with open(os.environ['NSFRBDATA'] + "dsa110-nsfrb-candidates/fpr_test.csv","w") as csvfile:
csvfile.write("ISOT,SNR")
#wr = csv.writer(csvfile,delimiter=',')
#wr.writerow(['ISOT','SNR'])
csvfile.close()
with open(os.environ['NSFRBDATA'] + "dsa110-nsfrb-candidates/fnr_test.csv","w") as csvfile:
csvfile.write("ISOT,SNR")
#wr = csv.writer(csvfile,delimiter=',')
#wr.writerow(['ISOT','SNR'])
csvfile.close()
"""
#create directory to store most recent time frame
os.system("mkdir ../dsa110-nsfrb-frames/")
"""
#create directories for fast visibilities if not created already
os.system("mkdir ../dsa110-nsfrb-fast-visibilities/")
for s in ["lxd110h03","lxd110h04","lxd110h05","lxd110h06","lxd110h07","lxd110h08","lxd110h10","lxd110h11","lxd110h12","lxd110h14","lxd110h15","lxd110h16","lxd110h18","lxd110h19","lxd110h21","lxd110h22"]:
os.system("mkdir ../dsa110-nsfrb-fast-visibilities/" + s)
"""
#create ddirectories for images
os.system("mkdir ../dsa110-nsfrb-images/")