def main():
    os.makedirs(args.outdir, exist_ok=True)

    dl0_to_dl1.allowed_tels = {1, 2, 3, 4}
    output_filename = args.outdir + '/dl1_' + os.path.basename(
        args.infile).rsplit('.', 1)[0] + '.h5'

    config = {}
    if args.config_file is not None:
        try:
            config = read_configuration_file(args.config_file)
        except ("Custom configuration could not be loaded !!!"):
            pass

    config["max_events"] = args.max_events

    dl0_to_dl1.r0_to_dl1(args.infile,
                         output_filename=output_filename,
                         custom_config=config,
                         pedestal_path=args.pedestal_path,
                         calibration_path=args.calibration_path,
                         time_calibration_path=args.time_calibration_path,
                         pointing_file_path=args.pointing_file_path,
                         ucts_t0_dragon=args.ucts_t0_dragon,
                         dragon_counter0=args.dragon_counter0,
                         ucts_t0_tib=args.ucts_t0_tib,
                         tib_counter0=args.tib_counter0)
예제 #2
0
def main():

    os.makedirs(args.outdir, exist_ok=True)

    dl0_to_dl1.allowed_tels = {1, 2, 3, 4}
    output_filename = args.outdir + '/dl1_' + os.path.basename(
        args.infile).rsplit('.', 1)[0] + '.h5'

    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

    dl0_to_dl1.r0_to_dl1(args.infile,
                         output_filename=output_filename,
                         custom_config=config)
예제 #3
0
                     help='Path where to store the reco dl2 events',
                     default='./results')
parser.add_argument('--maxevents', '-x', action='store', type=int,
                     dest='max_events',
                     help='Maximum number of events to analyze',
                     default=None)

args = parser.parse_args()

if __name__ == '__main__':

    #Get out the data from the Simtelarray file:

    dl0_to_dl1.max_events = args.max_events

    dl0_to_dl1.r0_to_dl1(args.datafile)
    output_filename = 'dl1_' + os.path.basename(args.datafile).split('.')[0] + '.h5'
    data = pd.read_hdf(output_filename,key='events/LSTCam')

    #Load the trained RF for reconstruction:
    fileE = args.path_models + "/RFreg_Energy.sav"
    fileD = args.path_models + "/RFreg_Disp.sav"
    fileH = args.path_models + "/RFcls_GH.sav"
    
    RFreg_Energy = joblib.load(fileE)
    RFreg_Disp = joblib.load(fileD)
    RFcls_GH = joblib.load(fileH)
    
    #Apply the models to the data
    features = ['intensity',
                'time_gradient',
예제 #4
0
from ctapipe.utils import get_dataset_path
from lstchain.reco import dl0_to_dl1
import os

parser = argparse.ArgumentParser(description="R0 to DL1")

parser.add_argument('--infile',
                    '-f',
                    type=str,
                    dest='infile',
                    help='path to the file with simtelarray events',
                    default=get_dataset_path('gamma_test_large.simtel.gz'))

parser.add_argument('--outdir',
                    '-o',
                    action='store',
                    type=str,
                    dest='outdir',
                    help='Path where to store the reco dl2 events',
                    default='./dl1_data/')

args = parser.parse_args()

if __name__ == '__main__':
    os.makedirs(args.outdir, exist_ok=True)

    output_filename = args.outdir + '/dl1_' + os.path.basename(
        args.infile).rsplit('.', 1)[0] + '.h5'

    dl0_to_dl1.r0_to_dl1(args.infile, output_filename=output_filename)
예제 #5
0
def test_dl0_to_dl1():
    from lstchain.reco.dl0_to_dl1 import r0_to_dl1
    infile = get_dataset_path('gamma_test_large.simtel.gz')
    r0_to_dl1(infile)
예제 #6
0
def test_dl0_to_dl1():
    from lstchain.reco.dl0_to_dl1 import r0_to_dl1
    infile = get_dataset_path(testfile)
    r0_to_dl1(infile, custom_config=custom_config, output_filename=dl1_file)
예제 #7
0
def test_dl0_to_dl1():
    from lstchain.reco.dl0_to_dl1 import r0_to_dl1
    infile = mc_gamma_testfile
    r0_to_dl1(infile, custom_config=custom_config, output_filename=dl1_file)
예제 #8
0
parser.add_argument('--outdir', '-o', action='store', type=str,
                    dest='outdir',
                    help='Path where to store the reco dl2 events',
                    default='./dl1_data/')

parser.add_argument('--config_file', '-conf', action='store', type=str,
                    dest='config_file',
                    help='Path to a configuration file. If none is given, a standard configuration is applied',
                    default=None
                    )

args = parser.parse_args()



if __name__ == '__main__':
    os.makedirs(args.outdir, exist_ok=True)
    
    dl0_to_dl1.allowed_tels = {1, 2, 3, 4}
    output_filename = args.outdir + '/dl1_' + os.path.basename(args.infile).rsplit('.', 1)[0] + '.h5'

    config = {}
    if args.config_file is not None:
        try:
            config = read_configuration_file(args.config_file)
        except("Custom configuration could not be loaded !!!"):
            pass

    dl0_to_dl1.r0_to_dl1(args.infile, output_filename=output_filename, custom_config=config)