Skip to content

calculate v_obs independently in discos2class #16

@kazirygl

Description

@kazirygl

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=0
u.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions