def _get_apparent_body_position(body, time, ephemeris):
 if (ephemeris is None):
  ephemeris = solar_system_ephemeris.get()
 if ((ephemeris == u'builtin') and (body.lower() == u'moon')):
  return get_body_barycentric(body, time, ephemeris)
 delta_light_travel_time = (20.0 * u.s)
 emitted_time = time
 light_travel_time = (0.0 * u.s)
 earth_loc = get_body_barycentric(u'earth', time, ephemeris)
 while np.any((np.fabs(delta_light_travel_time) > (1e-08 * u.s))):
  body_loc = get_body_barycentric(body, emitted_time, ephemeris)
  earth_distance = (body_loc - earth_loc).norm()
  delta_light_travel_time = (light_travel_time - (earth_distance / speed_of_light))
  light_travel_time = (earth_distance / speed_of_light)
  emitted_time = (time - light_travel_time)
 return get_body_barycentric(body, emitted_time, ephemeris)

def _get_apparent_body_position ( body , time , ephemeris ) : if ( ephemeris is None ) : ephemeris = solar_system_ephemeris . get ( ) if ( ( ephemeris == u'builtin' ) and ( body . lower ( ) == u'moon' ) ) : return get_body_barycentric ( body , time , ephemeris ) delta_light_travel_time = ( 20.0 * u . s ) emitted_time = time light_travel_time = ( 0.0 * u . s ) earth_loc = get_body_barycentric ( u'earth' , time , ephemeris ) while np . any ( ( np . fabs ( delta_light_travel_time ) > ( 1e-08 * u . s ) ) ) : body_loc = get_body_barycentric ( body , emitted_time , ephemeris ) earth_distance = ( body_loc - earth_loc ) . norm ( ) delta_light_travel_time = ( light_travel_time - ( earth_distance / speed_of_light ) ) light_travel_time = ( earth_distance / speed_of_light ) emitted_time = ( time - light_travel_time ) return get_body_barycentric ( body , emitted_time , ephemeris )
calculate the apparent position of body body relative to earth .