-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc10teff_simple.py
More file actions
executable file
·27 lines (23 loc) · 995 Bytes
/
c10teff_simple.py
File metadata and controls
executable file
·27 lines (23 loc) · 995 Bytes
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
#!/usr/bin/env python
import c10teff
from astropy.io import ascii
import os
def main(color, value, feh):
path = os.path.dirname(os.path.realpath(__file__))
c10_coef = ascii.read(os.path.join(path, 'c10teff.csv'))
res = c10teff.one(color, value, feh, c10_coef)
if res != None:
print(res[0])
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
description='use Casagrande et al. (2010) calibrations to '+\
'calculate Teff of a dwarf or subgiant star using'+\
'its measured colors')
parser.add_argument('color', help='identification (e.g., bv for B-V)')
parser.add_argument('color_value',
help='measurement (e.g., 0.641 for the solar B-V)',
type=float)
parser.add_argument('feh', help='the star\'s iron abundance', type=float)
args = parser.parse_args()
main(args.color, args.color_value, args.feh)