Esempio n. 1
0
def main(argv=None):
    if argv is None:
        argv = sys.argv[1:]

    desc = 'mcptpm directory list '
    parser = argparse.ArgumentParser(description=desc)
    parser.add_argument('-m',
                        '--mjd',
                        help='mjd, default is current mjd',
                        default=sjd.sjd(),
                        type=int)
    args = parser.parse_args()
    day = args.mjd

    host = "hub25m"
    print("/data/mcptpm/%s" % day)
    print("need pwd for observer@sdsshost2")
    COMMAND = "ls -la /data/mcptpm/%s" % day
    ssh = sb.Popen(["ssh", "%s" % host, COMMAND],
                   shell=False,
                   stdout=sb.PIPE,
                   stderr=sb.PIPE)
    result = ssh.stdout.readlines()

    if result == []:
        error = ssh.stderr.readlines()
        print("ERROR: %s" % error, file=sys.stderr)
    else:
        for r in result:
            print(r.strip())
Esempio n. 2
0
def parse_args():
    desc = 'Creates a report of all observed plates for time tracking'
    parser = argparse.ArgumentParser(description=desc)
    parser.add_argument('--m1',
                        help='start mjd, default current mjd',
                        default=sjd.sjd(),
                        type=int)
    parser.add_argument('--m2',
                        help='end mjd, default current mjd',
                        default=sjd.sjd(),
                        type=int)
    parser.add_argument('-a',
                        '--apogee',
                        help='get APOGEE-2 report',
                        action="store_true")
    parser.add_argument('-b',
                        '--bhm',
                        help='get BHM report',
                        action="store_true")
    parser.add_argument('-e',
                        '--eboss',
                        help='get eBOSS report',
                        action="store_true")
    parser.add_argument('-m',
                        '--mwm',
                        help='get MWM report',
                        action="store_true")
    parser.add_argument('--manga',
                        help='get MaNGA report',
                        action="store_true")
    parser.add_argument('-v',
                        '--verbose',
                        help='verbose data',
                        action="store_true")
    parser.add_argument('-f',
                        '--force',
                        action='store_true',
                        help='Forces analysis to conitinue even if a file is'
                        ' missing from /data or ~/data')

    args = parser.parse_args()
    return args
Esempio n. 3
0
def parse_args():
    today = sjd.sjd()
    desc = ('Integrates the dust accumulated in a night using TRON and prints'
            ' it. Needs no args for the current date.')
    parser = argparse.ArgumentParser(description=desc)
    parser.add_argument('-m',
                        '--mjd',
                        help='enter mjd, default is current mjd',
                        default=today,
                        type=int)
    parser.add_argument('-v',
                        '--verbose',
                        action="store_true",
                        help='print incremental dust data')
    args = parser.parse_args()
    return args
Esempio n. 4
0
def parseargs():
    parser = ArgumentParser(description='Creates a file with a list of sha1'
                            ' hashes in the same directory as the'
                            ' data, which is stored at the provided'
                            ' mjd. If no mjd is provided, then it'
                            ' is run for today.')
    parser.add_argument('mjds',
                        nargs='?',
                        default=[sjd.sjd()],
                        help='The mjd (or mjds) which you want to create a sum'
                        ' for')
    parser.add_argument('-f',
                        '--file',
                        help='The location of the sha1sum file for output,'
                        ' default is /data/spectro/<mjd>/<mjd>.sha1sum.'
                        ' Only works if one or fewer mjds is provided.')

    args = parser.parse_args()
    return args
Esempio n. 5
0
                                   )  # apogee   4*AB*47
        ss = "%s   %s " % (ss, mm)  # mm - manga observations
        lead = plates[plate][2]
        lead = lead.strip()
        ss = "%s   %s" % (ss, lead)  # lead
        print(ss)


if __name__ == "__main__":
    # print "Current mjd=", mjd.curSjd()
    desc = 'list of files for time tracking report '
    parser = argparse.ArgumentParser(description=desc)
    parser.add_argument('-m1',
                        '--mjd1',
                        help='start mjd, default current mjd',
                        default=sjd.sjd(),
                        type=int)
    # parser.add_argument('-m2', '--mjd2', help='end mjd, default current mjd',
    # default=mjd.curSjd(), type=int)
    # parser.add_argument('-a', '--apogee',  help='get apogee report',
    # action="store_true")
    # parser.add_argument('-b', '--boss',  help='get boss report',
    # action="store_true")
    # parser.add_argument('-m', '--manga',  help='get manga report',
    # action="store_true")
    parser.add_argument('-v',
                        '--verbose',
                        help='verbose data',
                        action="store_true")
    args = parser.parse_args()