Commits

Jordan Mirocha  committed a3f5c60

New config file framework implemented...not perfect, but we'll go from here. Need to finish resolving conflicts.

  • Participants
  • Parent commits 50adff2

Comments (0)

Files changed (7)

File html/examples.html

 spec.plotter.refresh()
 
 # Print out spectral line information
-print "Line   Flux (erg/s/cm^2)     Amplitude (erg/s/cm^2)    FWHM (Angstrom)   Luminosity (erg/s)"
+print "Line Flux (erg/s/cm^2) Amplitude (erg/s/cm^2) FWHM (Ang) Luminosity (erg/s)"
 for line in spec.measurements.lines.keys():
     print line, spec.measurements.lines[line]['flux'], spec.measurements.lines[line]['amp'], spec.measurements.lines[line]['fwhm'], \
         spec.measurements.lines[line]['lum']
         
-# Notice that because we supplied the objects redshift and flux normalization, the measurements class
-# automatically calculated line luminosities.  Also, it separates the broad and narrow H-alpha components. How nice!
+# Notice that because we supplied the objects redshift and flux normalization, the measurements class automatically calculated line luminosities.  Also, it separates the broad and narrow H-alpha components, and identifies which lines are which. How nice!
 
 # Save the figure
 spec.plotter.figure.savefig("sdss_fit_example.png")
 
+# Output:
+Line   Flux (erg/s/cm^2)     Amplitude (erg/s/cm^2)    FWHM (Angstrom)   Luminosity (erg/s)
+NIIa 1.59280798105e-15 2.48559532236e-16 6.02005958793 9.38307760327e+39
+NIIb 4.77842394315e-15 7.45678596708e-16 6.02005958793 2.81492328098e+40
+SIIb 1.3266718029e-15 2.07028673062e-16 6.02005958793 7.81529514464e+39
+SIIa 1.41963574357e-15 2.21535803791e-16 6.02005958793 8.36293671851e+39
+H_alpha_B 4.4395950683e-14 5.42064119854e-16 76.9414716216 2.61532247129e+41
+H_alpha_N 4.56987114705e-15 7.13133691068e-16 6.02005958793 2.69206684797e+40
+H_alpha 4.896582183e-14 1.25519781092e-15 11.0611083985 5.76905831218e+41
+
+
             </code>
       <tr><td><center><img align=center width=800 src="images/sdss_fit_example.png" title="Sample Seyfert 1 spectrum (SDSS)"></center></tr></td>
     </table>

File pyspeckit/spectrum/classes.py

         Initialize the Spectrum.  Accepts files in the following formats:
             - .fits
             - .txt
-            - hdf5
+            - .hdf5
 
         Must either pass in a filename or ALL of xarr, data, and header, plus
         optionally error.

File pyspeckit/spectrum/config.py

 
 Notes: Will look in ~/.pyspeckit for file named config.
 
-Sample ~/.spectools/config file:
-
-plot_color = k
-fit_color = green
-comp_color = blue
-plot_lw = 0.5
-fit_lw = 1.0
-comp_lw = 1.0
-
-To do: choose reasonable naming convention for these params.
+To do: Replace contents of confit with python dictionary?
   
 """
 
-import os
+import os, inspect
+from functools import wraps
 
 cfgDefaults = dict(
-    plot_color = 'k',
-    fit_color = 'r',
-    comp_color = 'blue',
-    plot_lw = 0.5,
-    fit_lw = 0.75,
-    comp_lw = 0.75,
+    color = 'k',
+    composite_fit_color = 'r',
+    component_fit_color = 'blue',
+    lw = 0.5,
+    composite_lw = 0.75,
+    component_lw = 0.75,
     show_components = 0,
-    # FITS should be the default; it is the standard for most spectrographs
-    data_format = 'fits', 
     annotate = True,
-    logfile='SpectrumLogger.log',
+    interactive = False,
+    autorefresh = False,
+    silent = True,
+    debug = False
     )
 
 class ConfigParser:
             
                 if thisline[0][0] == '#': continue
                 
-                try: return_dict[thisline[0]] = float(thisline[2])
-                except ValueError: return_dict[thisline[0]] = str(thisline[2])
-    	        
+                if thisline[2] in ['True', 1]: return_dict[thisline[0]] = True
+                elif thisline[2] in ['False', 0]: return_dict[thisline[0]] = False
+                elif thisline[2] == 'None': return_dict[thisline[0]] = None
+                elif thisline[2].isalpha(): return_dict[thisline[0]] = str(thisline[2])
+                else: return_dict[thisline[0]] = float(thisline[2])
+    	            	        
     	    self.cfg = return_dict
     	else: self.cfg = cfgDefaults
-    	
+            	    	
 __fn = os.path.expanduser("~/.pyspeckit/config")
 if os.path.exists(__fn): 
-    spcfg = ConfigParser(__fn)
+    mycfg = ConfigParser(__fn).cfg
 else:
-    spcfg = ConfigParser()
+    mycfg = ConfigParser().cfg
+   
+def ConfigDescriptor(f):    
+                                
+    def decorator(self, *args, **kwargs):    
+        all_args, all_vars, all_keys, all_defs = inspect.getargspec(f)                
+        all_args.pop(0) # pop self
+                                                                                                                       
+        new_kwargs = {}
+        for i, default in enumerate(all_defs):
+            if mycfg.has_key(all_args[i]): new_kwargs[all_args[i]] = mycfg[all_args[i]]
+            else: new_kwargs[all_args[i]] = default
+            
+            # Only update parameter value if it isn't equal to its default...not sure this is absolutely correct
+            if kwargs.has_key(all_args[i]): 
+                if kwargs[all_args[i]] != all_defs[i]:
+                    new_kwargs[all_args[i]] = kwargs[all_args[i]]          
+                                                                                                               
+        f(self, *args, **new_kwargs)
+            
+    return decorator      
+

File pyspeckit/spectrum/fitters.py

 import matplotlib.cbook as mpcb
 import matplotlib.pyplot as pyplot
 import numpy as np
-from config import spcfg
+from config import mycfg
+import inspect
 
 class Registry(object):
     """
 
 class Specfit(object):
 
-    def __init__(self, Spectrum, autoannotate=bool(spcfg.cfg['annotate']), show_components=bool(spcfg.cfg['show_components']),
-            Registry=None):
+    def __init__(self, Spectrum, Registry=None):
         self.model = None
         self.modelpars = None
         self.modelerrs = None
         self.Registry = Registry
         #self.seterrspec()
         
-        # config file stuff
-        self.cfg = spcfg.cfg
-        self.fitcolor = self.cfg['fit_color']
-        self.compcolor = self.cfg['comp_color']
-        self.fitlw = self.cfg['fit_lw']
-        self.complw = self.cfg['comp_lw']
-        self.autoannotate = autoannotate
-        self.show_components = show_components
 
     def __call__(self, interactive=False, usemoments=True, fitcolor=None,
             multifit=False, guesses=None, annotate=None, save=True,
             Right click or 'd': Disconnect the plot and perform the fit.
         """
   
+        # Config file stuff
+        all_args, all_vars, all_keys, all_defs = inspect.getargspec(Specfit)
+        all_defs.reverse()
+        for i, arg in enumerate(all_args.reverse()):
+            try: exec("if {0} == {1}: {0} = {2}".format(arg, all_defs[i], self.cfg[arg]))
+            except KeyError: pass            
+  
         # don't change defaults if fitcolor is not None: self.fitcolor = fitcolor
         # don't change defaults if compcolor is not None: self.compcolor = compcolor
         # don't change defaults if fitlw is not None: self.fitlw = fitlw
         # don't change defaults if complw is not None: self.complw = complw
-        if annotate is not None: self.autoannotate = annotate
+        #if annotate is not None: self.autoannotate = annotate
 
         self.clear()
         self.selectregion(**kwargs)

File pyspeckit/spectrum/measurements.py

         self.speclines = Spectrum.speclines
                 
         # Flux units in case we are interested in line luminosities or just having real flux units
-        if fluxnorm is not None: self.fluxnorm=fluxnorm
+        if fluxnorm is not None: self.fluxnorm = fluxnorm
         else: self.fluxnorm= 1
                 
         # This is where we'll keep our results                        
         self.lines = {}
         
         # Read in observed wavelengths
-        tmp = np.reshape(self.specfit.modelpars, (len(self.specfit.modelpars) / 3, 3))
-        order = np.argsort(zip(*tmp)[1])
-        self.obspos = np.sort(list(zip(*tmp)[1]))
+        tmp1 = np.reshape(self.specfit.modelpars, (len(self.specfit.modelpars) / 3, 3))
+        tmp2 = np.reshape(self.specfit.modelerrs, (len(self.specfit.modelerrs) / 3, 3))
+        order = np.argsort(zip(*tmp1)[1])
+        self.obspos = np.sort(list(zip(*tmp1)[1]))
         self.Nlines = len(self.obspos)
                 
-        # Read in modelpars, re-organize so it is a 2D array sorted by ascending wavelength
-        self.modelpars = np.zeros_like(tmp)
-        for i, element in enumerate(order): self.modelpars[i] = tmp[element]
+        # Read in modelpars and modelerrs, re-organize so they are 2D arrays sorted by ascending wavelength
+        self.modelpars = np.zeros_like(tmp1)
+        self.modelerrs = np.zeros_like(tmp2)
+        for i, element in enumerate(order): 
+            self.modelpars[i] = tmp1[element]
+            self.modelerrs[i] = tmp2[element]
                                                                       
         # Read in appropriate list of reference wavelengths/frequencies/whatever
         self.reflines = self.speclines.optical.optical_lines
         
     def identify(self):
         """
-        Determine identify of lines in self.fitpars.  Fill entries of self.lines dictionary.
+        Determine identity of lines in self.fitpars.  Fill entries of self.lines dictionary.
         
         Note: This method will be infinitely slow for more than 10 or so lines.
         """    
         else: 
             where = 0
             odiff = self.odiff
-            multi = False        
+            multi = False
                     
         condition = (self.refpos >= 0.9 * min(self.obspos)) & (self.refpos <= 1.1 * max(self.obspos))   # Speeds things up
         refpos = self.refpos[condition]
             self.lines[line] = {}
             loc = np.argmin(np.abs(self.obspos - self.refpos[element]))                
             self.lines[line]['modelpars'] = list(self.modelpars[loc])            
+            self.lines[line]['modelerrs'] = list(self.modelerrs[loc])            
                     
         # Track down odd lines
         if len(ALLloc) < self.Nlines:
-            tmp = list(np.ravel(self.modelpars))
+            tmp1 = list(np.ravel(self.modelpars))
+            tmp2 = list(np.ravel(self.modelerrs))
             for key in self.lines.keys():
                 for element in self.lines[key]['modelpars']: 
-                    loc = np.argmin(np.abs(element - tmp))
-                    tmp = np.delete(tmp, loc)
+                    loc = np.argmin(np.abs(element - tmp1))
+                    tmp1 = np.delete(tmp1, loc)
+                    tmp2 = np.delete(tmp2, loc)
                                                         
             try:  
-                for i, x in enumerate(zip(*tmp)[1]):    
+                for i, x in enumerate(zip(*tmp1)[1]):    
                     loc = np.argmin(np.abs(ALLloc - x))
                     line = self.refname[loc]
-                    self.lines[line]['modelpars'].extend(tmp[i:i+3])
+                    self.lines[line]['modelpars'].extend(tmp1[i:i+3])
+                    self.lines[line]['modelerrs'].extend(tmp2[i:i+3])
             except TypeError:
-                loc = np.argmin(np.abs(tmp[1] - self.refpos))                       
+                loc = np.argmin(np.abs(tmp1[1] - self.refpos))                       
                 line = self.refname[loc]
-                self.lines[line]['modelpars'].extend(tmp) 
+                self.lines[line]['modelpars'].extend(tmp1)
+                self.lines[line]['modelerrs'].extend(tmp2) 
                   
         self.separate() 
                     
         """
         
         for key in self.lines.keys():
-            pars = self.lines[key]['modelpars']
-            if len(pars) > 3:
-                pars2d = np.reshape(pars, (len(pars) / 3, 3))
-                sigma = zip(*pars2d)[2]
+            modpars = self.lines[key]['modelpars']
+            moderrs = self.lines[key]['modelerrs']
+            if len(modpars) > 3:
+                modpars2d = np.reshape(modpars, (len(modpars) / 3, 3))
+                moderrs2d = np.reshape(moderrs, (len(moderrs) / 3, 3))
+                sigma = zip(*modpars2d)[2]
                 minsigma = min(sigma)
                 i_narrow = sigma.index(minsigma)
             else: continue
                         
-            for i, arr in enumerate(pars2d):
+            self.lines["{0}_N".format(key)] = {}         
+            self.lines["{0}_N".format(key)]['modelpars'] = []   
+            self.lines["{0}_N".format(key)]['modelerrs'] = []   
+            self.lines["{0}_B".format(key)] = {}            
+            self.lines["{0}_B".format(key)]['modelpars'] = [] 
+            self.lines["{0}_B".format(key)]['modelerrs'] = [] 
+                        
+            for i, arr in enumerate(modpars2d):
                 if i == i_narrow: 
-                    self.lines["{0}_N".format(key)] = {}
                     self.lines["{0}_N".format(key)]['modelpars'] = arr
+                    self.lines["{0}_N".format(key)]['modelerrs'] = moderrs2d[i]
                 else: 
-                    self.lines["{0}_B".format(key)] = {}
-                    self.lines["{0}_B".format(key)]['modelpars'] = arr
+                    self.lines["{0}_B".format(key)]['modelpars'].extend(arr)
+                    self.lines["{0}_B".format(key)]['modelerrs'].extend(moderrs2d[i])
                     
     def compute_flux(self, pars):                                                                       
         """                                                                                                
             xhmax1 = self.bisection(f, start)
             xhmax2 = self.bisection(f, start + (start - xhmax1))
                                         
-            return abs(xhmax2 - xhmax1)
+            return abs(xhmax2 - xhmax1)      
             
     def bisection(self, f, x_guess):
         """

File tests/sample_sdss.txt

 7996.314 -1.980 1.580 67.714
 7998.154 -2.038 1.563 67.388
 7999.997 0.616 1.583 65.228
-8001.840 1.596 1.609 65.807
-8003.682 0.555 1.619 65.247
-8005.526 2.209 1.670 64.803
-8007.369 2.443 1.891 66.927
-8009.212 1.913 2.169 66.899
-8011.058 2.286 2.032 66.619
-8012.902 4.120 1.758 65.551
-8014.747 -0.854 1.748 68.554
-8016.592 5.140 1.871 66.489
-8018.439 -0.124 1.793 66.309
-8020.285 -1.241 1.654 66.850
-8022.132 -1.521 1.595 67.599
-8023.979 -2.135 1.600 67.794
-8025.827 -0.373 1.645 67.379
-8027.675 0.936 1.695 66.280
-8029.524 -1.542 1.668 66.616
-8031.373 -1.685 1.619 67.884
-8033.224 -0.197 1.595 66.599
-8035.073 -1.042 1.598 67.159
-8036.923 -3.272 1.580 67.634
-8038.774 -0.701 1.639 68.583
-8040.625 2.322 1.638 66.719
-8042.477 0.016 1.647 67.901
-8044.329 1.968 1.715 68.039
-8046.182 0.079 1.724 67.689
-8048.035 -0.357 1.647 66.470
-8049.888 -0.981 1.597 66.501
-8051.742 -3.942 1.555 67.493
-8053.595 0.835 1.614 66.814
-8055.450 -4.675 1.570 68.054
-8057.306 0.869 1.644 69.150
-8059.161 -1.006 1.756 68.334
-8061.018 -0.177 2.087 69.092
-8062.873 -3.723 2.045 68.849
-8064.730 0.288 1.769 67.116
-8066.587 2.227 1.632 65.463
-8068.444 1.620 1.626 66.841
-8070.303 -2.377 1.601 69.133
-8072.161 -4.665 1.571 69.500
-8074.020 -0.987 1.621 67.011
-8075.879 2.737 1.747 65.694
-8077.738 -0.572 1.771 67.313
-8079.600 -2.375 1.660 67.201
-8081.460 -0.490 1.625 67.555
-8083.321 -1.286 1.610 66.808
-8085.183 -2.398 1.658 69.408
-8087.044 -0.975 1.672 68.559
-8088.907 1.778 1.792 66.148
-8090.770 1.792 2.161 66.340
-8092.633 4.425 2.289 67.275
-8094.497 -3.184 1.740 66.116
-8096.360 -0.984 1.616 67.775
-8098.225 -2.588 1.592 66.133
-8100.089 2.247 1.624 64.414
-8101.954 0.586 1.620 65.645
-8103.821 1.311 1.625 65.380
-8105.687 -1.388 1.616 66.892
-8107.553 2.049 1.633 64.531
-8109.420 0.127 1.636 64.761
-8111.288 1.710 1.759 66.241
-8113.156 0.721 1.802 67.866
-8115.024 -0.401 1.715 67.909
-8116.892 -0.564 1.631 66.958
-8118.762 1.737 1.639 65.456
-8120.632 3.199 1.627 63.083
-8122.502 -0.535 1.743 65.744
-8124.373 0.050 2.080 66.585
-8126.243 3.584 2.178 66.358
-8128.115 0.802 1.850 67.359
-8129.987 1.642 1.702 67.517
-8131.858 1.976 1.660 66.386
-8133.731 3.853 1.661 64.520
-8135.604 2.794 1.653 65.154
-8137.478 -1.359 1.616 66.745
-8139.353 0.697 1.664 67.612
-8141.227 1.412 1.663 66.485
-8143.102 3.202 1.685 66.875
-8144.976 2.466 1.682 66.880
-8146.852 2.222 1.672 67.329
-8148.728 1.412 1.641 65.187
-8150.604 2.997 1.702 64.256
-8152.481 0.286 1.759 66.388
-8154.359 3.185 1.749 65.723
-8156.236 -0.035 1.686 66.973
-8158.115 3.076 1.690 66.126
-8159.994 1.911 1.745 67.558
-8161.873 3.380 1.876 66.458
-8163.753 4.204 1.947 65.287
-8165.633 0.839 1.812 68.014
-8167.512 -1.444 1.693 68.273
-8169.393 0.011 1.698 69.003
-8171.275 1.243 1.662 65.779
-8173.157 2.899 1.682 65.904
-8175.039 -0.488 1.665 68.260
-8176.921 1.315 1.696 67.899
-8178.804 0.914 1.687 68.059
-8180.687 1.839 1.733 68.961
-8182.572 -0.329 1.708 68.636
-8184.456 1.044 1.720 68.121
-8186.341 1.166 1.681 65.834
-8188.226 2.993 1.683 64.215
-8190.113 1.363 1.683 65.505
-8191.997 2.690 1.703 65.636
-8193.884 0.953 1.729 66.162
-8195.770 1.333 1.716 66.026
-8197.658 -1.388 1.647 65.013
-8199.547 -0.073 1.628 65.562
-8201.435 -1.490 1.644 66.345
-8203.322 3.407 1.750 65.676
-8205.211 1.750 1.790 65.244
-8207.102 3.145 1.761 63.792
-8208.991 2.140 1.712 64.884
-8210.883 2.170 1.683 63.962
-8212.772 -2.051 1.683 67.610
-8214.664 3.653 1.685 63.248
-8216.556 -4.972 1.668 69.820
-8218.448 33.198 1.683 33.222
-8220.342 68.460 1.674 -2.482
-8222.234 71.344 1.712 -2.449
-8224.127 68.432 1.687 -2.466
-8226.021 68.186 1.685 -2.411
-8227.915 69.916 1.713 -2.386
-8229.811 72.875 1.772 -2.422
-8231.706 71.715 1.760 -2.434
-8233.601 71.206 1.740 -2.418
-8235.497 69.599 1.712 -2.381
-8237.394 70.172 1.694 -2.486
-8239.290 68.653 1.678 -2.527
-8241.187 69.803 1.718 -2.528
-8243.086 73.056 1.760 -2.594
-8244.983 69.110 1.723 -2.412
-8246.883 67.843 1.692 -2.490
-8248.782 71.054 1.743 -2.607
-8250.682 68.732 1.760 -2.646
-8252.582 74.369 1.839 -2.634
-8254.481 68.952 1.741 -2.557
-8256.383 71.364 1.738 -2.448
-8258.284 68.579 1.723 -2.457
-8260.186 69.957 1.730 -2.428
-8262.089 68.713 1.738 -2.453
-8263.990 70.124 1.773 -2.531
-8265.894 69.384 1.811 -2.517
-8267.797 69.970 1.856 -2.556
-8269.701 71.928 1.947 -2.533
-8271.605 70.097 1.968 -2.583
-8273.511 68.482 1.997 -2.490
-8275.415 69.505 2.102 -2.365
-8277.321 72.632 2.207 -2.403
-8279.228 68.364 2.303 -2.475
-8281.134 69.041 2.345 -2.322
-8283.042 69.411 2.310 -2.441
-8284.949 67.238 2.259 -2.514
-8286.856 68.056 2.245 -2.423
-8288.765 66.582 2.135 -2.398
-8290.674 68.183 2.058 -2.424
-8292.583 72.481 2.078 -2.399
-8294.492 69.170 1.920 -2.398
-8296.402 66.545 1.777 -2.353
-8298.313 70.863 1.845 -2.380
-8300.224 68.592 1.961 -2.548
-8302.136 70.080 2.088 -2.512
-8304.046 66.156 2.131 -2.298
-8305.959 67.418 2.119 -2.289
-8307.872 65.472 2.139 -2.349
-8309.785 67.248 2.219 -2.370
-8311.699 67.471 2.265 -2.413
-8313.613 66.009 2.239 -2.394
-8315.526 68.464 2.208 -2.371
-8317.442 69.043 2.307 -2.349
-8319.357 70.810 2.151 -2.303
-8321.273 68.318 2.151 -2.270
-8323.189 71.662 2.080 -2.301
-8325.106 67.461 1.976 -2.254
-8327.023 70.775 2.089 -2.446
-8328.941 65.938 1.996 -2.397
-8330.859 65.934 1.891 -2.348
-8332.778 66.322 1.916 -2.363
-8334.697 69.578 1.901 -2.263
-8336.616 68.392 1.857 -2.302
-8338.536 65.204 1.812 -2.391
-8340.456 66.655 1.773 -2.384
-8342.377 67.799 1.797 -2.299
-8344.298 65.301 1.763 -2.207
-8346.219 66.648 1.744 -2.205
-8348.141 64.449 1.734 -2.449
-8350.063 65.190 1.746 -2.434
-8351.987 66.893 1.763 -2.233
-8353.910 63.710 1.744 -2.324
-8355.835 69.249 1.824 -2.465
-8357.759 69.166 1.816 -2.321
-8359.684 67.503 1.780 -2.233
-8361.608 69.263 1.790 -2.315
-8363.533 66.643 1.768 -2.255
-8365.459 71.227 1.826 -2.209
-8367.386 67.657 1.786 -2.259
-8369.313 69.380 1.789 -2.310
-8371.240 68.396 1.762 -2.281
-8373.167 66.858 1.753 -2.244
-8375.097 69.533 1.785 -2.310
-8377.025 68.390 1.761 -2.326
-8378.954 70.455 1.791 -2.319
-8380.885 68.051 1.757 -2.407
-8382.814 67.727 1.753 -2.385
-8384.744 69.051 1.777 -2.412
-8386.675 68.755 1.781 -2.254
-8388.607 63.614 1.719 -2.270
-8390.539 64.690 1.722 -2.383
-8392.470 65.354 1.746 -2.323
-8394.402 67.502 1.757 -2.354
-8396.337 67.059 1.774 -2.444
-8398.270 68.944 1.800 -2.293
-8400.203 66.738 1.763 -2.332
-8402.138 71.138 1.810 -2.479
-8404.073 68.834 1.805 -2.376
-8406.009 68.135 1.921 -2.200
-8407.944 69.111 2.113 -2.249
-8409.881 70.820 2.209 -2.241
-8411.817 66.514 2.063 -2.222
-8413.755 71.282 2.223 -2.254
-8415.691 71.306 2.311 -2.265
-8417.630 66.715 2.028 -2.249
-8419.568 68.212 1.854 -2.244
-8421.506 69.847 1.933 -2.244
-8423.446 70.306 2.274 -2.294
-8425.386 66.075 2.592 -2.354
-8427.327 68.586 2.246 -2.332
-8429.267 63.358 1.818 -2.214
-8431.208 67.548 1.805 -2.228
-8433.149 68.421 1.811 -2.271
-8435.092 67.221 1.845 -2.217
-8437.034 66.703 1.951 -2.160
-8438.978 69.032 1.995 -2.223
-8440.920 65.601 1.824 -2.249
-8442.864 68.665 1.796 -2.237
-8444.809 67.441 1.779 -2.086
-8446.754 65.972 1.747 -2.120
-8448.699 64.607 1.744 -2.282
-8450.645 68.018 1.776 -2.321
-8452.590 69.162 1.805 -2.196
-8454.537 66.251 1.798 -2.440
-8456.483 66.629 1.826 -2.400
-8458.432 69.495 1.841 -2.304
-8460.380 69.685 1.822 -2.396
-8462.327 69.645 1.816 -2.447
-8464.276 69.456 1.806 -2.256
-8466.225 68.885 1.805 -2.313
-8468.175 69.376 1.867 -2.400
-8470.125 66.482 2.363 -2.379
-8472.075 72.933 3.182 -2.298
-8474.026 65.188 2.763 -2.192
-8475.979 67.901 2.145 -2.347
-8477.930 69.075 2.019 -2.351
-8479.883 70.385 2.153 -2.333
-8481.836 68.164 2.262 -2.311
-8483.789 67.454 2.035 -2.291
-8485.742 70.021 1.857 -2.332
-8487.696 72.568 1.857 -2.413
-8489.651 66.415 1.822 -2.350
-8491.604 67.975 1.889 -2.326
-8493.561 69.223 2.001 -2.280
-8495.517 69.351 1.961 -2.197
-8497.474 62.864 1.774 -2.195
-8499.431 62.633 1.724 -2.091
-8501.388 59.921 1.686 -2.197
-8503.345 61.306 1.709 -2.192
-8505.304 61.330 1.749 -2.204
-8507.263 63.330 1.815 -2.329
-8509.223 66.557 2.029 -2.399
-8511.181 63.087 2.257 -2.157
-8513.141 65.776 2.110 -2.203
-8515.101 67.832 1.853 -2.257
-8517.062 67.755 1.823 -2.262
-8519.022 65.299 1.768 -2.279
-8520.986 66.688 1.758 -2.273
-8522.948 64.734 1.745 -2.333
-8524.909 66.210 1.830 -2.335
-8526.874 66.128 2.215 -2.256
-8528.837 70.827 2.568 -2.318
-8530.801 61.935 2.244 -2.418
-8532.766 65.811 1.860 -2.347
-8534.730 64.221 1.752 -2.232
-8536.695 64.194 1.737 -2.261
-8538.662 62.061 1.732 -2.091
-8540.629 56.459 1.636 -1.901
-8542.595 55.229 1.687 -1.867
-8544.562 52.359 2.032 -1.930
-8546.529 52.590 2.098 -2.074
-8548.499 52.554 1.774 -2.166
-8550.467 56.212 1.674 -2.275
-8552.436 62.028 1.735 -2.303
-8554.405 62.085 1.746 -2.249
-8556.375 62.078 1.778 -2.237
-8558.345 66.374 2.018 -2.344
-8560.316 66.560 2.749 -2.364
-8562.288 65.878 2.841 -2.290
-8564.260 64.677 1.998 -2.252
-8566.231 64.649 1.785 -2.270
-8568.205 68.618 1.842 -2.313
-8570.178 66.247 1.837 -2.308
-8572.151 67.825 1.838 -2.365
-8574.125 64.785 1.790 -2.316
-8576.100 66.173 1.802 -2.256
-8578.074 65.079 1.807 -2.299
-8580.050 68.656 1.851 -2.368
-8582.025 66.585 1.931 -2.294
-8584.003 65.143 2.124 -2.207
-8585.979 62.215 2.017 -2.192
-8587.955 63.314 1.817 -2.224
-8589.934 68.047 1.840 -2.241
-8591.912 65.291 1.817 -2.172
-8593.892 64.606 1.895 -2.155
-8595.870 68.050 2.318 -2.036
-8597.850 80.454 3.231 -2.057
-8599.829 65.501 2.660 -2.042
-8601.810 64.402 2.051 -2.018
-8603.790 62.496 1.911 -2.125
-8605.771 67.541 1.911 -2.257
-8607.753 64.899 1.807 -2.132
-8609.735 63.229 1.792 -2.193
-8611.719 62.225 1.859 -2.256
-8613.701 64.795 1.857 -2.207
-8615.686 67.083 1.871 -2.212
-8617.669 67.809 1.903 -2.329
-8619.653 69.203 1.993 -2.319
-8621.638 67.847 1.928 -2.328
-8623.624 69.318 1.984 -2.377
-8625.609 67.912 2.256 -2.372
-8627.596 65.167 2.431 -2.330
-8629.584 65.907 2.270 -2.350
-8631.571 68.473 2.088 -2.300
-8633.558 67.131 1.911 -2.320
-8635.546 65.289 1.860 -2.287
-8637.534 66.219 2.240 -2.240
-8639.523 68.943 2.892 -2.324
-8641.514 68.639 2.656 -2.273
-8643.504 65.691 2.087 -2.279
-8645.495 65.405 1.934 -2.185
-8647.484 64.923 1.879 -2.181
-8649.477 64.356 1.852 -2.267
-8651.468 64.900 1.864 -2.258
-8653.461 64.546 1.912 -2.115
-8655.452 65.293 1.946 -2.137
-8657.447 65.120 1.859 -2.154
-8659.440 62.171 1.836 -1.907
-8661.435 60.885 1.862 -1.709
-8663.430 58.236 1.842 -1.833
-8665.425 53.943 1.745 -1.811
-8667.420 53.494 1.983 -1.930
-8669.416 55.536 2.024 -1.959
-8671.412 58.569 2.091 -1.955
-8673.409 65.266 1.968 -2.036
-8675.405 64.092 1.997 -2.139
-8677.404 64.831 1.905 -2.150
-8679.401 66.152 1.904 -2.118
-8681.401 65.149 1.880 -2.083
-8683.401 67.564 1.991 -2.122
-8685.400 67.857 2.164 -2.195
-8687.399 69.021 2.120 -2.197
-8689.401 64.494 1.963 -2.077
-8691.401 66.030 1.920 -2.274
-8693.403 64.459 1.904 -2.221
-8695.405 67.111 2.194 -2.197
-8697.408 63.838 2.155 -2.264
-8699.410 67.057 2.237 -2.207
-8701.414 68.525 2.257 -2.386
-8703.418 71.770 2.334 -2.396
-8705.422 68.899 2.398 -2.225
-8707.427 69.140 2.130 -2.195
-8709.431 69.188 2.042 -2.246
-8711.438 64.869 1.915 -2.189
-8713.443 64.543 1.957 -2.158
-8715.450 66.357 2.071 -2.169
-8717.457 67.249 1.994 -2.208
-8719.465 62.942 1.890 -2.183
-8721.472 66.410 1.994 -2.154
-8723.481 65.907 1.983 -2.232
-8725.489 66.534 2.015 -2.177
-8727.499 66.463 2.105 -2.220
-8729.510 69.589 2.085 -2.206
-8731.520 66.887 1.998 -2.120
-8733.529 65.779 2.080 -2.072
-8735.541 66.920 2.188 -2.103
-8737.553 68.354 2.170 -2.013
-8739.564 67.003 2.091 -2.117
-8741.577 71.066 2.096 -1.979
-8743.591 69.481 2.014 -1.878
-8745.604 64.667 1.889 -1.900
-8747.618 68.299 1.950 -1.807
-8749.633 66.346 1.969 -1.684
-8751.646 68.903 2.106 -1.678
-8753.663 66.849 2.062 -1.708
-8755.679 66.847 1.983 -1.894
-8757.696 66.023 1.956 -2.042
-8759.712 69.311 2.034 -1.970
-8761.729 67.266 2.069 -2.020
-8763.747 63.657 2.096 -2.253
-8765.765 66.524 2.077 -2.221
-8767.784 64.935 2.123 -2.065
-8769.803 63.861 2.146 -2.062
-8771.822 68.202 2.054 -2.220
-8773.842 66.588 1.989 -2.165
-8775.862 63.062 1.959 -2.242
-8777.884 66.211 2.003 -2.231
-8779.905 65.903 1.973 -2.158
-8781.927 65.163 2.004 -2.117
-8783.950 67.398 2.210 -2.085
-8785.972 66.596 2.349 -2.049
-8787.996 75.498 2.457 -2.186
-8790.019 74.992 2.335 -2.151
-8792.044 66.885 2.238 -2.135
-8794.067 69.631 2.213 -2.212
-8796.093 71.434 2.174 -2.206
-8798.119 69.479 2.133 -2.206
-8800.145 68.484 2.130 -2.180
-8802.171 66.006 2.084 -2.112
-8804.199 66.999 2.153 -2.065
-8806.227 64.384 2.196 -2.049
-8808.254 67.699 2.180 -2.027
-8810.282 69.629 2.109 -2.142
-8812.311 65.278 2.026 -2.179
-8814.341 68.522 2.081 -2.146
-8816.370 68.531 0.000 -2.154
-8818.400 68.599 0.000 -2.221
-8820.432 68.676 0.000 -2.297
-8822.463 68.701 0.000 -2.322
-8824.494 68.499 0.000 -2.119
-8826.526 68.654 0.000 -2.274
-8828.559 68.638 0.000 -2.257
-8830.593 68.573 0.000 -2.191
-8832.626 68.809 0.000 -2.427
-8834.659 68.334 0.000 -1.951
-8836.695 68.392 0.000 -2.008
-8838.729 68.493 0.000 -2.108
-8840.765 68.363 0.000 -1.978
-8842.800 68.262 0.000 -1.876
-8844.837 68.259 0.000 -1.873
-8846.874 68.334 0.000 -1.947
-8848.911 68.234 0.000 -1.847

File tests/test_sdss.py

         spec.measurements.lines[line]['lum']
         
 # Notice that because we supplied the objects redshift and flux normalization, the measurements class
-# automatically calculated line luminosities.  Also, it separates the broad and narrow H-alpha components. How nice!
+# automatically calculated line luminosities.  Also, it separates the broad and narrow H-alpha components, and identifies which lines are which. How nice!
+
+raw_input("Done.")
 
 # Save the figure
 spec.plotter.figure.savefig("sdss_fit_example.png")
-
-raw_input('Done.')