def transform_celestial(coords, systems): rav = coords['lon'] / 15.0 decv = coords['lat'] plist = [novas.radec2vector(ra, dec, 1.0) for ra, dec in zip(rav, decv)] if systems['in'] == 'icrs': pass elif systems['in'] == 'fk5': plist = [novas.frame_tie(position, -1) for position in plist] elif systems['in'] == 'ecliptic': plist = [novas.ecl2equ_vec(T0, position, 2) for position in plist] if systems['out'] == 'icrs': pass elif systems['out'] == 'fk5': plist = [novas.frame_tie(position, 0) for position in plist] elif systems['out'] == 'ecliptic': plist = [novas.equ2ecl_vec(T0, position, 2) for position in plist] ra, dec = np.array([novas.vector2radec(position) for position in plist]).T out = Table() out['lon'] = ra * 15.0 out['lat'] = dec return out
def convert(coords, systems): rav = coords['lon'] / 15.0 decv = coords['lat'] plist = [novas.radec2vector(ra, dec, 1.0) for ra, dec in zip(rav, decv)] if systems['in'] == 'icrs': pass elif systems['in'] == 'fk5': plist = [novas.frame_tie(position, -1) for position in plist] elif systems['in'] == 'ecliptic': plist = [novas.ecl2equ_vec(T0, position, 2) for position in plist] else: return None if systems['out'] == 'icrs': pass elif systems['out'] == 'fk5': plist = [novas.frame_tie(position, 0) for position in plist] elif systems['out'] == 'ecliptic': plist = [novas.equ2ecl_vec(T0, position, 2) for position in plist] else: return None ra, dec = np.array([novas.vector2radec(position) for position in plist]).T return dict(lon=ra * 15.0, lat=dec)