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

update to 2.6.1: bugfix in downloadversionIRdata, verbose level is now passed...

update to 2.6.1: bugfix in downloadversionIRdata, verbose level is now passed throw the single slow download way also
parent a7d81e1a
......@@ -3,7 +3,7 @@
Created on Wed Oct 25 15:51:46 2017
updated on Tue Aug 21 10:20:00 2018
Version: 2.6.0
Version: 2.6.1
(Numbering: #of big changes(OP1.2a download V1, OP1.2b download V2) . #of updates to add functionalities . #number of updates for bug fixes )
@author: holn
"""
......@@ -532,7 +532,7 @@ def get_NUCed_background_by_times(port,t0,t1,t_exp,cfilter,gain,offset,version=0
plt.title("background image nuced")
return exist,btime[0],background
def download_raw_images_by_program(port,program,time_s=0,version=0):
def download_raw_images_by_program(port,program,time_s=0,version=0,verbose=0):
# prog=AKF_1.get_program_from_PID(program)
try:
t_program = AKF_2.get_program_from_to(program)
......@@ -545,17 +545,18 @@ def download_raw_images_by_program(port,program,time_s=0,version=0):
tstop=time_s[1]
if tstop<tstart:
raise Exception("endtime before starttime")
return download_raw_images_by_times(port,int(starttime+tstart*1e9),int(starttime+tstop*1e9),version)
return download_raw_images_by_times(port,int(starttime+tstart*1e9),int(starttime+tstop*1e9),version,verbose=verbose-1)
else:
if time_s==0:
return download_raw_images_by_times(port,starttime,stoptime,version)
return download_raw_images_by_times(port,starttime,stoptime,version,verbose=verbose-1)
else:
return download_raw_images_by_times(port,starttime,int(starttime+time_s*1e9),version)
return download_raw_images_by_times(port,starttime,int(starttime+time_s*1e9),version,verbose=verbose-1)
except:
print("cannot find the program")
if verbose>0:
print("cannot find the program")
return False,0,0
def download_raw_images_by_times(port,starttime,stoptime,version=0,intervalSize=1E9):
def download_raw_images_by_times(port,starttime,stoptime,version=0,intervalSize=1E9,verbose=0):
OP=IR_tools.get_OP_by_time(time_ns=starttime)
if OP=="OP1.2a":
if port==50:#camera=="INFRATEC" or camera=="infratec" or camera=="Infratec":
......@@ -567,7 +568,8 @@ def download_raw_images_by_times(port,starttime,stoptime,version=0,intervalSize=
version=get_latest_version("QRT_IRCAM/"+"AEF"+str(port)+"_raw_DATASTREAM")
larchivepath=archivepath+"QRT_IRCAM/"+"AEF"+str(port)+"_raw_DATASTREAM/V"+str(version)+"/0/raw"
else:
print("camera unknown, stopping here")
if verbose>0:
print("camera unknown, stopping here")
raise Exception
elif OP=="OP1.2b":
if version==0:
......@@ -576,7 +578,8 @@ def download_raw_images_by_times(port,starttime,stoptime,version=0,intervalSize=
if (stoptime-starttime)/intervalSize>1:
nrinterv=int(np.ceil((stoptime-starttime)/intervalSize))
print("timewindow to large, splitting into smaller fractions ("+str(nrinterv)+")",(stoptime-starttime)/1e9)
if verbose>0:
print("timewindow to large, splitting into smaller fractions ("+str(nrinterv)+")",(stoptime-starttime)/1e9)
intervalls=[]
for i in range(nrinterv):
intervalls.append(int(starttime-10+i*intervalSize))
......@@ -599,7 +602,8 @@ def download_raw_images_by_times(port,starttime,stoptime,version=0,intervalSize=
time=np.append(time,t)
del images,t
except urllib.error.URLError as e:
print(e)
if verbose>0:
print(e)
return True,time,allimages
else:
try:
......@@ -612,7 +616,8 @@ def download_raw_images_by_times(port,starttime,stoptime,version=0,intervalSize=
del signal_list
return True, t, images
except urllib.error.URLError as e:
print(e)
if verbose>0:
print(e)
return False, 0,-1
if fastDL:
......
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