Commit 5a0379bb authored by Holger Niemann's avatar Holger Niemann
Browse files

Merge branch 'Holgers' into 'master'

V3.2.1: bug fixes in load request creation and for OP1.2b data of AEF50 (on...

See merge request !28
parents 46bc3647 c508f913
......@@ -4,7 +4,7 @@ Created on Wed Oct 25 15:51:46 2017
updated on Tue Aug 21 10:20:00 2018
last update on Fr Nov 23 15:37:00 2018
Version: 3.2.0
Version: 3.2.1
(Numbering: #of big changes(OP1.2a download V1, OP1.2b download V2, heatflux V3) . #of updates to add functionalities . #number of updates for bug fixes )
@author: holn
"""
......@@ -44,40 +44,6 @@ except:
config_path=""
# These two functions seem unused and will be deleted.
# They are redundant to
# IR_tools.get_OP_by_time(time_ns=None, shot_no=None, program_str=None)
# which should be used instead.
#
#def get_OP_by_program(program):
# try:
# bla=int(program.split(".")[0])
# time_ns=int(TimeToNs([bla // 10000,bla % 10000 // 100,bla % 10000 % 100],[10,0,0,0]))
# return get_OP_by_time(time_ns)
# except Exception as E:
# print(E)
# return None
#
#def get_OP_by_time(time_ns):
# dateOP=datetime.datetime.utcfromtimestamp(time_ns/1e9)
# if dateOP.year==2017:
# if dateOP.month>8 and dateOP.month<12:
# return "OP1.2a"
# elif dateOP.month==8 and dateOP.day>=28:
# return "OP1.2a"
# elif dateOP.month==12 and dateOP.day<8:
# return "OP1.2a"
# else:
# return None
# elif dateOP.year==2018:
# return "OP1.2b"
# elif dateOP.year<=2016 and dateOP.year>=2015:
# if (dateOP.year==2016 and dateOP.month<=3) or (dateOP.year==2015 and dateOP.month==12):
# return "OP1.1"
# else:
# return None
def get_latest_version(stream,project="W7X",Test=False,t_from=None,t_to=None,program=None):
"""Find out latest version of given stream
:param stream url stream of interest
......@@ -563,7 +529,9 @@ def get_NUCed_background_by_times(port,t0,t1,t_exp,cfilter,gain,offset,version=0
OP1.2b function
"""
exist,btime,backgroundframes=download_calibration_raw_files_by_time(port,t_exp,t0,t1,frametype=1,version=version,verbose=verbose-1)
camera=portpathdict["OP1.2b"]["AEF"+str(port)]
camera=portcamdict["OP1.2b"]["AEF"+str(port)]
if verbose>50:
print("camera is",camera)
background=np.zeros(np.shape(backgroundframes[0]),dtype=np.uint64)
for frame in backgroundframes:
background+=frame
......@@ -3108,7 +3076,7 @@ def download_divertor_load(port,targetmodule=None,program=None,tstart=None,tend=
if verbose>0:
print('download_divertor_load: Error! ',E)
programid=str(tstart)
f.write(programid+"\tAEF"+str(port)+"\n")
f.write(programid+"\t"+str(port)+"\n")
f.close()
return exist,time,load,error
......@@ -3275,12 +3243,12 @@ end of the copied functions
if __name__=='__main__':
print("local function calling")
#%% temperature download and plotting example
port="AEF20"#"AEF51"
prog="20171109.021"#"20171109.021"#"20181010.036"
# Test=True
status,time,images,valid=get_temp_from_raw_by_program(port,prog,time_window=[0,6.5],emi=0.82,T_version=2,version=0,threads=1,give_ERROR=False,use_firstframe_as_background=False,verbose=50,framerate=1)
success,t,s,profile=extract_temperature_profile_from_DL(port,np.asarray(time-time[0])/1e9,images,profile="TM3h_5_5",verbose=10,reference_time=time[0])
# port=50#"AEF50"#"AEF51"
# prog="20180920.042"#"20171109.021"#"20181010.036"
# status,time,images,valid=get_temp_from_raw_by_program(port,prog,time_window=[0,2],emi=0.82,T_version=2,version=0,threads=1,give_ERROR=False,use_firstframe_as_background=False,verbose=50,framerate=1)
# success,t,s,profile=extract_temperature_profile_from_DL(port,np.asarray(time-time[0])/1e9,images,profile="TM3h_5_5",verbose=10,reference_time=time[0])
# if status:
# plt.figure()
# plt.imshow(images[0],vmin=330,vmax=1000,cmap=exJet)
......
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