-
Notifications
You must be signed in to change notification settings - Fork 2
Description
In the line 471/472 of discosscan.py of the development version of discos2class, v_observer is defined based on the exact band center:
v_observer = -((self.central_frequency - self.rest_frequency) /
self.rest_frequency) * CLIGHT
This makes the script inflexible to any other occasion where the baseband might not be exactly centered on the Doppler-shifted rest_frequency. Better would be to use the astropy package:
from astropy.coordinates import ICRS, LSRK, SkyCoord, EarthLocation
to calculate this v_observer independently. In particular:
#lat, long, z of the observatory, should be written in the FITS header
obsloc= EarthLocation.from_geodetic(longu.deg, latu.deg, z*u.m)
#source position is also written in the header (in J2000)
sc = SkyCoord(ra_txt, dec_txt, unit=(u.hourangle, u.deg))
lsrk_time = Time(utc_txt)
#calculate the barycentric velocity correction
vbary = sc.radial_velocity_correction(kind='barycentric',
obstime=lsrk_time, location=obsloc)
#and convert to LSRK assuming no proper motion and no distance
icrs = ICRS(sc.ra, sc.dec, pm_ra_cosdec=0u.mas/u.yr,
pm_dec=0u.mas/u.yr, radial_velocity=vbary, distance = 1*u.pc)
barycorr = icrs.transform_to(LSRK()).radial_velocity
#Relative velocity of source wrt. observatory, where src_vlsrk is the radial velocity in the LSRK frame
rel_vel = src_vlsrk - barycorr
I think that this rel_vel is what v_observer is in the present script, but this should be tested as using various reference frames I can easily confuse myself.