-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdata_scatter_plot_input_cal.py
More file actions
64 lines (52 loc) · 1.38 KB
/
data_scatter_plot_input_cal.py
File metadata and controls
64 lines (52 loc) · 1.38 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
60
61
62
63
64
"""
关联py:
ts_data_scatter_plot_output.py
对比数据,生成pdf
散点图生成
读取json数据:
主参数
main_dic = {
csv_path0 : str
csv_path1 : str
ts_dic0 : {
rms : [float, float, ...]
min : [float, float, ...]
max : [float, float, ...]
testname : str
chantitle : [str, str, ...]
samplerate : [float, float, ...]
}
ts_dic1 : { ... }
}
"""
import logging
import sys
import json
import re
import os
import copy
from pyadams.datacal import plot
from pyadams.file import office_docx, pdf_scatter_plot
import importlib
importlib.reload(logging)
with open('data_scatter_plot_input_cal.log', 'w') as f : pass
logging.basicConfig(level=logging.INFO, filename='data_scatter_plot_input_cal.log')
logger = logging.getLogger('data_scatter_plot_input_cal')
# 运行
json_path = sys.argv[1]
# json_path = r'D:\github\pyncode\ts_data_scatter_plot_output.json'
docx_path = json_path[:-4]+'docx'
# figpath = json_path[:-5]
# json读取
with open(json_path, "r") as f:
main_dic = json.load(f)
logger.info(f'load json_path : {json_path}')
csv_path0 = main_dic['csv_path0']
csv_path1 = main_dic['csv_path1']
ts_dic0 = main_dic['ts_dic0']
ts_dic1 = main_dic['ts_dic1']
pdf_path = pdf_scatter_plot.pdf_scatter_plot_csv(csv_path0, csv_path1, docx_path)
logger.info(f'load pdf_path: {pdf_path}')
os.system(pdf_path)
logger.info('End')
logger.shutdown()