Source
newfreq0 = _me.tofrequency('topo',_me.todoppler('optical',_me.measure(rv,'topo')),_me.frequency('topo',str(frequency[0])+'Hz'))['m0']['value']
#!/usr/bin/python -u
#
# bryan butler
# nrao
# spring 2012, summer 2016
#
# python functions to return expected flux density from solar system
# bodies. the flux density depends on the geometry (distance, size of
# body, subearth latitude), and on the model brightness temperature.
# uncertainties on the flux density can also be returned, but are all
# set to 0.0 for now, because i don't have uncertainties on the model
# brightness temperatures.
#
# the model brightness temperatures for the various bodies are taken
# from a combination of modern models and historical observations. see
# the written description for a more complete description of the model
# for each body.
#
# for all of the bodies but Mars, the model is contained in a text file
# that has tabulated brightness temperature as a function of frequency.
# for Mars it is also a function of time. eventually, the full-up
# model calculations should be in the code (for those bodies that have
# proper models) but for now, just live with the tabulated versions.
#
# version 2.0
# last edited: 2016Aug15
# Modified by TT to avoid uncessary file open: 2012Dec13
from __future__ import absolute_import
from numpy import searchsorted
from numpy import array
from scipy.interpolate import interp1d
from math import exp, pi, cos, sin, isnan, sqrt
import os
from casatasks.private.casa_transition import is_CASA6
if is_CASA6:
from casatools import table, measures, quanta, ctsys
qa = quanta( )
_tb = table( )
_me = measures( )
ctsys_resolve = ctsys.resolve
else:
from taskinit import gentools
(_tb,_me)=gentools(['tb','me'])
from casac import *
qa = casac.quanta()
def ctsys_resolve(apath):
dataPath = os.path.join(os.environ['CASAPATH'].split()[0],'data')
return os.path.join(dataPath,apath)
HH = qa.constants('H')['value']
KK = qa.constants('K')['value']
CC = qa.constants('C')['value']
class solar_system_setjy:
def __init__(self):
self.models={}