original_docstring: Convert a spectrum to an xyz point.
  
          The spectrum must be on the same grid of points as the colour-matching
          function, self.cmf: 380-780 nm in 5 nm steps.
  
          
docstring: Convert a spectrum to an xyz point.
  The spectrum must be on the same grid of points as the colour-matching
  function, self.cmf: 380-780 nm in 5 nm steps.
docstring_tokens: Convert a spectrum to an xyz point . The spectrum must be on the same grid of points as the colour - matching function self . cmf : 380 - 780 nm in 5 nm steps .
code: def spec_to_xyz(self, spec):
          """Convert a spectrum to an xyz point.
  
          The spectrum must be on the same grid of points as the colour-matching
          function, self.cmf: 380-780 nm in 5 nm steps.
  
          """
  
          XYZ = np.sum(spec[:, np.newaxis] * self.cmf, axis=0)
          den = np.sum(XYZ)
          if den == 0.:
              return XYZ
          return XYZ / den
code_tokens: def spec_to_xyz ( self , spec ) : XYZ = np . sum ( spec [ : , np . newaxis ] * self . cmf , axis = 0 ) den = np . sum ( XYZ ) if den == 0. : return XYZ return XYZ / den
short_docstring: Convert a spectrum to an xyz point.
short_docstring_tokens: Convert a spectrum to an xyz point .
comment: """Convert a spectrum to an xyz point.
  
          The spectrum must be on the same grid of points as the colour-matching
          function, self.cmf: 380-780 nm in 5 nm steps.
  
          """