def logN_b_to_Wr(logN, b, wa0, fosc, gamma): """I will use the approximation given by Draine book (eq. 9.27), whic comes from atomic physics considerations + Rodgers & Williams 1974 (I couldn't find the reference though) Inputs ------ logN: log10 of the column density in cm^-2. b: Doppler parameter in km/s. wa0: rest-frame wavelenght of the transition in A. fosc: oscillator strenght for the transition. gamma: Gamma parameter for the transition in s^-1. Returns ------- Wr: rest-frame equivalent width in A """ # give units wa0 = wa0 * u.AA N = 10**logN * (1 / u.cm * u.cm) b = b * u.km / u.s gamma = gamma * (1 / u.s) # call linetools function return ltaa.Wr_from_N_b(N, b, wa0, fosc, gamma)
def get_Wr_from_N_b(self, N, b): """It returns the rest-frame equivalent width for a given N and b. It uses the approximation given by Draine 2011 book (eq. 9.27), which comes from atomic physics considerations See also Rodgers & Williams 1974 (NT: could not find the reference given by Draine) Parameters ---------- N : Quantity or Quantity array Column density b : Quantity or Quantity array of same shape as N Doppler parameter Returns ------- Wr : Quantity Rest-frame equivalent width Notes ----- This is a wrapper to linetools.analysis.absline.Wr_from_N_b(). See also linetools.analysis.absline.Wr_from_N_b_transition(). """ try: fosc = self.data['f'] except KeyError: raise NotImplementedError( 'AbsLine {} has not set its oscillator strength.'.format( self.__repr__)) try: gamma = self.data['gamma'] except KeyError: raise NotImplementedError( 'AbsLine {} has not set its gamma value.'.format( self.__repr__)) return laa.Wr_from_N_b(N, b, self.wrest, fosc, gamma)