Commit a7d81e1a authored by Holger Niemann's avatar Holger Niemann
Browse files

add ToDo list, add file to create HDF5 file with temperature from archive,...

add ToDo list, add file to create HDF5 file with temperature from archive, change upload (small bug fixes), activate delay in upload
parent e20dc780
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 4 13:28:31 2017
@author: holn
save V2 into new files
"""
if __name__=='__main__':
import h5py as h5
import downloadversionIRdata as IR_DL
import numpy as np
localpath=""
time_s=4
programlist = ["20171018.011"]
ports=[51]
for program in programlist:
for port in ports:
try:
exist,dimof,data1,valid=IR_DL.get_temp_from_raw_by_program_V2(portnr=port,program=program,time_s=time_s,threads=4)
if exist:
print("data found")
stream="images"
data1=np.asarray(data1)
data1=data1.swapaxes(0,2)
data1=data1.swapaxes(0,1)
dtype = str(data1.dtype)
tmpfile = localpath+"AEF"+str(port)+"_"+program+"_int_temp_V2"
tmpfile += ".h5"
with h5.File(tmpfile, 'w') as f:
f.create_dataset('timestamps', data=dimof, dtype='uint64' )#,compression="gzip")
f.create_dataset(stream, data=data1, dtype='uint16' , chunks = (np.shape(data1)[0],np.shape(data1)[1],1))
except Exception as E:
print(E)
\ No newline at end of file
download:
- implement the work around for AEF50 in the download to make the NUC
- change multiprocessing to multi-threading
- implement multi-emissivity calculation
- implement absolute calibration
- implement download of the stored temperature data (After the upload)
- implement download of the stored heat flux data (After the upload)
upload:
- upload the new nucing files for AEF50 (the workaround)
- upload remaining data from failed uploads
- upload scene models
- upload temperature
- upload heat flux data
......@@ -525,6 +525,7 @@ try:
print(datetime.datetime.now(),"raw 1 upload failed",response[1],response[2])
rawres1=0
temp_raw=not pari
trys+=1
# foutf.write(datetime.datetime.now(),"raw 1 upload failed",response[1],response[2],"\n")
except Exception as E:
trys+=1
......@@ -549,6 +550,7 @@ try:
print(datetime.datetime.now(),"raw 2 upload failed",response[1],response[2])
rawres2=0
temp_raw=not pari
trys+=1
# foutf.write(datetime.datetime.now(),"raw 2 upload failed",response[1],response[2],"\n")
except Exception as E:
trys+=1
......@@ -584,6 +586,11 @@ try:
except:
print('could not delete file "%s"' % path+"\\"+rlist[fkeys[f2]])
pass
try:
print("deleting now the folder")
os.rmdir(path)
except Exception as E:
print("could not delete the folder",str(prog_time),E)
# foutf.write(datetime.datetime.now(),"raw upload deactivated","\n")
else:#folder is empty
print("no files in",prog_time)
......
......@@ -32,7 +32,7 @@ except Exception as E:
try:
config_path="\\\\sv-e4-fs-1\\E4-Mitarbeiter\\E4 Diagnostics\\QIR\\Software\\QI-RealTime\\v1.0.0\\release\\QIR-IrAnalysis\\Config\\Thermal calibration\\"
config_path="\\\\sv-e4-fs-1\\E4-Mitarbeiter\\E4 Diagnostics\\QIR\\Software\\QI-RealTime\\1.0.0\\release\\QIR-IrAnalysis\\Config\\Thermal calibration\\"
FOV=plt.imread(config_path+portcamdict['OP1.2a']['AEF'+str(10)]+"\\"+"AEF"+str(10)+"_FOV.png")[:,:,0]
del FOV
except:
......@@ -2076,7 +2076,10 @@ def get_program_from_PID(instring):
else:
return True, pl[id]
"""
end of the copied functions
@author: thomsen
"""
#%%
if __name__=='__main__':
......@@ -2094,37 +2097,53 @@ if __name__=='__main__':
prog="20180724.030"
port=51
program="20180809.010"
plt.figure()
for port in [10,11,20,21,30,31,40,41,51]:
framerate=get_camera_framerate_by_program(port,program)
if framerate[0]:
plt.plot(framerate[1],framerate[2],label="AEF"+str(port))
plt.legend()
plt.grid()
# plt.figure()
# for port in [10,11,20,21,30,31,40,41,51]:
# framerate=get_camera_framerate_by_program(port,program)
# if framerate[0]:
# plt.plot(framerate[1],framerate[2],label="AEF"+str(port))
# plt.legend()
# plt.grid()
port=10
prog="20180816.016"
prog="20180816.018"#[0,6]
status,time,images,valid=get_temp_from_raw_by_program(port,prog,time_s=0,emi=0.82,T_version=2,version=0,threads=1,give_ERROR=False,use_firstframe_as_background=False,verbose=5)
port=21
prog="20180822.017"
status,time,images,valid=get_temp_from_raw_by_program(port,prog,time_s=[6,7],emi=0.82,T_version=2,version=0,threads=1,give_ERROR=False,use_firstframe_as_background=False,verbose=5)
# status,time,images=download_raw_images_by_program_via_png(port,prog,time_s=1,threads=4,verbose=0)
# test=get_NUC_by_program(port,prog,8,version=0,verbose=5)
# print(len(images))
# prog=get_program_from_PID(prog)
# if prog[0]:
# t0time=prog[1]['trigger']['0'][0]
# starttime=prog[1]['trigger']['1'][0]
# import h5py as h5
# szene=h5.File("X:\\E4 Diagnostics\\QIR\Calibrations\\scene_models\\AEF"+str(port)+"\\AEF"+str(port)+"_scene_model.h5")
# szene=h5.File("\\\\sv-e4-fs-1\\E4-Mitarbeiter\\E4 Diagnostics\\QIR\Software\\QI-RealTime\\1.1.0\\QRT-Analysis\\release\\Config\\spatial_calibration\\AEF"+str(port)+"_scene_model.h5",'r')
# szene=h5.File("X:\\E4 Diagnostics\\QIR\Data\\For Holger\\AEF21_scene_model_1531872000000000000.h5",'r')
# Xloc=np.asarray(szene['x'])
# Yloc=np.asarray(szene['y'])
# Zloc=np.asarray(szene['z'])
# CAD=np.asarray(szene['CAD'])
# timpo=0.87
# fid=IR_tools.find_nearest((np.asarray(time)-time[0])/1e9,timpo)
# plt.figure()#
# plt.imshow(CAD,cmap='gray')
# plt.imshow(images[-1],vmin=400,vmax=600,cmap=fu.exJet_trans)
# plt.imshow(CAD,cmap='gray')
# plt.imshow(images[fid-8]-images[fid-28],vmin=0,vmax=60,cmap=exJet_trans)
# cb=plt.colorbar()
# cb.set_label("temperature K", rotation=270,labelpad=26,fontsize=26)
# cb.set_label("temperature difference K", rotation=270,labelpad=26,fontsize=26)
# cb.ax.tick_params(labelsize=26)
# plt.figure()#
# plt.imshow(images[fid-20]-images[fid-40],vmin=0,vmax=40,cmap=exJet)
# cb=plt.colorbar()
# cb.set_label("temperature difference K", rotation=270,labelpad=26,fontsize=26)
# cb.ax.tick_params(labelsize=26)
# plt.figure()# # plt.imshow(CAD,cmap='gray')
# plt.imshow(images[-1],vmin=300,vmax=400,cmap=exJet)
# plt.imshow(images[fid-40],vmin=300,vmax=400,cmap=exJet)
# cb=plt.colorbar()
# cb.set_label("temperature K", rotation=270,labelpad=26,fontsize=26)
# cb.ax.tick_params(labelsize=26)
# proglist=["20180801.014","20180801.015","20180801.016","20180801.018","20180801.019"]
# portlist=[20,21,51]
# version=0
......
### specifications ###
port="AEF10"
local=True
delayupload=False
delayupload=True
starttime="20:00:00"
singleupload=False
use_today=True
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment