Skip to content
Snippets Groups Projects
Commit 0c0d9e59 authored by Adam Laskowski's avatar Adam Laskowski
Browse files

BIS-713: Amended value objects to reflect new specification, minor improvements

parent f73796f9
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
......@@ -79,9 +79,27 @@ def get_dat_image(channel_x, channel_y, x_axis, y_axis, colormap, scaling, group
print(params)
if params['mode'] == '1':
print(generate_random_image(640, 640))
elif params['mode'] == '2':
if 'mode' in params:
if params['mode'] == '1':
print(generate_random_image(640, 640))
elif params['mode'] == '2':
parameters = dict(
channel_x=params['channel x'],
channel_y=params['channel y'],
x_axis=[float(x) for x in params['x-axis']],
y_axis=[float(x) for x in params['y-axis']],
colormap=params['colormap'],
scaling=params['scaling'],
grouping=params['grouping']
)
if "color" in params:
parameters['color'] = params['color']
if "print_legend" in params:
parameters['print_legend'] = params['print_legend'].upper() == "TRUE"
else:
parameters['print_legend'] = True
print(get_dat_image(**parameters))
else:
parameters = dict(
channel_x=params['channel x'],
channel_y=params['channel y'],
......
......@@ -162,21 +162,33 @@ def get_sxm_image4(channel_name, x_axis, y_axis, scaling, color_scale, colormap,
return encoded
print(params)
if params['mode'] == '1':
# print(f'IMG={get_sxm_image()}')
print(f'{get_sxm_image()}')
elif params['mode'] == '2':
# print(f'IMG={get_sxm_image2()}')
print(f'{get_sxm_image2()}')
elif params['mode'] == '3':
# print(f'IMG={generate_random_image(320, 320)}')
print(f'{generate_random_image(256, 256)}')
elif params['mode'] == '4':
channel = params['channel']
scaling = params['scaling']
color_scale = [float(x) for x in params['color-scale']]
print(f'{get_sxm_image3(channel, scaling, color_scale)}')
elif params['mode'] == '5':
if 'mode' in params:
if params['mode'] == '1':
# print(f'IMG={get_sxm_image()}')
print(f'{get_sxm_image()}')
elif params['mode'] == '2':
# print(f'IMG={get_sxm_image2()}')
print(f'{get_sxm_image2()}')
elif params['mode'] == '3':
# print(f'IMG={generate_random_image(320, 320)}')
print(f'{generate_random_image(256, 256)}')
elif params['mode'] == '4':
channel = params['channel']
scaling = params['scaling']
color_scale = [float(x) for x in params['color-scale']]
print(f'{get_sxm_image3(channel, scaling, color_scale)}')
elif params['mode'] == '5':
channel = params['channel']
x_axis = [float(x) for x in params['x-axis']]
y_axis = [float(x) for x in params['y-axis']]
color_scale = [float(x) for x in params['color-scale']]
colormap = params['colormap']
scaling = params['scaling']
colormap_scaling = False
if "colormap_scaling" in params:
colormap_scaling = params['colormap_scaling'].upper() == "TRUE"
print(f'{get_sxm_image4(channel, x_axis, y_axis, scaling, color_scale, colormap, colormap_scaling)}')
else:
channel = params['channel']
x_axis = [float(x) for x in params['x-axis']]
y_axis = [float(x) for x in params['y-axis']]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment