Esempio n. 1
0
def open_table(name):
	if '.vot' in name:
		table = vot_parse(name,pedantic=False).get_first_table()
		return table.array
	elif '.fits' or '.FITS' in name:
		table = fits.open(name,pedantic=False)
		return table[1].data
	else:
		sys.exit('Entered table must either be VOTable or FITS')
Esempio n. 2
0
def read_table(name):
	'''Read in a table and work out if its .vot or .fits, and grab the
	data accordingly. If not the right format, exit the whole process'''
	if '.vot' in name:
		table = vot_parse(name,pedantic=False).get_first_table()
		data = table.array
		return data
	elif '.fits' or '.FITS' in name:
		table = fits.open(name,pedantic=False)
		return table[1].data
	else:
		sys.exit('Entered table must either be VOTable or FITS')
Esempio n. 3
0
def read_table(name):
	'''Read in a table and work out if its .vot or .fits, and grab the
	data accordingly. If not the right format, exit the whole process'''
	if '.vot' in name:
		table = vot_parse(name,pedantic=False).get_first_table()
		data = table.array
		return data
	elif '.fits' or '.FITS' in name:
		table = fits.open(name,pedantic=False)
		return table[1].data
	else:
		sys.exit('Entered table must either be VOTable or FITS')
Esempio n. 4
0
    def __init__(self):
        self.SI = None
        self.intercept = None
        self.SI_err = None
        self.intercept_err = None
        self.num_match = None
        self.retained_match = None
        self.type_match = None
        self.low_resid = None
        self.num_cats = None


name = options.input_table

if ".vot" in name:
    table = vot_parse(name, pedantic=False).get_first_table()
    tdata = table.array
elif ".fits" or ".FITS" in name:
    table = fits.open(name, pedantic=False)
    tdata = table[1].data
else:
    sys.exit("Entered table must either be VOTable or FITS")

SIs = tdata["SI"]
intercepts = tdata["Intercept"]
# SI_errs = tdata['e_SI']
# intercept_errs = tdata['e_Intercept']
num_cats = tdata["Number_cats"]
# num_matches = tdata['Number_matches']
# retained_matches = tdata['Retained_matches']
type_matches = tdata["Match_stage"]
Esempio n. 5
0
    def __init__(self):
        self.SI = None
        self.intercept = None
        self.SI_err = None
        self.intercept_err = None
        self.num_match = None
        self.retained_match = None
        self.type_match = None
        self.low_resid = None
        self.num_cats = None


name = options.input_table

if '.vot' in name:
    table = vot_parse(name, pedantic=False).get_first_table()
    tdata = table.array
elif '.fits' or '.FITS' in name:
    table = fits.open(name, pedantic=False)
    tdata = table[1].data
else:
    sys.exit('Entered table must either be VOTable or FITS')

SIs = tdata['SI']
intercepts = tdata['Intercept']
#SI_errs = tdata['e_SI']
#intercept_errs = tdata['e_Intercept']
num_cats = tdata['Number_cats']
#num_matches = tdata['Number_matches']
#retained_matches = tdata['Retained_matches']
type_matches = tdata['Match_stage']