Beispiel #1
0
            MS, 'central_chan_percentage')

    return conf


print "Starting CSPAM version: " + _version.__version__

# Print information on MSs
conf = get_conf()
print conf

execfile(conf['prog_dir'] + '/cspam_lib.py')
execfile(conf['prog_dir'] + '/cspam_lib_cal.py')

# set logging level
if conf['debug'] == 2: _logging.setLevel('debug')
if conf['debug'] == 0: _logging.setLevel('warning')

# creating the list of MSs and setting some specific values (as flags)
MSs = []
for MS in conf['MSs']:
    MSs.append(MSobj(conf[MS]))

# Sequence of macro steps
if 'dataprep' in conf['steps']:
    execfile(conf['prog_dir'] + '/cspam_step_dataprep.py')
    if cspam_step_dataprep(MSs, conf):
        logging.critical('Error in data preparation step.')
        sys.exit(1)

if 'cal' in conf['steps']:
Beispiel #2
0

if __name__=='__main__':
    # Options
    import optparse
    opt = optparse.OptionParser(usage='%prog [-v|-V] h5parm parset [default: losoto.parset] \n'
            +_author, version='%prog '+_version.__version__)
    opt.add_option('-q', help='Quiet', action='store_true', default=False)
    opt.add_option('-v', help='Verbose', action='store_true', default=False)
    opt.add_option('-f', '--filter', help='Filter to use with "-i" option to filter on solution set names (default=None)', type='string', default=None)
    opt.add_option('-i', help='List information about h5parm file (default=False). A filter on the solution set names can be specified with the "-f" option.', action='store_true', default=False)
    (options, args) = opt.parse_args()

    atexit.register(my_close_open_files, False) # Suppress info about closing open files at exit
    if options.q:
        _logging.setLevel('warning')
    if options.v:
        _logging.setLevel('debug')
        atexit.register(my_close_open_files, True) # Print info about closing open files at exit

    # Check options
    if len(args) not in [1, 2]:
        opt.print_help()
        sys.exit()

    try: h5parmFile = args[0]
    except:
        logging.critical('Missing H5parm file.')
        sys.exit(1)

    try: parsetFile = args[1]
Beispiel #3
0
        conf[MS]['spw'] = confP.get(MS, 'spw').replace(' ','')
        conf[MS]['central_chan_percentage'] = confP.getint(MS, 'central_chan_percentage')
   
    return conf

print "Starting CSPAM version: "+_version.__version__

# Print information on MSs
conf = get_conf()
print conf

execfile(conf['prog_dir']+'/cspam_lib.py')
execfile(conf['prog_dir']+'/cspam_lib_cal.py')

# set logging level
if conf['debug'] == 2: _logging.setLevel('debug')
if conf['debug'] == 0: _logging.setLevel('warning')

# creating the list of MSs and setting some specific values (as flags)
MSs = []
for MS in conf['MSs']:
    MSs.append( MSobj(conf[MS]) )

# Sequence of macro steps
if 'dataprep' in conf['steps']:
    execfile(conf['prog_dir']+'/cspam_step_dataprep.py')
    if cspam_step_dataprep(MSs, conf):
        logging.critical('Error in data preparation step.')
        sys.exit(1)

if 'cal' in conf['steps']:
Beispiel #4
0
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

"""The load() convenience function is used to load a sky model file into a
SkyModel object.

.. moduleauthor:: David Rafferty <*****@*****.**>

"""

from ._version import changelog
import _logging as logger
logger.setLevel('info')


def load(fileName, beamMS=None, VOPosition=None, VORadius=None):
    """
    Loads a sky model from a file or VO service and returns a SkyModel object.

    Parameters
    ----------
    fileName : str
        Name of input ASCII file from which the sky model is read (must respect
        the makesourcedb format) or name of VO service to query (must be one of
        'WENSS', 'NVSS', or 'GSM'), or dict (single source only)
    beamMS : str, optional
        Measurement set from which the primary beam will be estimated. A
        column of attenuated Stokes I fluxes will be added to the table
Beispiel #5
0
        help=
        'Filter to use with "-i" option to filter on solution set names (default=None)',
        type='string',
        default=None)
    opt.add_option(
        '-i',
        help=
        'List information about h5parm file (default=False). A filter on the solution set names can be specified with the "-f" option.',
        action='store_true',
        default=False)
    (options, args) = opt.parse_args()

    atexit.register(my_close_open_files,
                    False)  # Suppress info about closing open files at exit
    if options.q:
        _logging.setLevel('warning')
    if options.v:
        _logging.setLevel('debug')
        atexit.register(my_close_open_files,
                        True)  # Print info about closing open files at exit

    # Check options
    if len(args) not in [1, 2]:
        opt.print_help()
        sys.exit()

    try:
        h5parmFile = args[0]
    except:
        logging.critical('Missing H5parm file.')
        sys.exit(1)