Пример #1
0
class ChargeResolutionViewer(Tool):
    name = "ChargeResolutionViewer"
    description = "Plot charge resolutions generated by " "ChargeResolutionCalculator."

    input_files = List(
        Path(exists=True, directory_ok=False),
        None,
        help="Input HDF5 files produced by ChargeResolutionCalculator",
    ).tag(config=True)

    aliases = Dict(
        dict(
            f="ChargeResolutionViewer.input_files",
            B="ChargeResolutionPlotter.n_bins",
            o="ChargeResolutionPlotter.output_path",
        ))
    classes = List([ChargeResolutionPlotter])

    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.plotter = None

    def setup(self):
        self.log_format = "%(levelname)s: %(message)s [%(name)s.%(funcName)s]"
        self.plotter = ChargeResolutionPlotter(parent=self)

    def start(self):
        for fp in self.input_files:
            self.plotter.plot_camera(fp)

    def finish(self):
        q = np.arange(1, 1000)
        self.plotter.plot_poisson(q)
        self.plotter.plot_requirement(q)
        self.plotter.save()
Пример #2
0
class ChargeResolutionViewer(Tool):
    name = "ChargeResolutionViewer"
    description = ("Plot charge resolutions generated by "
                   "ChargeResolutionCalculator.")

    input_files = List(
        Unicode,
        None,
        help='Input HDF5 files produced by ChargeResolutionCalculator').tag(
            config=True)

    aliases = Dict(
        dict(
            f='ChargeResolutionViewer.input_files',
            B='ChargeResolutionPlotter.n_bins',
            o='ChargeResolutionPlotter.output_path',
        ))
    classes = List([
        ChargeResolutionPlotter,
    ])

    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.calculator = None
        self.plotter = None

    def setup(self):
        self.log_format = "%(levelname)s: %(message)s [%(name)s.%(funcName)s]"
        kwargs = dict(config=self.config, tool=self)

        self.plotter = ChargeResolutionPlotter(**kwargs)

    def start(self):
        for fp in self.input_files:
            self.plotter.plot_camera(fp)

    def finish(self):
        q = np.arange(1, 1000)
        self.plotter.plot_poisson(q)
        self.plotter.plot_requirement(q)
        self.plotter.save()
Пример #3
0
class ChargeResolutionViewer(Tool):
    name = "ChargeResolutionViewer"
    description = ("Plot charge resolutions generated by "
                   "ChargeResolutionCalculator.")

    input_files = List(
        Unicode, None,
        help='Input HDF5 files produced by ChargeResolutionCalculator'
    ).tag(config=True)

    aliases = Dict(dict(
        f='ChargeResolutionViewer.input_files',
        B='ChargeResolutionPlotter.n_bins',
        o='ChargeResolutionPlotter.output_path',
    ))
    classes = List([
        ChargeResolutionPlotter,
    ])

    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.calculator = None
        self.plotter = None

    def setup(self):
        self.log_format = "%(levelname)s: %(message)s [%(name)s.%(funcName)s]"
        kwargs = dict(config=self.config, tool=self)

        self.plotter = ChargeResolutionPlotter(**kwargs)

    def start(self):
        for fp in self.input_files:
            self.plotter.plot_camera(fp)

    def finish(self):
        q = np.arange(1, 1000)
        self.plotter.plot_poisson(q)
        self.plotter.plot_requirement(q)
        self.plotter.save()
Пример #4
0
 def setup(self):
     self.log_format = "%(levelname)s: %(message)s [%(name)s.%(funcName)s]"
     self.plotter = self.add_component(ChargeResolutionPlotter(parent=self))
Пример #5
0
    def setup(self):
        self.log_format = "%(levelname)s: %(message)s [%(name)s.%(funcName)s]"
        kwargs = dict(config=self.config, tool=self)

        self.plotter = ChargeResolutionPlotter(**kwargs)
Пример #6
0
    def setup(self):
        self.log_format = "%(levelname)s: %(message)s [%(name)s.%(funcName)s]"
        kwargs = dict(config=self.config, tool=self)

        self.plotter = ChargeResolutionPlotter(**kwargs)
Пример #7
0
 def setup(self):
     self.log_format = "%(levelname)s: %(message)s [%(name)s.%(funcName)s]"
     self.plotter = ChargeResolutionPlotter(parent=self)