forked from astroChasqui/q2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
52 lines (45 loc) · 1.89 KB
/
config.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
import os
import logging
import matplotlib.pyplot as plt
logger = logging.getLogger(__name__)
path = os.path.dirname(os.path.realpath(__file__))
path = os.path.join(path, 'Data')
COLORTEFF_PATH = os.path.join(path, 'ColorTeff')
MODATM_PATH = os.path.join(path, 'ModelAtmospheres')
ISOCHRONES_PATH = os.path.join(path, 'Isochrones')
OTHER_PATH = os.path.join(path, 'Other')
plt.rc("font", family='serif', serif='Ubuntu', monospace='Ubuntu Mono', \
size=14)
plt.rc("axes", labelsize=15, titlesize=12)
plt.rc("xtick", top=True, direction='in', labelsize=14)
plt.rc("xtick.major", size=8, width=1)
plt.rc("ytick", right=True, direction='in', labelsize=14)
plt.rc("ytick.major", size=8, width=1)
plt.rc("lines", markersize=10, markeredgewidth=2)
plt.rc("lines", linewidth=3)
def moog_is_available():
"""You should be able to run MOOGSILENT from the command line in order
to use the MOOG features included in q2. This function checks if
MOOG is available on your system. If False, you wont be able to
connect q2 to MOOG and many things will fail.
"""
if os.system('which MOOGSILENT >/dev/null'):
logger.warning("MOOGSILENT is not available")
return False
else:
logger.info("MOOGSILENT is available")
return True
def data_are_available():
"""q2 needs data files with model atmosphere and isochrone grids.
These files can be downloaded from:
http://www.astrochasqui.com/projects/astro/share/q2Data.tar.gz
They need to be extracted inside the q2 directory.
'tar xvfz q2Data.tar.gz' will create the Data folder.
"""
if os.path.exists(path):
logger.info("Data folder exists")
return True
else:
logger.warning("Data folder does not exist. See the 'Data' section "\
"at https://github.com/astroChasqui/q2")
return False