def get_sun(time):
 (earth_pv_helio, earth_pv_bary) = erfa.epv00(*get_jd12(time, u'tdb'))
 earth_p = earth_pv_helio[..., 0, :]
 earth_v = earth_pv_bary[..., 1, :]
 earth_v /= c.to((u.au / u.d)).value
 dsun = np.sqrt(np.sum((earth_p ** 2), axis=(-1)))
 invlorentz = ((1 - np.sum((earth_v ** 2), axis=(-1))) ** 0.5)
 properdir = erfa.ab((earth_p / dsun.reshape((dsun.shape + (1,)))), (- earth_v), dsun, invlorentz)
 cartrep = CartesianRepresentation(x=(((- dsun) * properdir[..., 0]) * u.AU), y=(((- dsun) * properdir[..., 1]) * u.AU), z=(((- dsun) * properdir[..., 2]) * u.AU))
 return SkyCoord(cartrep, frame=GCRS(obstime=time))

def get_sun ( time ) : ( earth_pv_helio , earth_pv_bary ) = erfa . epv00 ( * get_jd12 ( time , u'tdb' ) ) earth_p = earth_pv_helio [ ... , 0 , : ] earth_v = earth_pv_bary [ ... , 1 , : ] earth_v /= c . to ( ( u . au / u . d ) ) . value dsun = np . sqrt ( np . sum ( ( earth_p ** 2 ) , axis = ( - 1 ) ) ) invlorentz = ( ( 1 - np . sum ( ( earth_v ** 2 ) , axis = ( - 1 ) ) ) ** 0.5 ) properdir = erfa . ab ( ( earth_p / dsun . reshape ( ( dsun . shape + ( 1 , ) ) ) ) , ( - earth_v ) , dsun , invlorentz ) cartrep = CartesianRepresentation ( x = ( ( ( - dsun ) * properdir [ ... , 0 ] ) * u . AU ) , y = ( ( ( - dsun ) * properdir [ ... , 1 ] ) * u . AU ) , z = ( ( ( - dsun ) * properdir [ ... , 2 ] ) * u . AU ) ) return SkyCoord ( cartrep , frame = GCRS ( obstime = time ) )
determines the location of the sun at a given time .