import numpy as np
__all__ = ['name']
def name(event_id, no_name  = True, silent = False):
	'''------------------------------------------------------------
		Description: 
	---------------------------------------------------------------
		Input:
	---------------------------------------------------------------
		Output:
	------------------------------------------------------------'''
	event_id = np.int64(event_id) 
	where = np.where(namelist['ID'] == event_id)[0]
	if len(where)== 0:
		if not silent:print('Not in list:', event_id)
		if no_name:
			return 'DR2: '+ str(event_id)
		else: return ''
	if len(where)==1: 
		if namelist[where[0]]['Name'] == '' :
			if no_name: 
				return 'DR2: '+ str(event_id)
			else:
				return ''
		else:	
			return namelist[where[0]]['Name']

	if len(where)>1: 
		if not silent:print('douplikat:', event_id)
		return namelist[where[0]]['Name']

def name_good(event_id, silent = False):
	'''------------------------------------------------------------
		Description: 
	---------------------------------------------------------------
		Input:
	---------------------------------------------------------------
		Output:
	------------------------------------------------------------'''
	event_id = np.int64(event_id) 

	where = np.where(namelist['ID'] == event_id)[0]
	if len(where)== 0:
 		return True
	elif len(where)==1: 
		return bool(namelist[where[0]]['Good'])
		print(1)
	elif len(where)>1: 
		if not silent:print('douplikat:', event_id)
		return namelist[where[0]]['Good']
	return True

namelist = np.array([
	(5853498713160606720,	'<NAME>', True),
	(1872046574983497216,	'61 C<NAME>', True),
	(5332606522595645952,	'LAWD 37', True),
	(1872046574983507456,	'61 Cyg A', True),
	(5254061535097566848,	'L 143-23', True),
	(4516199240734836608,	'Ross 733', True),
	(4472832130942575872,	"Barnard's star" , True),
	(5951824121022278144,	'GJ 674', True),
	(5339892367683264384, 	"Innes' star", True),
	(470826482635701376,	'<NAME> B', True),
	(6710522912622915712,	'UCAC3 86-396928', True),
	(1543076475514008064,	'G 123-61B', True),
	(5696640563228494464,	'WT 1550', True),
	(1964791583368232832,	'tau Cyg A', True),
	(4687445500635789184,	'OGLE SMC115.5 319', True),
	(1978296747258230912,	'LSPM J2129+4720', True),
	(2315857227976341504,	'HD 2404', True),
	(429297924157113856,	'G 217-32', True),
	(1157210463244589568,	'G 15-11', True),
	(2390377345808152832,	'HD 222506', True),
	(1935209944575937024,	'UCAC4 677-123934', True),
	(4793869292650732160,	'UPM J0537-4924', True),
	(6677000246203170944,	'HD 197484', True),
	(4687511776265158400,	'L 51-47', True),
	(5492622847798742272,	'L 240-16', True),
	(1543076475509704192,	'G 123-61A', True),
	(4544176352376541312,	'LP 506-50 A', True),
	(6522256697697129600,	'LEHPM 6274', True),
	(4529285391522200320,	'109 Her', True),
	(6128259487711387008,	'L 328-36', True),
	(6585158207436506368,	'HD 207450', True),
	(5309386791195469824,	'HD 85228', True),
	(1961141200470502400,	'LSPM J2154+4344', True),
	(3347284175186268160,	'UCAC4 527-018168', True),
	(5396870945686245504,	'HD 97073', True),
	(5902780301768699392,	'HD 136466A', True),
	(3398414352092062720,	'G 100-35B', True),
	(4924486979061864832,	'CD-53 40', True),
	(4657982643495556608,	'OGLE LMC162.5 41235', True),
	(577478114092768384,	'G 114-33', True),
	(6368299918479525632,	'UCAC3 27-74415', True),
	(6036143915373978880,	'HD 144179A', True),
	(5225957639881367552,	'L 66-82', True),
	(5921433963191695872,	'LAWD 68', True),
	(4623882630333283328,	'L 31-84', True),
	(5559827605531610240,	'CD-43 3055', True),
	(2534338503471881728,	'G 70-55A', True),
	(2846620421603149312,	'G 129-51', True),
	(5302618648583292800,	'PM J08503-5848', True),
	(4451575895403432064,	'G 16-29', True),
	(5930568598406530048,	'HD 149192', True),
	(3763681215875388288,	'G 163-21', True),
	(4116840541184279296,	'L 702-43', True),
	(2759428629829608064,	'G 29-73', True),
	(5736464668224470400,	'L 820-19', True),
	(2912585037597833856,	'LP 838-28 A', True),
	(5235714289453482240,	'L 103-12', True),
	(1382796061323905024,	'TYC 3064-1282-1', True),
	(546488928621555328,	'G 245-47A', True),
	(6213824650812054528,	'LP 859-51', True),
	(5134154157033028352,	'LP 828-36', True),
	(2790883634570755968,	'LP 350-66', True),
	(5600272625752039296,	'L 601-78', True),
	(6874112547575038336,	'LP 814-25', True),
	(6549824370485770112,	'UCAC4 260-200149', True),
	(5608893346278863616,	'LP 896-12 A', True),
	(4056233810947522304,	'HD 316899', True),
	(654826970401335296,	'HD 66553', True),
	(6054954738289909632,	'HD 108500A', True),
	(4149572555606973568,	'LP 748-33', True),
	(2826159850241446784,	'HD 222474A', True),
	(2358524597030794112,	'V* YZ Cet', True),
	(1875076004382831616,	'BD+21 4747A', True),
	(6415630939116638464,	'EC 19249-7343', True),
	(1444367711752056960,	'LP 379-98', True),
	(1625058605098521600,	'HD 146868', True),
	(239070631455336064,	'BD+39 710A', True),
	(568432427635050240,	'G 245-68', True),
	(4937000898855759104,	'GJ 86', False),
	(5032229910174557056,	'HD 5425A', True),
	(2870877194301321088,	'TYC 2752-1121-1', True),
	(6916644779774493696,	'LP 636-60', True),
	(5359745012164917632,	'L 250-10', True),
	(2646280705713202816,	'BD+00 5017', True),
	(5243594081269535872,	'L 100-115', True),
	(5429919108417092096,	'LP 462-88', True),
	(5979367986779538432,	'CD-32 12693', True),
	(4041006743145526656,	'LP 486-32', True),
	(835871554301614848,	'LSPM J1047+5016', True),
	(5895473600324039680,	'L 260-120', True),
	(3585636855608873984,	'HD 102392A', True),
	(4228023259961831296,	'HD 197623', True),
	(101283987497967360,	'HD 13482A', True),
	(5393446658454453632,	'DENIS J1048.0-3956', True),
	(3842095911266162432,	'HD 78663', True),
	(4198685678421509376,	'HD 177758', True),
	(643819484616249984,	'mu. Leo', True),
	(4786715182805934592,	'HD 30361A', True),
	(4269932382606282112,	'eta Ser', True),
	(5941940988948890112,	'HD 330763A', True),
	(6031475835680030720,	'L 555-14', True),
	(1568219729458240128,	'HD 110833', True),
	(1015799283499485440,	'HD 77006', True),
	(3202470247468181632,	'BD-06 855', True),
	(488099359330834432,	'HD 22399', True),
	(1251328585567327744,	'HD 120065', True),
	(962141157557751552,	'G 101-35', True),
	(416158489625704320,	'G 172-11', True),
	(1962597885872344704,	'BD+43 4138', True),
	(4361365433110271232,	'HD 156826', True),
	(1817982759302341376,	'HD 347427', True),
	(2937651222655480832,	'HD 44573', True),
	(5657306462454704640,	'HD 85725', True),
	(4780100658292046592,	'L 230-188', True),
	(5941478335062267392,	'L 338-152', True),
	(6254033894120917760,	'L 768-119', True),
	(6209995700348976896,	'LP 915-41', True),
	(1136512191212093440,	'G 251-35', True),
	(5650153825784353280,	'HD 78643', True),
	(5413531987125139712,	'PM J10195-4622', True),
	(2028065934962125184,	'Ross 165A', True),
	(6787883382523590400,	'HD 201989', True),
	(3934198156329809152,	'HD 110315', True),
	(4657193606465368704,	'HD 39194', True),
	(598180646733241216,	'G 46-2', True),
	(5801950515627094400,	'HD 155918', True),
	(829777377964973952,	'HD 92855', True),
	(5856411869205581568,	'HD 109200', True),
	(466294295706341760,	'HD 18757', True),
	(533621859441169920,	'Ross 318', True),
	(4535144998232287232,	'HD 171314', True),
	(5534742080239458048,	'HD 66020', True),
	(5849427049801267200,	'HD 124584', True),
	(4293318823182081408,	'HD 180617', True),
	(1193030490492925824,	'gam Ser', True),
	(689004018040211072, 	'75 Cnc', True)
	], dtype=[('ID','i8'),('Name','U25'), ('Good',bool)])
