casa
$Rev:20696$
|
00001 # 00002 # This file was generated using xslt from its XML file 00003 # 00004 # Copyright 2009, Associated Universities Inc., Washington DC 00005 # 00006 import sys 00007 import os 00008 from casac import * 00009 import string 00010 from taskinit import casalog 00011 #from taskmanager import tm 00012 import task_predictcomp 00013 def predictcomp(objname='', standard='Butler-JPL-Horizons 2010', epoch='', minfreq='', maxfreq='', nfreqs=2, prefix='', antennalist='', showplot=False, savefig='', symb=',', include0amp=False, include0bl=False, blunit='', showbl0flux=False): 00014 00015 """Make a component list for a known calibrator 00016 00017 Writes a component list to disk and returns a dict of 00018 {'clist': filename of the component list, 00019 'objname': objname, 00020 'angdiam': angular diameter in radians (if used in clist), 00021 'standard': standard, 00022 'epoch': epoch, 00023 'freqs': pl.array of frequencies, in GHz, 00024 'antennalist': pl.array of baseline lengths, in m, 00025 'amps': pl.array of predicted visibility amplitudes, in Jy, 00026 'savedfig': False or, if made, the filename of a plot.} 00027 or False on error. 00028 00029 objname: An object supported by standard. 00030 standard: A standard for calculating flux densities, as in setjy. 00031 Default: 'Butler-JPL-Horizons 2010' 00032 epoch: The epoch to use for the calculations. Irrelevant for 00033 extrasolar standards. (Uses UTC) 00034 Examples: '2011-12-31/5:34:12', '2011-12-31-5:34:12' 00035 minfreq: The minimum frequency to use. 00036 Example: '342.0GHz' 00037 maxfreq: The maximum frequency to use. 00038 Default: minfreq 00039 Example: '346.0GHz' 00040 Example: '', anything <= 0, or None: use minfreq. 00041 nfreqs: The number of frequencies to use. 00042 Default: 1 if minfreq == maxfreq, 00043 2 otherwise. 00044 prefix: The component list will be saved to 00045 prefix + 'spw0_<objname>_<minfreq><epoch>.cl' 00046 Default: '' 00047 Example: "Bands3to7_" 00048 (which could produce 'Bands3to7_spw0_Uranus_100GHz55877d.cl', 00049 depending on the other parameters) 00050 antennalist: 'Observe' and plot the visibility amplitudes for this 00051 antenna configuration. The file should be in a format usable 00052 by simdata. The search path is: 00053 .:casa['dirs']['data'] + '/alma/simmos/' 00054 Default: '' (None, just make clist.) 00055 Example: 'alma.cycle0.extended.cfg' 00056 00057 Subparameters of antennalist: 00058 showplot: Whether or not to show a plot of S vs. |u| on screen. 00059 Subparameter of antennalist. 00060 Default: Necessarily False if antennalist is not specified. 00061 True otherwise. 00062 savefig: Filename for saving a plot of S vs. |u|. 00063 Subparameter of antennalist. 00064 Default: False (necessarily if antennalist is not specified) 00065 Examples: '' (do not save the plot) 00066 'myplot.png' (save to myplot.png) 00067 symb: One of matplotlib's codes for plot symbols: .:,o^v<>s+xDd234hH|_ 00068 Default: ',': The smallest points I could find. 00069 include0amp: Force the amplitude axis to start at 0? 00070 Default: False 00071 include0bl: Force the baseline axis to start at 0? 00072 Default: False 00073 blunit: unit of the baseline axis ('' or 'klambda') 00074 Default:''=use a unit in the data 00075 showbl0flux: Print the zero baseline flux? 00076 Default: False 00077 00078 00079 00080 """ 00081 00082 # 00083 # The following is work around to avoid a bug with current python translation 00084 # 00085 mytmp = {} 00086 00087 mytmp['objname'] = objname 00088 mytmp['standard'] = standard 00089 mytmp['epoch'] = epoch 00090 mytmp['minfreq'] = minfreq 00091 mytmp['maxfreq'] = maxfreq 00092 mytmp['nfreqs'] = nfreqs 00093 mytmp['prefix'] = prefix 00094 mytmp['antennalist'] = antennalist 00095 mytmp['showplot'] = showplot 00096 mytmp['savefig'] = savefig 00097 mytmp['symb'] = symb 00098 mytmp['include0amp'] = include0amp 00099 mytmp['include0bl'] = include0bl 00100 mytmp['blunit'] = blunit 00101 mytmp['showbl0flux'] = showbl0flux 00102 pathname='file:///'+os.environ.get('CASAPATH').split()[0]+'/share/xml/' 00103 trec = casac.utils().torecord(pathname+'predictcomp.xml') 00104 00105 casalog.origin('predictcomp') 00106 if trec.has_key('predictcomp') and casac.utils().verify(mytmp, trec['predictcomp']) : 00107 result = task_predictcomp.predictcomp(objname, standard, epoch, minfreq, maxfreq, nfreqs, prefix, antennalist, showplot, savefig, symb, include0amp, include0bl, blunit, showbl0flux) 00108 00109 else : 00110 result = False 00111 return result