Example #1
0
    def __init__(self,parent,page,ii,lims):

        #determine which page is being accessed
        key_idx = ii+6*parent.page
            
        #define variables for readability
        vel = parent.ions[parent.keys[key_idx]]['vel']
        wave = parent.ions[parent.keys[key_idx]]['wave']
        error = parent.ions[parent.keys[key_idx]]['error']
        flux = parent.ions[parent.keys[key_idx]]['flux']
        name = parent.ions[parent.keys[key_idx]]['name']
        zabs = parent.ions[parent.keys[key_idx]]['z']
        f0 = parent.ions[parent.keys[key_idx]]['f']
        lam_0 = parent.ions[parent.keys[key_idx]]['lam_0']
        cont = parent.ions[parent.keys[key_idx]]['cont']

        #compute EW/N/med_vel
        output = compute_EW.compute_EW(wave,flux/cont,lam_0,lims,error/cont,plot=False,zabs=zabs,f0=f0)
        #save variables in ion's respective dictionary
        parent.ions[parent.keys[key_idx]]['N'] = output['col']
        parent.ions[parent.keys[key_idx]]['Nsig'] = output['colerr']
        parent.ions[parent.keys[key_idx]]['EW'] = output['ew_tot']*1000
        parent.ions[parent.keys[key_idx]]['EWsig'] = output['err_ew_tot']*1000
        parent.ions[parent.keys[key_idx]]['med_vel'] = output['med_vel']
        parent.ions[parent.keys[key_idx]]['EWlims'] = lims
        
        #plot EW on page
        Plotting(parent,ii,modify=False,Print=True)
Example #2
0
    def compute_EW(self, lam_cen, vmin=-50., vmax=50., method='closest'):
        """
        Computes rest frame equivalent width and column density for a desired atomic line.
        Around the species lam_cen and given vmin and vmax keyword values. 

        """

        from IGM import rb_setline as s
        str = s.rb_setline(lam_cen, method, linelist=self.linelist)

        from IGM import compute_EW as EW
        out = EW.compute_EW(self.wave_slice,
                            self.fnorm,
                            str['wave'], [vmin, vmax],
                            self.enorm,
                            f0=str['fval'],
                            zabs=0.)

        self.trans = str['name']
        self.fval = str['fval']
        self.trans_wave = str['wave']
        self.vmin = vmin
        self.vmax = vmax

        self.W = out['ew_tot']
        self.W_e = out['err_ew_tot']
        self.logN = out['col']
        self.logN_e = out['colerr']

        self.Tau = out['Tau_a']

        return self.trans, self.fval, self.vmin, self.vmax, self.trans_wave, self.W, self.W_e, self.logN, self.logN_e, self.Tau