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

solving merge conflicts

parents fc2064cf 18cddd2c
......@@ -11,15 +11,15 @@ if __name__=='__main__':
import downloadversionIRdata as IR_DL
import numpy as np
localpath=""
time_s=13
time_s=1.5
programlist = ["20171121.013"]
ports=[10]
programlist = ["20171010.025"]
ports=[50]
for program in programlist:
for port in ports:
try:
exist,dimof,data1,valid=IR_DL.get_temp_from_raw_by_program(portnr=port,program=program,time_s=time_s,threads=4,verbose=5)
exist,dimof,data1,valid=IR_DL.get_temp_from_raw_by_program(portnr=port,program=program,time_window=time_s,threads=4,verbose=5)
if exist:
print("data found")
stream="images"
......
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 5 09:26:06 2018
Version: 3.3.0
Version: 3.4.4
@author: holn
constants and config parameters
"""
......@@ -441,4 +441,4 @@ c2dict={
c3dict=c2dict.copy()
exJet=cm.colors.LinearSegmentedColormap('mod_Jet', c2dict, 1024)
c3dict['alpha']=((0.0,0.0,0.0),(0.33,0.99,0.99),(1.0,1.0,1.0))
exJet_trans=cm.colors.LinearSegmentedColormap('mod_Jet_trans', c3dict, 1024)
\ No newline at end of file
exJet_trans=cm.colors.LinearSegmentedColormap('mod_Jet_trans', c3dict, 1024)
# -*- coding: utf-8 -*-
"""
Created on Wed May 9 14:56:32 2018
Version: 3.4.3
Version: 3.4.4
@author: Holger Niemann, Peter Drewelow, Yu Gao
mainly to clean up the downloadversionIRdata code
......@@ -833,7 +833,8 @@ def get_work_list(pipepath,typ="q"):
the path to the folder where the files are located
typ: string
the typ of data which is requested in the working list\n
possiblities: q, Aw, qpeak, width, load\n
possiblities: q, Aw, qpeak, width, load. q_old, load_old\n
both old parameters are opening the files bevore version 3.4.1\n
or anything else for the problematic programs
RESULT
------
......@@ -849,7 +850,7 @@ def get_work_list(pipepath,typ="q"):
if typ in ('q_old','load_old'):
typ = typ.split("_")[0]
f=open(pipepath+str(today.year)+str(today.month)+"_"+typ+"_requests.txt")
elif typ in ('q','load','qpeak','Aw','width'):
elif typ in ('q','load','qpeak','Aw','width','pf'):
f=open(pipepath+"Auto_"+typ+"_requests.txt")
else:
reasons=[]
......@@ -858,13 +859,13 @@ def get_work_list(pipepath,typ="q"):
koline=line.split("\t")
if len(koline)>1:
prog = koline[0]
if typ in ('q','load','qpeak','Aw','width','q_old','load_old'):
if typ in ('q','load','qpeak','Aw','width','q_old','load_old','pf'):
cam_programs.append((prog,koline[1].split("\n")[0]))
else:
cam_programs.append((prog,koline[1]))
reasons.append(koline[2].split("\n")[0])
f.close()
if typ in ('q','load','qpeak','Aw','width','q_old','load_old'):
if typ in ('q','load','qpeak','Aw','width','q_old','load_old','pf'):
bla=check_dublicates_2(cam_programs)
cam_programs=bla[0]
return cam_programs
......@@ -910,7 +911,7 @@ def read_finger_info(file_name=None, OP='OP1.2b', verbose=0):
elif OP.startswith('OP2'):
file_name='finger_info_HHF.csv'
full_path = os.path.join(parameter_file_path, file_name)
print(full_path)
#print(full_path)
if verbose > 0:
print('read_finger_info: reading from file {0} in {1}'.format(file_name, parameter_file_path))
if not os.path.isfile(full_path):
......
......@@ -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.4.3
Version: 3.5.0
(Numbering: #of big changes(OP1.2a download V1, OP1.2b download V2, heatflux V3)
.
#of updates to add functionalities
......@@ -12,7 +12,7 @@ Version: 3.4.3
#number of updates for bug fixes )
@author: holn
"""
version = "V3.4.3"
version = "V3.5.0"
import numpy as np
import IR_image_tools as IR_tools
......@@ -76,9 +76,14 @@ def get_started():
# When ever that fails, just print the links:
print("Some slides can be found in the wiki:")
print(link)
plt.figure()
im=plt.imread(image)
plt.imshow(im)
print("And a flow-chart for getting and using the data can be found here:")
print(image)
plt.show()
def get_latest_version(stream, project="W7X", testmode=False, t_from=None,
t_to=None, program=None, verbose=0):
......@@ -216,7 +221,7 @@ def read_program(timestamp_start, timestamp_end=0, tol=60):
def download_LUT(port, time, exposure=0, emissivity=0, camera_filter=0, version=0,
testmode=False, verbose=0):
"""
download_LUT(camera, port, time, exposure=0, emissivity=0, camera_filter=0, version=1):
download_LUT(port, time, exposure=0, emissivity=0, camera_filter=0, version=1):
download of the look up table for the infrared cameras from the database for OP1.2(a+b)
Have to swap 11, 21 until correction in the database
INPUT
......@@ -267,7 +272,7 @@ def download_LUT(port, time, exposure=0, emissivity=0, camera_filter=0, version=
return False, 0
# raise Exception
if version == 0:#version check, if 0
version = get_latest_version(portpathdict[OP]["AEF"+str(port)]+"LUT_DATASTREAM", t_from=time, testmode=testmode)
version = get_latest_version(portpathdict[OP]["AEF"+str(port)]+"LUT_PARLOG", t_from=time, testmode=testmode)
if verbose > 0:
print("download_LUT: LUT V"+str(version)+" is used")
#time=int(fu.TimeToNs([2017,9,26], [8, 0, 0, 0]))
......@@ -3172,7 +3177,7 @@ def get_temp_from_raw_by_program_V1(portnr, program, time_window=0, emi=0.8,dive
time: list
a list containing the time stamp of each frame
frames: list
a list of frames, 2D numpy arrays
a list of frames, 2D numpy arrays, values are in Kelvin
valid: boolean
True if the data can be used/trusted
optional: error_frames: list
......@@ -3309,7 +3314,7 @@ def get_temp_from_raw_by_program_V2(portnr, program, time_window=0, emi=0.8, ver
time: list
a list containing the time stamp of each frame
frames: list
a list of frames, 2D numpy arrays
a list of frames, 2D numpy arrays, values are in Kelvin
valid: boolean
True if the data can be used/trusted
optional: error_frames: list
......@@ -3361,7 +3366,8 @@ def get_temp_from_raw_by_program(portnr, program, time_window=0, emi=0.8, T_vers
testmode: boolean, optional, default False
if True, the data will be loaded from the test archive
framerate: string or integer, optional, default 'max'
sets the framerate to downsample the data. normal rate is 100.
sets the framerate to downsample the data. normal rate is 100. \n
works only if w7xarchive is available!
RESULT
------
exist: boolean
......@@ -4705,7 +4711,8 @@ def download_heatflux_by_program(port, program, time_window=0, testmode=False,
verbose: integer, optional, default 0
feedback level (details of print messages)
givealpha: boolean, default False
switch to turn on or off the return of the alpha image from the THEODOR calculation, it wil be returned as first image
switch to turn on or off the return of the alpha image from the THEODOR calculation, it wil be returned as first image\n
it sets the timewindow start automatically to t1 if active
request: boolean, default True
switch to turn on or off the request of data if the data is not available in the database
RESULT
......@@ -5546,7 +5553,7 @@ def download_divertor_load(port, targetmodule=None, program=None, tstart=None,
port: int or str
the port description for the camera as number or full string (e.g. 'AEF10')
targetmodule: str or list/ndarray of str, optional
name or description of the target module, nothing wil return total load
name or description of the target module, nothing will return total load of the requested divertor(camera)
program: str
program id as str in the format yyyymmdd.pid
tstart: integer
......@@ -5570,7 +5577,7 @@ def download_divertor_load(port, targetmodule=None, program=None, tstart=None,
time: list
a list containing the time stamp of each frame, time is in nanoseconds UTC
load: list
a list of values, values in the images are in W
a list of values, values in the list are in W
error: list
a list of values, the error of each timepoint, values are in W
"""
......@@ -5589,11 +5596,137 @@ def download_divertor_load(port, targetmodule=None, program=None, tstart=None,
'TM2V':(22,23, 'TM2v_load'), '2V':(22,23, 'TM2v_load'),
'TM3V':(24,25, 'TM3v_load'), '3V':(24,25, 'TM3v_load')
}
return __download_module_based_data__(kind="load",TMchadict=TMchadict,port=port,
targetmodule=targetmodule,program=program, tstart=tstart, tend=tend,
version=version, verbose=verbose, testmode=testmode,
request=request, request_ALL=request_ALL)
def download_peak_heatflux(port, targetmodule=None, program=None, tstart=None,
tend=None, version=0, verbose=0, testmode=False,
request=True, request_ALL=False):
"""
downloads the evaluated peak heat flux, based on the heat flux evaluation of the temperature data from the IR cameras.\n
The data is structed in maximum peak heat flux per divertor, identified by the port, and also in target-modules of the divertor.\n
An estiamted error for the data is given back.
To get the total divertor load, please download the data of each of the 10 AEF ports.\n
In case one or more ports are missing, request can be created (console will give feedback on the request).\n
The data will be evaluated by a server over time.
INPUT
------
port: int or str
the port description for the camera as number or full string (e.g. 'AEF10')
targetmodule: str or list/ndarray of str, optional
name or description of the target module, nothing will return total load of the requested divertor(camera)
program: str
program id as str in the format yyyymmdd.pid
tstart: integer
time in ns where the search should start
tend: integer
time in ns where the search should end
version: integer, optional, default 0
Version of the data in the archiveDB, in case of 0 the highest version will be used
verbose: integer, optional
feedback level (details of print messages)
testmode: boolean, default False
True to load data from testarchive
request: boolean, optional, default True
switch to turn on or off the request of data if the data is not available in the database
request_ALL: boolean, optional, default False
switch to turn on the request of data for all AEF ports
RESULT
------
exist: boolean
True if data was found, False if not
time: list
a list containing the time stamp of each frame, time is in nanoseconds UTC
peakflux: list
a list of values, values in the list are in W/m^2
error: list
a list of values, the error of each timepoint, values are in W/m^2
"""
TMchadict={
'ALL':(0,1, 'maximum_divertor_heatflux'), 'FULL':(0,1, 'maximum_divertor_heatflux'),
'TM1H':(2,3, 'TM1h_peakflux'), '1H':(2,3, 'TM1h_peakflux'),
'TM2H':(4,5, 'TM2h_peakflux'), '2H':(4,5, 'TM2h_peakflux'),
'TM3H':(6,7, 'TM3h_peakflux'), '3H':(6,7, 'TM3h_peakflux'),
'TM4H':(8,9, 'TM4h_peakflux'), '4H':(8,9, 'TM4h_peakflux'),
'TM5H':(10,11, 'TM5h_peakflux'), '5H':(10,11, 'TM5h_peakflux'),
'TM6H':(12,13, 'TM6h_peakflux'), '6H':(12,13, 'TM6h_peakflux'),
'TM7H':(14,15, 'TM7h_peakflux'), '7H':(14,15, 'TM7h_peakflux'),
'TM8H':(16,17, 'TM8h_peakflux'), '8H':(16,17, 'TM8h_peakflux'),
'TM9H':(18,19, 'TM9h_peakflux'), '9H':(18,19, 'TM9h_peakflux'),
'TM1V':(20,21, 'TM1v_peakflux'), '1V':(20,21, 'TM1v_peakflux'),
'TM2V':(22,23, 'TM2v_peakflux'), '2V':(22,23, 'TM2v_peakflux'),
'TM3V':(24,25, 'TM3v_peakflux'), '3V':(24,25, 'TM3v_peakflux')
}
return __download_module_based_data__(kind="qpeak",TMchadict=TMchadict,port=port,
targetmodule=targetmodule,program=program, tstart=tstart, tend=tend,
version=version, verbose=verbose, testmode=testmode,
request=request, request_ALL=request_ALL)
def __download_module_based_data__(kind, TMchadict, port, targetmodule=None,
program=None, tstart=None, tend=None,
version=0, verbose=0, testmode=False,
request=True, request_ALL=False):
"""
downloads the integrated divertor load or the peak heat flux, based on the heat flux evaluation of the temperature data from the IR cameras.\n
The data is structed in total load/peak heat flux per divertor, identified by the port, and also in target-modules of the divertor.\n
An estiamted error for the data is given back.
To get the total divertor load, please download the data of each of the 10 AEF ports.\n
In case one or more ports are missing, request can be created (console will give feedback on the request).\n
The data will be evaluated by a server over time.
INPUT
------
port: int or str
the port description for the camera as number or full string (e.g. 'AEF10')
targetmodule: str or list/ndarray of str, optional
name or description of the target module, nothing will return total load of the requested divertor(camera)
program: str
program id as str in the format yyyymmdd.pid
tstart: integer
time in ns where the search should start
tend: integer
time in ns where the search should end
version: integer, optional, default 0
Version of the data in the archiveDB, in case of 0 the highest version will be used
verbose: integer, optional
feedback level (details of print messages)
testmode: boolean, default False
True to load data from testarchive
request: boolean, optional, default True
switch to turn on or off the request of data if the data is not available in the database
request_ALL: boolean, optional, default False
switch to turn on the request of data for all AEF ports
RESULT
------
exist: boolean
True if data was found, False if not
time: list
a list containing the time stamp of each frame, time is in nanoseconds UTC
load: list
a list of values, values in the list are in W
error: list
a list of values, the error of each timepoint, values are in W
"""
print(kind)
if kind in ["load","qpeak"]:
if kind == "load":
datcha_name = 'divertor_total_load'
funname = "download_divertor_load"
streamname = "loads"
else:
datcha_name = 'maximum_divertor_heatflux'
funname = "download_peak_heatflux"
streamname = "peakflux"
else:
raise Exception("__download_module_based_data__: wrong input!")
#interpretation of the targetmodule input, string or List of strings, numbers does not make sense here?
if targetmodule == None:
datcha = 0
ercha = 1
datcha_name='divertor_total_load'
elif type(targetmodule)== list or type(targetmodule)==np.ndarray:## okay maybe more than one targetmodule is requested
datcha = []
datcha_name = []
......@@ -5632,7 +5765,7 @@ def download_divertor_load(port, targetmodule=None, program=None, tstart=None,
# else:
exist, _, tstart, tend = get_trigger_from_PID(program, port, testmode, verbose=verbose-1)
if not exist:
print("download_divertor_load: Error! program not found")
print(f"{funname}: Error! program not found")
return False, 0,-1,-1
else:
if tend == None:
......@@ -5642,7 +5775,7 @@ def download_divertor_load(port, targetmodule=None, program=None, tstart=None,
# tend=prog[1]['trigger']['6'][0]
exist, _, _, tend = get_trigger_from_PID(program, port, testmode, verbose=verbose-1)
if not exist:
print("download_divertor_load: Error! end trigger not found")
print(f"{funname}: Error! end trigger not found")
return False, 0,-1,-1
#channels known, time known, okay lets get the data
# tstart=int(tstart-100e6)
......@@ -5654,8 +5787,8 @@ def download_divertor_load(port, targetmodule=None, program=None, tstart=None,
if type(port) == int:
port = "AEF"+str(port)
if version == 0:
version = get_latest_version(portpathdict[OP][str(port)]+"loads_DATASTREAM", project=project_ana, t_from=tstart, t_to=tend, testmode=testmode)
larchivepath = base+project_ana+"/"+portpathdict[OP][str(port)]+"loads_DATASTREAM/V"+str(version)
version = get_latest_version(portpathdict[OP][str(port)]+streamname+"_DATASTREAM", project=project_ana, t_from=tstart, t_to=tend, testmode=testmode)
larchivepath = base+project_ana+"/"+portpathdict[OP][str(port)]+streamname+"_DATASTREAM/V"+str(version)
if type(datcha) == list:#case of several requested channels
load = []
error = []
......@@ -5691,34 +5824,376 @@ def download_divertor_load(port, targetmodule=None, program=None, tstart=None,
if exist == False:
now = datetime.datetime.now()
if verbose > 0:
print(now, "download_divertor_load: divertor_load data is not available")
print(now, f"{funname}: divertor_load data is not available")
if request:
try:
programid=AKF_2.get_program_id(tstart)
except Exception as E:
if verbose > 0:
print('download_divertor_load: Error! ', E)
print(f'{funname}: Error! ', E)
programid=str(tstart)
cam_progs=IR_tools.get_work_list(heatflux_requestlist_path, typ='load')
cam_progs=IR_tools.get_work_list(heatflux_requestlist_path, typ=kind)
cam_progs_ig,reasons=IR_tools.get_work_list(heatflux_requestlist_path, typ='ignore')
cam_p = cam_progs+cam_progs_ig
if (programid, str(port)) not in cam_p and (programid, "ALL") not in cam_p:
f = open(heatflux_requestlist_path+"Auto_load_requests.txt", 'a')
f = open(heatflux_requestlist_path+"Auto_"+kind+"_requests.txt", 'a')
if request_ALL:
f.write(programid+"\tALL\n")
else:
f.write(programid+"\t"+str(port)+"\n")
f.close()
if verbose > 0:
print(now, "download_divertor_load: request created")
print(now,f"{funname}: request created")
elif verbose > 0:
if (programid, str(port)) in cam_progs:
print(now, "download_divertor_load: request exist already")
print(now, f"{funname}: request exist already")
else:
pid = cam_progs_ig.index((programid, str(port)))
print(now, "download_divertor_load: request ignored, data not available, reason: {0}".format(reasons[pid]))
print(now, f"{funname}: request ignored, data not available, reason: {0}".format(reasons[pid]))
return exist, time, load, error
def download_wetted_area(typ="total", program=None, tstart=None,
tend=None, version=0, verbose=0, request=True, return_used_divertors=False):
"""
downloads the wetted area on the divertor, based on the heat flux evaluation of the temperature data from the IR cameras.\n
The data is structed in total wetted area, and also in wetted area on upper and on lower targets.\n
In case data is missing, request can be created (console will give feedback on the request).\n
The data will be evaluated by a server over time.
INPUT
------
typ: string, optional, default 'total'
name or description of the requested data, nothing will return total wetted area\n
options are: "total", "all", "upper", "lower", "qmaxUP", "qmaxDOWN"
program: str
program id as str in the format yyyymmdd.pid
tstart: integer
time in ns where the search should start
tend: integer
time in ns where the search should end
version: integer, optional, default 0
Version of the data in the archiveDB, in case of 0 the highest version will be used
verbose: integer, optional
feedback level (details of print messages)
testmode: boolean, default False
True to load data from testarchive
request: boolean, optional, default True
switch to turn on or off the request of data if the data is not available in the database
return_used_divertors: boolean, optional, default False
if turned on, it will return also the list of divertors which were used to calculated the wetted area
RESULT
------
exist: boolean
True if data was found, False if not
time: list
a list containing the time stamp of each frame, time is in nanoseconds UTC
wetted area/qmax: list or dictionary
for total, upper or lower type of data a list of values, values are in m^2\n
for qmaxUP or qmaxDOWN are list of values, vales are in W/m^2
for all a dictionary with total, upper and lower as list in the dictionary are returned
reference divertors: list, optional
if return_used_divertors if True, it will return a list with the port numbers of the cameras
"""
return __download_derived_data__(kind="Aw",typ=typ,program=program,tstart=tstart,
tend=tend,version=version,verbose=verbose,
request=request,return_used_divertors=return_used_divertors)
def download_strikeline_width(typ="total", program=None, tstart=None,
tend=None, version=0, verbose=0, request=True, return_used_divertors=False):
"""
downloads the averaged strike-line width on the divertors, based on the heat flux evaluation of the temperature data from the IR cameras.\n
The data is structed in mean strike-line width, and also in strike-line width on upper and on lower targets.\n
In case data is missing, request can be created (console will give feedback on the request).\n
The data will be evaluated by a server over time.
INPUT
------
typ: string, optional, default 'total'
name or description of the requested data, nothing will return strike-line width\n
options are: "total"(mean over all divertors), "all", "upper", "lower", "qmaxUP", "qmaxDOWN"
program: str
program id as str in the format yyyymmdd.pid
tstart: integer
time in ns where the search should start
tend: integer
time in ns where the search should end
version: integer, optional, default 0
Version of the data in the archiveDB, in case of 0 the highest version will be used
verbose: integer, optional
feedback level (details of print messages)
testmode: boolean, default False
True to load data from testarchive
request: boolean, optional, default True
switch to turn on or off the request of data if the data is not available in the database
return_used_divertors: boolean, optional, default False
if turned on, it will return also the list of divertors which were used to calculated the wetted area
RESULT
------
exist: boolean
True if data was found, False if not
time: list
a list containing the time stamp of each frame, time is in nanoseconds UTC
wetted area/qmax: list or dictionary
for total, upper or lower type of data a list of values, values are in m\n
for qmaxUP or qmaxDOWN are list of values, vales are in W/m^2
for all a dictionary with total, upper and lower as list in the dictionary are returned
reference divertors: list, optional
if return_used_divertors if True, it will return a list with the port numbers of the cameras
"""
return __download_derived_data__(kind="width",typ=typ,program=program,tstart=tstart,
tend=tend,version=version,verbose=verbose,
request=request,return_used_divertors=return_used_divertors)
def download_peaking_factor(typ="total", program=None, tstart=None,
tend=None, version=0, verbose=0, request=True, return_used_divertors=False):
"""
downloads the averaged peaking factor on the divertors, based on the heat flux evaluation of the temperature data from the IR cameras.\n
The data is structed in mean peaking factor, and also in peaking factor on upper and on lower targets.\n
In case data is missing, request can be created (console will give feedback on the request).\n
The data will be evaluated by a server over time.
INPUT
------
typ: string, optional, default 'total'
name or description of the requested data, nothing will return strike-line width\n
options are: "total"(mean over all divertors), "all", "upper", "lower", "qmaxUP", "qmaxDOWN"
program: str
program id as str in the format yyyymmdd.pid
tstart: integer
time in ns where the search should start
tend: integer
time in ns where the search should end
version: integer, optional, default 0
Version of the data in the archiveDB, in case of 0 the highest version will be used
verbose: integer, optional
feedback level (details of print messages)
testmode: boolean, default False
True to load data from testarchive
request: boolean, optional, default True
switch to turn on or off the request of data if the data is not available in the database
return_used_divertors: boolean, optional, default False
if turned on, it will return also the list of divertors which were used to calculated the wetted area
RESULT
------
exist: boolean
True if data was found, False if not
time: list
a list containing the time stamp of each frame, time is in nanoseconds UTC
wetted area/qmax: list or dictionary
for total, upper or lower type of data a list of values, values are in m\n
for qmaxUP or qmaxDOWN are list of values, vales are in W/m^2
for all a dictionary with total, upper and lower as list in the dictionary are returned
reference divertors: list, optional
if return_used_divertors if True, it will return a list with the port numbers of the cameras
"""
return __download_derived_data__(kind="qpeak",typ=typ,program=program,tstart=tstart,
tend=tend,version=version,verbose=verbose,
request=request,return_used_divertors=return_used_divertors)
def __download_derived_data__(kind, typ="total", program=None, tstart=None,
tend=None, version=0, verbose=0, request=True, return_used_divertors=False):
"""
downloads the averaged strike-line width, peaking factor or wetted area on the divertors, based on the heat flux evaluation of the temperature data from the IR cameras.\n
The data is structed in a total value (wetted area) or mean value(width and peaking), and also in strike-line width on upper and on lower targets.\n
In case data is missing, request can be created (console will give feedback on the request).\n
The data will be evaluated by a server over time.
INPUT
------
kind: string
the kind of data which is should be downloaded, options are: "Aw","PF","width"
typ: string, optional, default 'total'
name or description of the requested data, nothing will return the requested kind of data\n
options are: "total", "all", "upper", "lower", "qmaxUP", "qmaxDOWN"
program: str
program id as str in the format yyyymmdd.pid
tstart: integer
time in ns where the search should start
tend: integer
time in ns where the search should end
version: integer, optional, default 0
Version of the data in the archiveDB, in case of 0 the highest version will be used
verbose: integer, optional
feedback level (details of print messages)
testmode: boolean, default False
True to load data from testarchive
request: boolean, optional, default True
switch to turn on or off the request of data if the data is not available in the database
return_used_divertors: boolean, optional, default False
if turned on, it will return also the list of divertors which were used to calculated the wetted area
RESULT
------
exist: boolean
True if data was found, False if not
time: list
a list containing the time stamp of each frame, time is in nanoseconds UTC
wetted area/qmax: list or dictionary
for total, upper or lower type of data a list of values, values are in m\n
for qmaxUP or qmaxDOWN are list of values, vales are in W/m^2
for all a dictionary with total, upper and lower as list in the dictionary are returned
reference divertors: list, optional
if return_used_divertors if True, it will return a list with the port numbers of the cameras
"""
#defining what function this function is in reality
if kind in ["Aw","PF","width","wetted_area","wetted area","peaking factor","peaking_factor","strike-line_width","strikeline_width","strike line width"]:
if kind in ["Aw","wetted_area","wetted area"]:
funname = "download_wetted_area"
kind = "Aw"
stream_name = "wetted_area"
channelnames = {'total':(0,"total_wetted_area"),
'upper':(1,"mean_upper_wetted_area"),
'lower':(2,"mean_lower_wetted_area")
}
elif kind in ["PF","peaking factor","peaking_factor"]:
funname = "download_peaking_factor"
kind = "pf"
stream_name = "peaking_factor"
channelnames = {'total':(0,"mean_peaking_factor"),
'upper':(1,"mean_upper_peaking_factor"),
'lower':(2,"mean_lower_peaking_factor")
}
else:
funname = "download_strikeline_width"
kind = "width"
stream_name = "strikeline_width"
channelnames = {'total':(0,"mean_strikeline_width"),
'upper':(1,"mean_upper_strikeline_width"),
'lower':(2,"mean_lower_strikeline_width")
}
else:
raise Exception("__download_derived_data__: wrong input!")
channelnames['qmaxUP']=(3,"max_upper_heatflux")
channelnames['qmaxDOWN']=(4,"max_lower_heatflux")
#"total", "all", "upper", "lower", "qmaxUP", "qmaxDOWN"
# what is the time input?