import matplotlib.pyplot as plt
from casatasks import casalog
from casatools import image, quanta
def plotprofilemap(imagename=None, figfile=None, overwrite=None, transparent=None,
pol=None, spectralaxis=None, restfreq=None, plotrange=None, title=None,
linecolor=None, linestyle=None, linewidth=None,
separatepanel=None, plotmasked=None, maskedcolor=None,
showaxislabel=None, showtick=None, showticklabel=None,
figsize=None, numpanels=None):
if len(figfile) > 0 and os.path.exists(figfile) and not overwrite:
raise RuntimeError('overwrite is False and output file exists: \'%s\''%(figfile))
image_data = SpectralImage(imagename)
npol = len(image_data.stokes)
if pol < 0 or pol > npol - 1:
raise RuntimeError('pol {pol} is out of range (Stokes axis {stokes})'.format(pol=pol,stokes=image_data.stokes))
parsed_size = parse_figsize(figsize)
nx, ny = parse_numpanels(numpanels)
if (not isinstance(restfreq, str)) or len(restfreq) == 0:
plot_profile_map(image_data, figfile, pol, spectralaxis, restfreq, title, linecolor, linestyle, linewidth,
separatepanel, plotmasked, maskedcolor,
showaxislabel, showtick, showticklabel, parsed_size,
nx, ny, transparent, plotrange)
NoDataThreshold = NoData + 10000.0
LightSpeedQuantity = qa.constants('c')
LightSpeed = qa.convert(LightSpeedQuantity, 'km/s')['value']
def Deg2HMS(x, arrowance):
s = ((xx % 15) * 4 - m) * 60.0
(h, m, s) = Deg2HMS(x, 1 / 240000.0)
return '%02d%s%02d%s%05.2f' % (h, hsyb, m, msyb, s)
def Deg2DMS(x, arrowance):
xxx = (x + 90) % 180 - 90
xx = abs(xxx) + arrowance
s = ((xx % 1) * 60 - m) * 60.0
(d, m, s) = Deg2DMS(x, 1 / 360000.0)
sstr = ('%3.1f' % (s - int(s))).lstrip('0')
return '%+02d%s%02d\'%02d\"%s' % (d, dsyb, m, sint, sstr)
def parse_figsize(figsize):