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={}
def solar_system_fd (self, source_name, MJDs, frequencies, observatory, casalog=None):
'''
find flux density for solar system bodies:
Venus - Butler et al. 2001
Mars - Butler et al. 2012
Jupiter - Orton et al. 2012
Uranus - Orton & Hofstadter 2012 (modified ESA4)
Neptune - Orton & Hofstadter 2012 (modified ESA3)
Io - Butler et al. 2012
Europa - Butler et al. 2012
Ganymede - Butler et al. 2012
Titan - Gurwell et al. 2012
Callisto - Butler et al. 2012
Ceres - Mueller (private communication)
Juno - Butler et al. 2012
Pallas - Mueller (private communication)
Vesta - Mueller (private communication)
Lutetia - Mueller (private communication)
inputs:
source_name = source name string. example: "Venus"
MJDs = list of MJD times (day + fraction). example:
[ 56018.232, 56018.273 ]
must be sorted in ascending order.
frequencies = list of [start, stop] frequencies for
which to calculate the integrated model.
example:
[ [ 224.234567e9, 224.236567e9 ],