6 from sys
import platform
8 import pylib.ISToolsDataSorted
as itd
9 import pylib.ISToolsPlot
as itp
10 import pylib.ISDataAnalytics
as ida
11 import pylib.newISDataAnalytics
as newida
23 if settings_file
is not None:
24 with open(settings_file)
as data_file:
25 data = json.load(data_file)
26 directory = data[
'dataInfo'][
'dataDirectory']
27 subdir = data[
'processData'][
'datasets'][0][
'folder']
28 serialNumbers = data[
'processData'][
'datasets'][0][
'SerialNumbers']
30 directory = opt[
'directory']
31 serialNumbers = opt[
'serials']
33 print(
"Directory: %s" % directory)
34 print(
"Folder: %s" % subdir)
35 print(
"Serial Numbers: %s" % serialNumbers)
45 itd.setRefLla( np.r_[ 40.0557114, -111.6585476, 1426.77 ] )
47 if pe[
'postProcess']==1:
49 googleEarthTemp = pe[
'googleEarth']
52 if opt[
'showReference']
or pe[
'postProcess']==0:
54 log =
_load(directory, opt)
56 if pe[
'postProcess']==1:
57 directory +=
'/post_processed' 58 pe[
'googleEarth'] = googleEarthTemp
61 log =
_load(directory, opt)
64 if opt[
'checkRawDataDrop']:
65 ida.checkRawDataDrop(log)
69 plotlog(log, directory, serialNumbers, opt, pe)
72 if opt[
'rmsCalc']
and not opt[
'showReference']:
73 newida.calcRMS(log, directory, subdir)
75 return (log, directory)
84 tru.loadData(refIns=1)
90 log.loadData(directory, startDev=opt[
'start'], devCount=opt[
'count'])
97 def plotlog(log, directory, serialNumbers, opt, pe):
100 timePlotStart = systime.time()
104 dst = os.path.join(directory,
"figures")
105 if pe[
'postProcess']==1:
106 dst = os.path.join(dst,
'post_processed')
108 if not os.path.exists(dst):
113 for device2
in log.devices:
114 if device2.serialNumber
not in serialNumbers
and not "ALL" in serialNumbers
and serialNumbers != []:
117 referencePlot =
False 121 f = itp.IsLoggerPlot( pe, device2, startFigure=figNum, saveFigs=opt[
'saveFigs'], saveFigsDirectory=dst, referencePlot=referencePlot, numDevs=len(log.devices))
123 if opt[
'combinePlots']==0:
125 print(
"Total times: Load %.2fs Plot %.2fs" % (log.loadTime, systime.time()-timePlotStart))