コード例 #1
0
def main():

    args = parser.parse_args()

    dl1_filename = os.path.abspath(args.input_file)

    config = get_standard_config()
    if args.config_file is not None:
        try:
            config = read_configuration_file(os.path.abspath(args.config_file))
        except ("Custom configuration could not be loaded !!!"):
            pass

    dl1_params = pd.read_hdf(dl1_filename, key=dl1_params_lstcam_key)
    subarray_info = SubarrayDescription.from_hdf(dl1_filename)
    tel_id = config["allowed_tels"][0] if "allowed_tels" in config else 1
    focal_length = subarray_info.tel[tel_id].optics.equivalent_focal_length

    src_dep_df = pd.concat(get_source_dependent_parameters(
        dl1_params, config, focal_length=focal_length),
                           axis=1)

    metadata = global_metadata()
    write_dataframe(src_dep_df,
                    dl1_filename,
                    dl1_params_src_dep_lstcam_key,
                    config=config,
                    meta=metadata)
コード例 #2
0
def test_check_and_apply_volume_reduction():
    source = event_source(get_dataset_path('gamma_test.simtel.gz'))
    ev = next(iter(source))
    cal = CameraCalibrator()
    config = get_standard_config()
    config['volume_reducer']['algorithm'] = 'zero_suppression_tailcut_dilation'

    cal(ev)
    check_and_apply_volume_reduction(ev, config)

    for tel_id in ev.r0.tels_with_data:
        assert 0 in ev.dl1.tel[tel_id].image
        assert 0 in ev.dl1.tel[tel_id].pulse_time
        assert 0 in ev.dl0.tel[tel_id].waveform
def main():

    dl1_filename = os.path.abspath(args.input_file)

    config = get_standard_config()
    if args.config_file is not None:
        try:
            config = read_configuration_file(os.path.abspath(args.config_file))
        except ("Custom configuration could not be loaded !!!"):
            pass

    dl1_params = pd.read_hdf(dl1_filename, key=dl1_params_lstcam_key)
    src_dep_df = get_source_dependent_parameters(dl1_params, config)
    write_dataframe(src_dep_df, dl1_filename, dl1_params_src_dep_lstcam_key)
コード例 #4
0
def test_get_volume_reduction_method():
    config = get_standard_config()
    config['volume_reducer']['algorithm'] = 'zero_suppression_tailcut_dilation'
    algo = get_volume_reduction_method(config)
    algo = globals()[algo]
    assert algo is zero_suppression_tailcut_dilation