コード例 #1
0
def timeseries_view(args,
                    instance_name,
                    view_ident="",
                    link_function="undefined"):
    # TODO: what to do with this?
    initial_datum = args.get('data', None)

    # get the config for this group from redis
    config = online_metrics.get_group_config("online",
                                             instance_name,
                                             front_end_abort=True)

    if initial_datum is None:
        if len(config["metric_list"]) > 0:
            initial_datum = config["metric_list"][0]
        else:
            intial_datum = "rms"

    render_args = {
        'title': instance_name,
        'link_function': link_function,
        'view_ident': view_ident,
        'config': config,
        'metric': initial_datum
    }

    return render_template('common/timeseries.html', **render_args)
コード例 #2
0
def Flange_Overview():
    flanges = ["EW04", "EW05", "EW06", "EW07", "EW08"]
    instance_name = "tpc_channel"

    config = online_metrics.get_group_config("online", instance_name, front_end_abort=True)

    # turn the flange positions to hw_selects
    hw_selects = [hardwaredb.HWSelector("flanges", "flange_pos_at_chimney", f) for f in flanges]

    channels = [hardwaredb.select(hw_select) for hw_select in hw_selects]
    channel_map = [hardwaredb.channel_map(hw_select, c) for hw_select,c in zip(hw_selects, channels)]

    # setup the plot titles
    titles = ["flange_pos_at_chimney %s -- tpc_channel" % f for f in flanges]
    print(channel_map)
     
    render_args = {
      "config": config,
      "channels": channels,
      "channel_maps": channel_map,
      "flanges": flanges,
      "metric": "rms",
      "titles": titles,
      "hw_selects": [h for h in hw_selects],
      "eventmeta_key": "eventmeta", # TODO: Set
    }

    return render_template('icarus/flange_overview.html', **render_args)
コード例 #3
0
ファイル: views.py プロジェクト: giosal/sbndaq-minargon
def purity():
    config = online_metrics.get_group_config("online", "TPC", front_end_abort=True)

    render_args = {
      'config': config
    }

    return render_template('sbnd/purity.html', **render_args)
コード例 #4
0
ファイル: views.py プロジェクト: giosal/sbndaq-minargon
def timeseries_view(args,
                    instance_name,
                    view_ident="",
                    link_function="undefined",
                    eventmeta_key=None,
                    hw_select=None):
    # TODO: what to do with this?
    initial_datum = args.get('data', None)

    # get the config for this group from redis
    config = online_metrics.get_group_config("online",
                                             instance_name,
                                             front_end_abort=True)

    if initial_datum is None:
        if len(config["metric_list"]) > 0:
            initial_datum = config["metric_list"][0]
        else:
            intial_datum = "rms"

    # process the channels
    # if the hw_select is present, get it
    if hw_select is not None:
        channels = hardwaredb.select(hw_select)
        # lookup if there is a channel mapping
        channel_map = hardwaredb.channel_map(hw_select, channels)
        if channel_map is None:
            channel_map = "undefined"
    else:
        channels = "undefined"
        channel_map = "undefined"

    # setup the title
    title = instance_name
    if hw_select is not None:
        title = ("%s %s -- " % (hw_select.column, hw_select.value)) + title

    # setup hw_select
    if hw_select is None:
        hw_select = "undefined"
    else:
        hw_select = hw_select.to_url()

    render_args = {
        'title': title,
        'link_function': link_function,
        'view_ident': view_ident,
        'config': config,
        'metric': initial_datum,
        'eventmeta_key': eventmeta_key,
        'channels': channels,
        'hw_select': hw_select,
        'channel_map': channel_map,
    }

    return render_template('common/timeseries.html', **render_args)
コード例 #5
0
def purity():
    instance_name = "TPC"
    metric_name = "purity"

    # get the config for this group from redis
    config = online_metrics.get_group_config("online", instance_name, front_end_abort=True)

    render_args = {
        'title': metric_name,
        'config': config,
    }

    return render_template('icarus/purity_timeseries.html', **render_args)
コード例 #6
0
def CRT_board_snapshot():
    board_no = int(request.args.get("board_no", 0))
    # get the config for this group from redis
    config_board = online_metrics.get_group_config("online", "CRT_board", front_end_abort=True)
    config_channel = online_metrics.get_group_config("online", "CRT_channel", front_end_abort=True)

    view_ind = {'board_no': board_no}
    # TODOL fix..... all of this
    view_ind_opts = {'board_no': range(8)}

    # TODO: implement real channel mapping
    board_channels = range(board_no*32, (board_no+1)*32)

    render_args = {
        'title': ("CRT Board %i Snapshot" % board_no),
        'board_config': config_board,
        'channel_config': config_channel,
        'board_no': board_no,
        'view_ind': view_ind,
        'view_ind_opts': view_ind_opts,
        'board_channels': board_channels
    }

    return render_template("icarus/crt_board_snapshot.html", **render_args)
コード例 #7
0
def PMT_snapshot():
    channel = request.args.get("PMT", 0, type=int)
    group_name = "PMT"
    # TODO: fix hardcode
    pmt_range = range(360)
    config = online_metrics.get_group_config("online", group_name, front_end_abort=True)

    template_args = {
      "channel": channel,
      "config": config,
      "pmt_range": pmt_range,
      "view_ind": {"PMT": channel},
      "view_ind_opts": {"PMT": pmt_range},
    }
    return render_template("icarus/pmt_snapshot.html", **template_args)
コード例 #8
0
ファイル: views.py プロジェクト: gputnam/minargon
def channel_snapshot():
    channel = request.args.get('channel', 0, type=int)

    view_ind = {'channel': channel}
    view_ind_opts = {'channel': range(constants.N_CHANNELS)}

    instance_name = "tpc_channel"
    config = online_metrics.get_group_config("online", instance_name, front_end_abort=True)

    template_args = {
        'channel': channel,
        'config': config,
        'view_ind': view_ind,
        'view_ind_opts': view_ind_opts,
    }
    return render_template('sbnd/channel_snapshot.html', **template_args)
コード例 #9
0
def channel_snapshot():
    channel = request.args.get('channel', 0, type=int)

    view_ind = {'channel': channel}
    # TODOL fix..... all of this
    view_ind_opts = {'channel': range(2304)}

    instance_name = "tpc_channel"
    config = online_metrics.get_group_config("online", instance_name, front_end_abort=True)

    template_args = {
        'channel': channel,
        'config': config,
        'view_ind': view_ind,
        'view_ind_opts': view_ind_opts,
    }
    return render_template('icarus/channel_snapshot.html', **template_args)