Ejemplo n.º 1
0
def run(cfg_dir):
    template_common.exec_parameters()
    data = simulation_db.read_json(template_common.INPUT_BASE_NAME)
    if data['report'] == 'fieldReport':
        res = template.generate_field_report(data, cfg_dir)
        res['tof_expected'] = field_results.tof_expected
        res['steps_expected'] = field_results.steps_expected,
        res['e_cross'] = field_results.e_cross
    elif data['report'] == 'fieldComparisonReport':
        wp.step(template.COMPARISON_STEP_SIZE)
        res = template.generate_field_comparison_report(data, cfg_dir)
    else:
        raise AssertionError('unknown report: {}'.format(data['report']))
    template_common.write_sequential_result(res)
Ejemplo n.º 2
0
def run(cfg_dir):
    with pkio.save_chdir(cfg_dir):
        exec(_script(), locals(), locals())
        data = simulation_db.read_json(template_common.INPUT_BASE_NAME)
        if data['report'] == 'fieldReport':
            res = template.generate_field_report(data, cfg_dir)
            res['tof_expected'] = field_results.tof_expected
            res['steps_expected'] = field_results.steps_expected,
            res['e_cross'] = field_results.e_cross
        elif data['report'] == 'fieldComparisonReport':
            wp.step(template.COMPARISON_STEP_SIZE)
            res = template.generate_field_comparison_report(data, cfg_dir)
        else:
            raise RuntimeError('unknown report: {}'.format(data['report']))
    simulation_db.write_result(res)
Ejemplo n.º 3
0
def run(cfg_dir):
    with pkio.save_chdir(cfg_dir):
        exec(_script(), locals(), locals())
        data = simulation_db.read_json(template_common.INPUT_BASE_NAME)

        if data['report'] == 'fieldReport':
            values = potential[xl:xu, zl:zu]
            res = _generate_field_report(
                data, values, {
                    'tof_expected': tof_expected,
                    'steps_expected': steps_expected,
                    'e_cross': e_cross,
                })
        elif data['report'] == 'fieldComparisonReport':
            step(template.COMPARISON_STEP_SIZE)
            res = template.generate_field_comparison_report(data, cfg_dir)
        else:
            raise RuntimeError('unknown report: {}'.format(data['report']))
    simulation_db.write_result(res)
Ejemplo n.º 4
0
def run(cfg_dir):
    with pkio.save_chdir(cfg_dir):
        exec(_script(), locals(), locals())
        data = simulation_db.read_json(template_common.INPUT_BASE_NAME)

        if data['report'] == 'fieldReport':
            if len(potential.shape) == 2:
                values = potential[xl:xu, zl:zu]
            else:
                # 3d results
                values = potential[xl:xu, int(NUM_Y / 2), zl:zu]
            res = _generate_field_report(data, values, {
                'tof_expected': tof_expected,
                'steps_expected': steps_expected,
                'e_cross': e_cross,
            })
        elif data['report'] == 'fieldComparisonReport':
            step(template.COMPARISON_STEP_SIZE)
            res = template.generate_field_comparison_report(data, cfg_dir)
        else:
            raise RuntimeError('unknown report: {}'.format(data['report']))
    simulation_db.write_result(res)