Example #1
0
def _convert_spectra(self, outunit, **kwargs):
    '''Handles requests to change spectral axis unit, and hence values.  Ensures that transformations involving unit=None
    are handles properly, and that only valid units are passed to the actual converting function, "spectral_convert".'''  
  
    outunit=_unit_valid(outunit)  
  
    ###If converting to None, don't change the index values
    if outunit==None or self.unit==None:    
        self.unit=outunit
        self.name=get_category(self.unit)
        return self
    
    else:
        out=spectral_convert(self, self.unit, outunit)
        return SpecIndex(out, unit=outunit, name=get_category(outunit)) #_kind automatically assigned by SpecIndex
Example #2
0
  

    #plt.title('9/5/12 NPSam')
    #plt.show()
              
    #spec_surface3d(df, kind='contourf', xlabel='Time (s)', ylabel='Wavelength (nm)')
    #spec_surface3d(df)



    #mlab.surf(np.asarray(list(df.columns)), np.asarray(list(df.index)) , np.asarray(df), warp_scale='auto')
    spec_poly3d(df)
    plt.show()

    #transfer_attr(df, df2)     
    #specax=specplot(df2)

    #dftime=df.transpose()  ### Store a custom axis.
    #dftime.runname='Spec test name'
    #timeax=timeplot(dftime)
    #fig = plt.figure()
    #fig.axes.append(timeax)

    hz=spectral_convert(df.index)
    print 'hi'
    #df=df.transpose()
    #plt.figure()
    #df.plot()
    #plt.leged=False
    #plt.show()