예제 #1
0
def get_input():
    print("============================================")
    print("n or [enter]    - go to Next event")
    print("d               - Display the event")
    print("p               - Print all event data")
    print("i               - event Info")
    print("q               - Quit")
    return input("Choice: ")

if __name__ == '__main__':

    if len(sys.argv) > 1:
        filename = sys.argv.pop(1)
    else:
        filename = get_example_simtelarray_file()

    plt.style.use("ggplot")
    plt.show(block=False)

    # loop over events and display menu at each event:
    source = hessio_event_source(filename)

    for event in source:

        print("EVENT_ID: ", event.dl0.event_id, "TELS: ",
              event.dl0.tels_with_data)

        while True:
            response = get_input()
            if response.startswith("d"):
예제 #2
0
    return peds, gains


def apply_mc_calibration(adcs, tel_id):
    """
    apply basic calibration
    """
    peds, gains = get_mc_calibration_coeffs(tel_id)
    return (adcs - peds) * gains


if __name__ == '__main__':

    parser = argparse.ArgumentParser(description='Perform simple Hillas Reco')
    parser.add_argument('filename', metavar='EVENTIO_FILE', nargs='?',
                        default=get_example_simtelarray_file())
    args = parser.parse_args()

    source = hessio_event_source(args.filename)

    container = Container("hessio_container")
    container.meta.add_item('pixel_pos', dict())
    container.add_item("dl0", RawData())
    container.add_item("mc", MCShowerData())
    container.add_item("trig", CentralTriggerData())
    container.add_item("count")
    tel_FIXME, cam_FIXME, opt_FIXME = ID.load(filename=args.filename)
    # embed()

    ev = 0
    efficiency = list()
예제 #3
0
    print("============================================")
    print("n or [enter]    - go to Next event")
    print("d               - Display the event")
    print("p               - Print all event data")
    print("i               - event Info")
    print("s               - save event image")
    print("q               - Quit")
    return input("Choice: ")


if __name__ == '__main__':

    if len(sys.argv) > 1:
        filename = sys.argv.pop(1)
    else:
        filename = get_example_simtelarray_file()

    plt.style.use("ggplot")
    plt.show(block=False)

    # loop over events and display menu at each event:
    source = hessio_event_source(filename)

    for event in source:

        print("EVENT_ID: ", event.dl0.event_id, "TELS: ",
              event.dl0.tels_with_data, "MC Energy:", event.mc.energy)

        while True:
            response = get_input()
            if response.startswith("d"):
예제 #4
0
def apply_mc_calibration(adcs, tel_id):
    """
    apply basic calibration
    """
    peds, gains = get_mc_calibration_coeffs(tel_id)
    return (adcs - peds) * gains


if __name__ == '__main__':

    parser = argparse.ArgumentParser(description='show single telescope')
    parser.add_argument('tel', metavar='TEL_ID', type=int)
    parser.add_argument('filename',
                        metavar='EVENTIO_FILE',
                        nargs='?',
                        default=get_example_simtelarray_file())
    parser.add_argument('-m', '--max-events', type=int, default=10)
    parser.add_argument('-c', '--channel', type=int, default=0)
    parser.add_argument('-w',
                        '--write',
                        action='store_true',
                        help='write images to files')
    parser.add_argument('-s',
                        '--show-samples',
                        action='store_true',
                        help='show time-variablity, one frame at a time')
    args = parser.parse_args()

    source = hessio_event_source(args.filename,
                                 allowed_tels=[
                                     args.tel,