Commit 635ff808 authored by bliss administrator's avatar bliss administrator
Browse files

Removed Exception when sinogram is asked but dark and/or ref scan is

missing, now inform and set it if missing + Replaced ScanInfoFactory by
ScanInfo to avoid warning message about depreciation
parent c0210a37
......@@ -11,7 +11,7 @@ import bliss
from bliss import setup_globals, global_map
from bliss.common import session
from bliss.common.logtools import log_info,log_debug
from bliss.common.logtools import log_info,log_debug,log_warning
from bliss.common.standard import *
from bliss.common.cleanup import cleanup, axis as cleanup_axis
from bliss.shell.standard import umv, umvr
......@@ -282,10 +282,12 @@ class FastTomo:
if self.tomo.parameters.sinogram_active:
if not self.tomo.parameters.dark_images_at_start or not self.tomo.parameters.ref_images_at_start:
raise Exception("Error, cannot build sinogram for this sequence. Dark scan or/and reference scan at start is/are missing.")
log_warning(self,"Dark scan or/and reference scan at start is/are missing to build sinogram. They are going to be added")
self.tomo.parameters.dark_images_at_start = True
self.tomo.parameters.ref_images_at_start = True
npixels = self.tomo.tomo_ccd.detector.image.width
self.tomo.tomo_sino.configure_plot(scan_info,0,npixels-1,npixels,self.tomo.parameters.start_pos,self.tomo.parameters.end_pos,self.tomo.parameters.tomo_n)
scan_info = self.tomo.tomo_sino.configure_plot(scan_info,0,npixels-1,npixels,self.tomo.parameters.start_pos,self.tomo.parameters.end_pos,self.tomo.parameters.tomo_n)
seq=Sequence(title=self.tomo.sequence, scan_info=scan_info)
if self.tomo.parameters.sinogram_active:
......@@ -430,7 +432,7 @@ class HalfTomo(FastTomo, TomoParameters):
if self.tomo.parameters.sinogram_active:
if not self.tomo.parameters.dark_images_at_start or not self.tomo.parameters.ref_images_at_start:
raise Exception("Error, cannot build sinogram for this sequence. Dark scan or/and reference scan at start is/are missing.")
logwarning("Dark scan or/and reference scan at start is/are missing for sinogram. They will be added")
npixels = self.tomo.tomo_ccd.detector.image.width
self.tomo.tomo_sino.configure_plot(scan_info,0,npixels-1,npixels,self.tomo.parameters.start_pos,self.tomo.parameters.end_pos,self.tomo.parameters.tomo_n)
......
......@@ -3,6 +3,7 @@ from bliss import global_map, current_session
from bliss.common.logtools import log_info
import numpy
from bliss.common.scans.scan_info import ScanInfoFactory
from bliss.scanning.scan_info import ScanInfo
from bliss.scanning.chain import AcquisitionChannel
import gevent
from bliss.config.streaming import DataStreamReaderStopHandler
......@@ -39,10 +40,10 @@ class TomoSinogram:
X axis corresponds to image pixel indices in width.
Y axis corresponds to rotation angle.
"""
builder = ScanInfoFactory(scan_info)
scan_info = ScanInfo.normalize(scan_info)
# Create data group for each extra data
builder.set_channel_meta(
scan_info.set_channel_meta(
"rotation",
start=start_y,
stop=stop_y,
......@@ -52,7 +53,7 @@ class TomoSinogram:
axis_kind="forth",
group="sinogram",
)
builder.set_channel_meta(
scan_info.set_channel_meta(
"translation",
start=start_x,
stop=stop_x,
......@@ -62,10 +63,12 @@ class TomoSinogram:
axis_kind="forth",
group="sinogram",
)
builder.set_channel_meta("sinogram", group="sinogram")
scan_info.set_channel_meta("sinogram", group="sinogram")
# Define a default plot
builder.add_scatter_plot(x="translation", y="rotation", value="sinogram")
scan_info.add_scatter_plot(x="translation", y="rotation", value="sinogram")
return scan_info
def configure_data_reemission(self, sequence, rotation, spectrum_counters, npixels):
"""
......
Markdown is supported
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