[IPython-User] unfold a function in ipython?
Chao YUE
chaoyuejoy@gmail....
Wed Apr 11 06:32:17 CDT 2012
Dear all,
suppose I have a function defined within ipython interactive session:
In [19]: %psource day_length
def day_length(L,J):
#D = daylength
#L = latitude (in degree, north positive and south negative)
#J = day of the year
P = np.arcsin(0.39795*np.cos(0.2163108 +
2*np.arctan(0.9671396*np.tan(0.00860*(J-186)))))
x1=np.sin(0.8333*np.pi/180) + np.sin(L*np.pi/180)*np.sin(P)
x2=np.cos(L*np.pi/180)*np.cos(P)
D = 24 - (24/np.pi)*np.arccos(x1/x2)
return D
Now I want to see explicitly the process of variables when I call the
function with
In [18]: day_length(89.5,180)
Out[18]: nan
Is there some way to do this?
cheers,
Chao
--
***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
************************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20120411/4c489a7f/attachment.html
More information about the IPython-User
mailing list