Skip to content

Commit

Permalink
Merge pull request #76 from followthesheep/master
Browse files Browse the repository at this point in the history
added a new non-relativistic radial velocity module
  • Loading branch information
followthesheep committed Mar 15, 2021
2 parents 3b6c77c + 08c046b commit 1940683
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion starkit/base/operations/stellar.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ def evaluate(self, wavelength, flux, v_rot, limb_darkening):
return wavelength, nd.convolve1d(flux, profile)

class DopplerShift(StellarOperationModel):
'''
Module to model the velocity of the star with the relativistic redshift correction.
'''

operation_name = 'doppler'

Expand All @@ -90,6 +93,24 @@ def evaluate(self, wavelength, flux, vrad):
doppler_factor = np.sqrt((1+beta) / (1-beta))
return wavelength * doppler_factor, flux

class RadialVelocity(StellarOperationModel):
'''
Module to model the classical definition of radial velocity
'''
operation_name = 'rv'

vrad = modeling.Parameter()

def __init__(self, vrad):
super(DopplerShift, self).__init__(vrad=vrad)
self.c_in_kms = const.c.to(u.km / u.s).value


def evaluate(self, wavelength, flux, vrad):
beta = vrad / self.c_in_kms
doppler_factor = (1.0 + beta)
return wavelength * doppler_factor, flux



class CCM89Extinction(StellarOperationModel):
Expand Down Expand Up @@ -139,4 +160,4 @@ def __init__(self, distance, lum_density2cgs=1.):
def evaluate(self, wavelength, flux, distance):
conversion = self.lum_density2cgs / (4 * np.pi *
(distance * self.pc2cm)**2)
return wavelength, flux * conversion
return wavelength, flux * conversion

0 comments on commit 1940683

Please sign in to comment.