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

Bugfix/Hotfix: Badpixel corrections was not applied for 7 cameras in OP1.2a --> fixed

parent 3d4f0f86
......@@ -300,6 +300,9 @@ def download_NUC_by_times(port, starttime, stoptime, exposure, testmode=False, v
def get_NUC_by_program(port, program, exposure, version=0, testmode=False, verbose=0):
Loads NUC elements (gain, offset cold image, bad pixels) for an IR camera
in a given port and time interval. Depending on time and camera, reconstruct
the cold frame and/or compute the gain, offset from the hot and cold frame.
# prog=get_program_from_PID(program)
# try:
......@@ -382,7 +385,12 @@ def get_NUC_by_times(port, starttime, stoptime, t_exp, version=0, testmode=False
if verbose > 0:
print('get_NUC_by_times: downloading NUC')
return download_NUC_by_times(port, starttime, stoptime, t_exp, testmode=testmode)
NUC_DL = download_NUC_by_times(port, starttime, stoptime, t_exp, testmode=testmode)
#True, images, ['gain', 'offset', 'cold', 'badpixels', 'gain_error', 'offset_error']
if NUC_DL[0]:
badpixels = find_badpixels(port,NUC_DL[1][0],NUC_DL[1][1],niterations=10, tolerance=10, verbose=verbose-1)
return NUC_DL
elif OP == "OP1.2b":
gain_error = 0
offset_error = 0
......@@ -2538,7 +2546,7 @@ def get_calib_data(port, program=None, t0=None, t1=None, t6=None, emissivity=0.8
# treat cameras with and w/o filters differently
if cfilter==0 and not Camera.split("_")[0] == "Infratec":
# --- Infratec Camera case ---
# --- Ircam Camera case ---
if verbose > 0:
print('get_calib_data: getting NUC arrays')
NUC_DL=get_NUC_by_times(port, t0, t1, t_exp, version, testmode, verbose=verbose-1)#download_NUC_by_times(port, t0, t1, t_exp, version)
......@@ -2585,7 +2593,7 @@ def get_calib_data(port, program=None, t0=None, t1=None, t6=None, emissivity=0.8
raise Warning("get_calib_data: cannot find the first frame of the discharge, reconstruction failed")
# return False, 0, LUT, 0, gain, offset, badpixels, t_exp, cfilter, gain_error, offset_error
# --- Ircam Camera case ---
# --- Infratec Camera case ---
gain = 0
offset = 0
badpixels = 0
......@@ -3399,8 +3407,36 @@ def extract_temperature_profile_from_DL(port, time, images, profile, finger=None
port: int or str
the camera port as number or full string (e.g. 'AEF10')
return exist, time, s in m, heat flux in W/m2
time_point default (None) returns entire shot.
time: array or numpy array
the time vector for the given images
images: numpy array
temperature flux images, from which the profile should be extracted
verbose: integer, optional
feedback level (details of print messages)
reference_time : float, optional, default is 0
reference timepoint for the mapping data
exist: boolean
indicates whether data was found (True) or not (False)
s in m
heat flux in W/m2
goon = True
if time_window == None:
......@@ -3719,6 +3755,8 @@ the following functions are copied from W7xrest.read_restdb to remove this depen
def read_restdb_old(request_url):
Reads JSON data from W7-X REST API
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