Esempio n. 1
0
 def readegy(self, fegy=''):
     ''' 
     Read in the .egy file and convert the energies to MHz. Also read in the .cat
     file.
     '''
     if (len(fegy) < 1):
         fegy = self.fegy
     self.fegy = fegy
     c = 299792458.  # speed of light in m/s
     ceq = spfit.spfitPrediction(fname=fegy)
     ceq.read_egy()
     ceq.read_cat()
     self.egy_mhz = ceq.egy_content['egy'] * c * 100. / 1.e6
     self.egy_qn = ceq.egy_content['qn']
     self.cat_qn = ceq.cat_content['qn']
     self.cat_mhz = ceq.cat_content['freq']
     self.cat_logint = ceq.cat_content['lgint']
Esempio n. 2
0
 def readegy(self,fegy=''):
     ''' 
     Read in the .egy file and convert the energies to MHz. Also read in the .cat
     file.
     '''
     if (len(fegy)<1):
         fegy=self.fegy
     self.fegy = fegy
     c = 299792458. 		# speed of light in m/s
     ceq = spfit.spfitPrediction(fname = fegy)
     ceq.read_egy()
     ceq.read_cat()
     self.egy_mhz = ceq.egy_content['egy']*c*100./1.e6
     self.egy_qn = ceq.egy_content['qn']
     self.cat_qn = ceq.cat_content['qn']
     self.cat_mhz = ceq.cat_content['freq']
     self.cat_logint = ceq.cat_content['lgint']
Esempio n. 3
0
    def import_from_spfit(self, fname='test', src='lin'):
        '''
        
        Parameters
        ----------
        fname (str):
        src (str): 
                
        Returns
        -------
        none
        
        Notes
        -----
        none

        '''
        f = open(fname + '.xi', 'w')
        a = spfit.spfitPrediction(fname=fname)
        if src == 'lin':
            a.read_lin()
            a.make_linel_lin()
            qn = a.meas_spec['qn']
            freq = a.meas_spec['linelist']
        if src == 'cat':
            a.read_cat()
            a.make_linel_cat()
            qn = a.pred_spec['qn']
            freq = a.pred_spec['linelist']
        filestr = ''
        i = 0
        for x in qn:
            filestr += (strg.rjust(str(x[0]), 2) + strg.rjust(str(x[1]), 3) +
                        strg.rjust(str(x[2]), 3) + '  ')
            filestr += (strg.rjust(str(x[3]), 3) + strg.rjust(str(x[4]), 3) +
                        strg.rjust(str(x[5]), 3))
            filestr += ('  S 1 =  ' + '{0:1.8f}'.format(freq[i][0] / 1000.) +
                        ' Err 2.0E-6 \n')
            i += 1

        f.write(filestr)
        f.close()
Esempio n. 4
0
    def import_from_spfit(self, fname='test', src='lin'):
        '''
        
        Parameters
        ----------
        fname (str):
        src (str): 
                
        Returns
        -------
        none
        
        Notes
        -----
        none

        '''
        f = open(fname+'.xi', 'w')
        a = spfit.spfitPrediction(fname=fname)
        if src == 'lin':
            a.read_lin()
            a.make_linel_lin()
            qn = a.meas_spec['qn']
            freq = a.meas_spec['linelist']
        if src == 'cat':
            a.read_cat()
            a.make_linel_cat()
            qn = a.pred_spec['qn']
            freq = a.pred_spec['linelist']
        filestr = ''
        i = 0
        for x in qn:
            filestr += (strg.rjust(str(x[0]), 2) + strg.rjust(str(x[1]), 3) + strg.rjust(str(x[2]), 3) + '  ')
            filestr += (strg.rjust(str(x[3]), 3) + strg.rjust(str(x[4]), 3) + strg.rjust(str(x[5]), 3))
            filestr += ('  S 1 =  ' + '{0:1.8f}'.format(freq[i][0]/1000.) + ' Err 2.0E-6 \n')
            i += 1
        
        f.write(filestr)
        f.close()