@classmethod<EOL><INDENT>def standardize_table(cls, table):<DEDENT>
<EOL>for key in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>bad = table[key].mask<EOL>table[key][bad] = <NUM_LIT:0.0><EOL><DEDENT>bad = table['<STR_LIT>']/table['<STR_LIT>'] < <NUM_LIT:1><EOL>bad += table['<STR_LIT>'].mask<EOL>table['<STR_LIT>'][bad] = np.nan<EOL>distance = <NUM_LIT:1000>*u.pc/table['<STR_LIT>'].data<EOL>distance[bad] = <NUM_LIT>*u.pc<EOL>identifiers  = {'<STR_LIT>':table['<STR_LIT>']}<EOL>coordinates = dict(  ra=table['<STR_LIT>'].data*u.deg,<EOL>dec=table['<STR_LIT>'].data*u.deg,<EOL>pm_ra_cosdec=table['<STR_LIT>'].data*u.mas/u.year,<EOL>pm_dec=table['<STR_LIT>'].data*u.mas/u.year,<EOL>radial_velocity=table['<STR_LIT>'].data*u.km/u.s,<EOL>distance=distance, <EOL>obstime=cls.epoch*np.ones(len(table))*u.year)<EOL>magnitudes = {k+'<STR_LIT>':table['<STR_LIT>'.format(k.lower())].data for k in cls.filters}<EOL>errors = dict(distance= distance*(table['<STR_LIT>'].data/table['<STR_LIT>'].data),<EOL>pm_ra_cosdec=table['<STR_LIT>'].data*u.mas/u.year,<EOL>pm_dec=table['<STR_LIT>'].data*u.mas/u.year,<EOL>radial_velocity=table['<STR_LIT>'].data*u.km/u.s)<EOL>error_table = Table(data=[errors[k] for k in cls.error_keys],<EOL>names=[k+'<STR_LIT>' for k in cls.error_keys])<EOL>standardized = hstack([Table(identifiers),<EOL>Table(coordinates),<EOL>Table(magnitudes),<EOL>error_table])<EOL>standardized.meta['<STR_LIT>'] = '<STR_LIT>'<EOL>return standardized<EOL>
Extract objects from a Gaia DR2 table.