-
Notifications
You must be signed in to change notification settings - Fork 0
/
library-creator.py
executable file
·41 lines (36 loc) · 1.21 KB
/
library-creator.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
from JTA_FFT_try import JTA_FFT
import os
import glob
import numpy as np
import gc
import nvtx
@nvtx.annotate("Library-Creator", color = "blue")
def main():
HOME_DIR = "/red/nvidia-ai/miller-lab/data"
study_list = ["GMK"]
for study in study_list:
study_dir = HOME_DIR + "/" + study
NFD_DIR = study_dir + "/lib/"
if not os.path.exists(NFD_DIR):
os.mkdir(NFD_DIR)
if os.path.exists(study_dir + "/cal1024.txt"):
cal = study_dir + "/cal1024.txt"
else:
cal = study_dir + "/calibration.txt"
if not os.path.exists(cal):
raise Exception("NO calibration file found")
for stl in glob.glob1(study_dir, "*.stl"):
stl_path = study_dir + "/" + stl
stl_name = os.path.splitext(stl)[0]
print(stl_path)
if os.path.exists(NFD_DIR + stl_name + ".nfd"):
print("Skipped: ", stl_name)
continue
else:
NFD = JTA_FFT(cal)
NFD.create_nfd_library(stl_path)
NFD.print_library(0,0.1,200)
NFD.save_nfd_library(NFD_DIR + stl_name)
del(NFD)
if __name__ == '__main__':
main()