Beispiel #1
0
 def integ(leaf_az, leaf_ze, view_ze, view_az, sun_ze, sun_az):
   view = (view_ze, view_az)
   sun = (sun_ze, sun_az)
   dots = np.array([])
   for la in leaf_az:
     leaf = (leaf_ze, la)
     sun = (sun_ze, sun_az)
     view = (view_ze, view_az)
     dots = np.append(dots, rt.dot(leaf, sun) * rt.dot(leaf, view))
   return dots
Beispiel #2
0
def test_dot():
  '''A function to test the dot product function used to 
  calculate the cosine between 2 spherical angles.
  The dot product is used in the calculation of the
  Big_psi2 function.
  '''
  sun = (180. * np.pi / 180., 45. * np.pi / 180.)
  view = (90. * np.pi / 180., 45. * np.pi / 180.)
  truth = np.cos(np.pi/2)
  val = rt.dot(sun, view)
  #return (val, truth)
  np.testing.assert_almost_equal(val, truth, decimal=6)