Oh, yes, maybe, I am using 0.10.1.<br><br>chao<br><br><div class="gmail_quote">2012/4/11 Robert Kern <span dir="ltr"><<a href="mailto:robert.kern@gmail.com">robert.kern@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 4/11/12 3:21 PM, Chao YUE wrote:<br>
> Thanks Robert. Can I ask a further question, I tried, but why I have different<br>
> output with yours?<br>
><br>
> In [65]: def day_length(L,J):<br>
> ....: #D = daylength<br>
> ....: #L = latitude (in degree, north positive and south negative)<br>
> ....: #J = day of the year<br>
> ....:<br>
> ....: P = np.arcsin(0.39795*np.cos(0.2163108 +<br>
> 2*np.arctan(0.9671396*np.tan(0.00860*(J-186)))))<br>
> ....: x1=np.sin(0.8333*np.pi/180) + np.sin(L*np.pi/180)*np.sin(P)<br>
> ....: x2=np.cos(L*np.pi/180)*np.cos(P)<br>
> ....: D = 24 - (24/np.pi)*np.arccos(x1/x2)<br>
> ....: return D<br>
> ....:<br>
><br>
><br>
> In [69]: import pdb<br>
><br>
> In [70]: pdb.runcall(day_length,89.5,180)<br>
> > <ipython console>(6)day_length()<br>
> (Pdb) n<br>
> > <ipython console>(7)day_length()<br>
> (Pdb) n<br>
> > <ipython console>(8)day_length()<br>
> (Pdb) n<br>
> > <ipython console>(9)day_length()<br>
> (Pdb) n<br>
> > <ipython console>(10)day_length()<br>
> (Pdb) n<br>
> --Return--<br>
> > <ipython console>(10)day_length()->nan<br>
> (Pdb) n<br>
> Out[70]: nan<br>
><br>
> I guess I missed something somewhere?<br>
<br>
</div></div>You are using an older version of IPython that did not store the original text<br>
for functions that are defined at the prompt. What version of IPython are you using?<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Robert Kern<br>
<br>
"I have come to believe that the whole world is an enigma, a harmless enigma<br>
that is made terrible by our own mad attempt to interpret it as though it had<br>
an underlying truth."<br>
-- Umberto Eco<br>
<br>
_______________________________________________<br>
IPython-User mailing list<br>
<a href="mailto:IPython-User@scipy.org">IPython-User@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-user" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-user</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div>***********************************************************************************</div>
<div>Chao YUE<br>Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)<br>UMR 1572 CEA-CNRS-UVSQ<br>Batiment 712 - Pe 119<br>91191 GIF Sur YVETTE Cedex</div>
<div>Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16<br></div>
<div>************************************************************************************</div><br>