print , . separation(), , :
def separation(seconds, lat, lon):
print seconds
...
, Nelder-Mead , 500 , :
[ 10000.]
[ 10500.]
[ 11000.]
[ 11500.]
[ 12500.]
...
, , 500- , . 500 , 500 , 500 . , Nelder-Mead, , , .
:
[ 10000.]
[ 10000.00000001]
[ 10000.]
. 1--8 , , , - .
, : (a) (b) , , , - , . - :
out_s_def = minimize(separation, sec_init, args=(32.5, 215.1),
tol=1e-3, options={'eps': 500})
- , , , - : , .
, , 64- , , . : " ", , , , , , !
, . :
float(), . print : , float, NumPy:
(array([ 10000.]), 32.5, 215.1)
: , Skyfield separation_from(), , :
sepa = mpos.separation_from(spos)
return sepa.degrees
, Skyfield , 1.0.
- ( , , topos , ):
ts = load.timescale()
...
def separation(tt_jd, lat, lon):
place = earth.topos(lat, lon)
t = ts.tt(jd=tt_jd)
mpos = place.at(t).observe(moon).apparent()
spos = place.at(t).observe(sun).apparent()
return mpos.separation_from(spos).degrees
...
sec_init = 10000.0
jd_init = ts.utc(2016, 3, 9, 0, 0, sec_init).tt
out_s_def = minimize(separation, jd_init, args=(32.5, 215.1))
, - , ? - , :
print ts.tt(jd=out_s_def.x).utc_jpl()
['A.D. 2016-Mar-09 03:37:33.8224 UT']
, Skyfield - , PyEphem , SciPy PyEphem C. , , - , : , .
Perhaps I should explore the possibility of creating Time objects from their two floating point objects, so that I can imagine a few more seconds. I think AstroPy did this, and this is traditionally in astronomy programming.