Example #1
0
def Parser():
    """
    Returns an argparse Parser object with input args used by Stile and TreeCorr.
    """
    from . import treecorr_utils
    import argparse
    p = argparse.Parser(parent=treecorr_utils.Parser())
    #TODO: add, obviously, EVERYTHING ELSE
    return p
Example #2
0
def Parser():
    import argparse
    p = argparse.Parser()
    p.add_argument('--file_type',
                   help="File type (ASCII or FITS)",
                   dest='file_type')
    p.add_argument('--delimiter',
                   help="ASCII file column delimiter",
                   dest='delimiter')
    p.add_argument('--comment_marker',
                   help="ASCII file comment-line marker",
                   dest='comment_marker')
    p.add_argument('--first_row',
                   help="First row of the file(s) to be considered",
                   dest='first_row')
    p.add_argument('--last_row',
                   help="Last row of the file(s) to be considered",
                   dest='last_row')
    p.add_argument(
        '--x_units',
        help=
        "X-column units (radians, hours, degrees, arcmin, arcsec) -- only allowed "
        + "by certain DataHandlers",
        dest='x_units')
    p.add_argument(
        '--y_units',
        help=
        "Y-column units (radians, hours, degrees, arcmin, arcsec) -- only allowed "
        + "by certain DataHandlers",
        dest='y_units')
    p.add_argument(
        '--ra_units',
        help=
        "RA-column units (radians, hours, degrees, arcmin, arcsec) -- only " +
        "allowed by certain DataHandlers",
        dest='ra_units')
    p.add_argument(
        '--dec_units',
        help=
        "dec-column units (radians, hours, degrees, arcmin, arcsec) -- only " +
        "allowed by certain DataHandlers",
        dest='dec_units')
    p.add_argument('--flip_g1',
                   help="Flip the sign of g1 [default: False]",
                   dest='flip_g1',
                   default=False)
    p.add_argument('--flip_g2',
                   help="Flip the sign of g2 [default: False]",
                   dest='flip_g2',
                   default=False)
    p.add_argument(
        '--min_sep',
        help="Minimum separation for the TreeCorr correlation functions",
        dest='min_sep')
    p.add_argument(
        '--max_sep',
        help="Maximum separation for the TreeCorr correlation functions",
        dest='max_sep')
    p.add_argument(
        '--nbins',
        help="Number of bins for the TreeCorr correlation functions",
        dest='nbins')
    p.add_argument('--bin_size',
                   help="Bin width for the TreeCorr correlation functions",
                   dest='bin_size')
    p.add_argument(
        '--sep_units',
        help=
        "Units for the max_sep/min_sep/bin_size arguments for the TreeCorr " +
        "correlation functions",
        dest='sep_units')
    p.add_argument(
        '--bin_slop',
        help=
        "A parameter relating to accuracy of the TreeCorr bins--changing is not "
        + "recommended",
        dest='bin_slop')
    p.add_argument('-v',
                   '--verbose',
                   help="Level of verbosity",
                   dest='verbose')
    p.add_argument(
        '--num_threads',
        help='Number of threads (TreeCorr) or multiprocessing.Pool processors '
        + '(Stile) to use; default is to automatically determine',
        dest='num_threads')
    p.add_argument(
        '--split_method',
        help=
        "One of 'mean', 'median', or 'middle', directing TreeCorr how to split the "
        "tree into child nodes. [default: 'mean']",
        dest='split_method')
    return p