-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathopen.py
53 lines (46 loc) · 1.67 KB
/
open.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 João Faria
# This file is part of OPEN which is licensed under the MIT license.
# You should have received a copy of the license along with OPEN. See LICENSE.
#
"""OPEN - software tools for exoplanet detection.
Usage:
open.py
open.py --nobanner
open.py (-h | --help)
open.py --version
Options:
-h --help Show this screen.
--version Show version.
--nobanner Start OPEN without welcome message.
"""
# standard library imports
# import sys
# intra-package imports
from OPEN.ipshell import EmbedShell, cfg
from OPEN.docopt import docopt
from OPEN._OPENversion import __version__
from OPEN.ext.keplerian import keplerian
import numpy as np
import scipy as sp
if __name__ == "__main__":
# version info
version = 'OPEN v' + __version__
# command-line argument parser
args = docopt(__doc__, version=version)
# if '--art' in sys.argv:
# with open('./OPEN/asciiart.txt', 'r') as f: print f.read()
banner = u'Welcome to ' + version + '\n'
banner += u'Created by João Faria | [email protected]\n\n'
banner += 'Type "listcommands" for a list of the available commands\n'
banner += 'For help on a specific command, type "command -h" or see http://j-faria.github.io/OPEN'
ipyshell = EmbedShell(config=cfg, user_global_ns=globals(), user_ns={'np':np, 'sp':sp, 'keplerian':keplerian},
banner1=banner,
banner2 = '',
display_banner = not args['--nobanner'],
usage='',
exit_msg='Goodbye.')
ipyshell.enable_pylab(import_all=False)
ipyshell()