Commit 08098036 authored by Peter Drewelow's avatar Peter Drewelow
Browse files

clarified error message of program trigger were not found in get_calib_data

parent 782d0a01
......@@ -217,11 +217,11 @@ def correct_images(images,badpixels):
if type(badpixels)!=int:
if type(images) == list:
# return corrected images also as list of 2D arrays
images = restore_bad_pixels(images, np.invert(badpixels==1)).astype(np.float32)
images = restore_bad_pixels(images, np.invert(badpixels==1))
images = list(images)
else:
# keep shape
images = restore_bad_pixels(images, np.invert(badpixels==1)).astype(np.float32)
images = restore_bad_pixels(images, np.invert(badpixels==1))
# for i in range(len(images)):
# images[i]=(restore_pixels(images[i],np.invert(badpixels==1))).astype(np.float32)
......
......@@ -1340,6 +1340,11 @@ def get_calib_data(port,program,emissivity=0.8,Temp_V=2,version=0,back_emissivit
t0=prog[0]['trigger']['0'][0]
t1=prog[0]['trigger']['1'][0]
t6=prog[0]['trigger']['6'][0]
except Exception as E:
print("Warning: Program trigger were not found")
print(E)
return 0,0,0,0,0,0,0,0,0,0
OP=get_OP_by_program(program)
Camera=portcamdict[OP]['AEF'+str(port)]
if Camera.split("_")[0]=="Infratec":
......@@ -1405,7 +1410,7 @@ def get_calib_data(port,program,emissivity=0.8,Temp_V=2,version=0,back_emissivit
bmap = np.load(join(IRCamColdframes_fittingpath, filestring + '_b.npy'))
cirebuild = IR_tools.reconstruct_coldframe(t_exp, sT, amap, bmap, coldref)
gain, offset = IR_tools.calculate_gain_offset_image(cirebuild, None, coldref, hotref)
gain[gain == np.inf] = 0
gain[gain == np.inf] = 1
offset[offset == np.inf] = 0
badpixels=find_badpixels(port,gain,offset,niterations=10,tolerance=10)
gain_error=0
......@@ -1425,7 +1430,7 @@ def get_calib_data(port,program,emissivity=0.8,Temp_V=2,version=0,back_emissivit
else:
ci = NUC_DL[1][2]
gain, offset = IR_tools.calculate_gain_offset_image(ci, None, coldref, hotref)
gain[gain == np.inf] = 0
gain[gain == np.inf] = 1
offset[offset == np.inf] = 0
badpixels=find_badpixels(port,gain,offset,niterations=10,tolerance=10)
gain_error=0
......@@ -1468,9 +1473,7 @@ def get_calib_data(port,program,emissivity=0.8,Temp_V=2,version=0,back_emissivit
else:
raise Exception("no exposure time found")
return background,LUT,refT,gain,offset,badpixels,t_exp,cfilter,gain_error,offset_error
except:
print("Warning: Program was not found")
return 0,0,0,0,0,0,0,0,0,0
def find_badpixels(port, gain, offset, init_bp_list=None, niterations=3,
tolerance=10, plot_it=False, verbose=0):
......
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