title: Normalizing values in a curve_fit of Plancks Law from data set *Edit*
body: <p>I have a large set of data that in terms of Intensity counts and Wavelength that I want fit with Planks Law to determine the guess parameter for Temperature.</p>
  
  <p>The Data set is imported as a text file</p>
  
  <pre><code>import numpy as np
  import scipy as sp
  from scipy.optimize import curve_fit
  
  with open('Good_SolarRun2.txt') as g:
      data = g.read()
  data = data.split('\n')
  Wavle2 = [float(row.split()[0]) for row in data]   # Wavelength (nm)
  Int2 = [float(row.split()[1]) for row in data]  # Intensity (counts)
  </code></pre>
  
  <p>So I now define the fitting model for Planks Law (In terms of wavelength)
  <a href="https://en.wikipedia.org/wiki/Planck%27s_law" rel="nofollow">https://en.wikipedia.org/wiki/Planck%27s_law</a></p>
  
  <p>--- As recommend by user Evert, I set the constants to equal 1 since the optimization for small numbers on a computer is difficult.</p>
  
  <pre><code>from scipy.constants import h,k,c
  
  def Plancks_Law(lamb, T):
      return 1/np.power(lamb,5.0) * 1/( np.exp( 1/(lamb*T)) - 1 )
  </code></pre>
  
  <p>So now, I go about setting up the curve_fit configuration with my data set.</p>
  
  <pre><code>x = Wavle2
  
  # This has the same shape as Wavle2, but these values are scaled by me.
  # Also the same shape as Int2
  y = np.array(Intscale2P)
  
  p0_R = (500.) 
  optR, pcovR = curve_fit(Plancks_Law, x, y, p0_R)
  T_R = optR
  T_Rp = pcovR
  yM = Plancks_Law(x, T_R)
  </code></pre>
  
  <p><code>print T_R</code> returns the value of <code>542.04628177</code></p>
  
  <p>Which is some unknown units. I'm now stumped on how to convert everything to it correct units. Especially the values in the exponent to the correct units.</p>
  
  <p>Any way on correcting this?</p>