Esempio n. 1
0

    import argparse

    # Init the command line arguments parser
    arg_parser = argparse.ArgumentParser(description="Run the trajectory solver on the given METAL or mirfit .met file.")

    arg_parser.add_argument('met_path', nargs=1, metavar='MET_PATH', type=str, \
        help='Full path to the .met file.')

    # Add option to compute CAMO narrowfield photometry
    arg_parser.add_argument('-n', '--photom', metavar='PHOTOM_OFFSERS', \
        help="Photometric offsets used to compute narrowfield photometry from LSP values in the met file. Format should be e.g. 1=16.8,2=15.9, where the 1 is Tavis and 16.8 is the photometric zero point.", type=str)

    # Add other solver options
    arg_parser = addSolverOptions(arg_parser)

    # Parse the command line arguments
    cml_args = arg_parser.parse_args()

    #########################

    ### Parse command line arguments ###

    met_path = os.path.abspath(cml_args.met_path[0])

    dir_path = os.path.dirname(met_path)

    # Check if the given directory is OK
    if not os.path.isfile(met_path):
        print('No such file:', met_path)
Esempio n. 2
0
if __name__ == "__main__":

    import argparse

    ### COMMAND LINE ARGUMENTS

    # Init the command line arguments parser
    arg_parser = argparse.ArgumentParser(
        description="Run the trajectory solver on DFN ECSV files.")

    arg_parser.add_argument('ecsv_files', nargs="+", metavar='ECSV_PATH', type=str, \
        help="Path to 2 of more ECSV files. Wildcards are supported, so e.g. /path/to/*.ecsv also works.")

    # Add other solver options
    arg_parser = addSolverOptions(arg_parser, skip_velpart=True)

    arg_parser.add_argument('-p', '--velpart', metavar='VELOCITY_PART', \
        help="Fixed part from the beginning of the meteor on which the initial velocity estimation using the sliding fit will start. Default is 0.4 (40 percent), but for noisier data this might be bumped up to 0.5.", \
        type=float, default=0.4)

    arg_parser.add_argument('-w', '--walk', \
        help="Recursively find all ECSV files in the given folder and use them for trajectory estimation.", \
        action="store_true")

    # Parse the command line arguments
    cml_args = arg_parser.parse_args()

    #########################

    ### Parse command line arguments ###