Example #1
0
def smooth_solutions(mslist, ddsols, interval, catcher=None):
    outsols = ddsols + '.Smooth'
    filenames = [l.strip() for l in open(mslist, 'r').readlines()]
    for f in filenames:
        if catcher: catcher.check()
        checkname = f + '/killMS.' + outsols + '.sols.npz'
        if o['restart'] and os.path.isfile(checkname):
            warn('Solutions file ' + checkname +
                 ' already exists, not running smoothing step')
        else:
            smoothsols.main(options=dotdict({
                'MSName': f,
                'Order': 2,
                'Plot': False,
                'SolsFile': ddsols,
                'WSize': interval
            }))
    return outsols
                break
        else:
            print 'Pointing',p,'not found'
            missingpointing = True
        if not missingpointing and (currentdict['status'] != 'Archived' or currentdict['archive_version'] != 4):
            print 'Pointing',p,'not archived with archive_version 4'
            missingpointing = True
    sdb.close()
    if not(args.no_check) and missingpointing == True:
        raise RuntimeError('Failed to find a required pointing')

    print 'Mosaicing using directories', mosaicdirs

    # now construct the inputs for make_mosaic

    mos_args=dotdict({'save':True, 'load':True,'exact':False,'use_shifted':True,'find_noise':True})
    mos_args.astromap_blank=args.astromap_blank
    mos_args.beamcut=args.beamcut
    mos_args.directories=mosaicdirs

    header,himsize=make_header(maxsep,mospointingname,pointingdict[mospointingname][1],pointingdict[mospointingname][2],1.5,6.0)
    
    mos_args.header=header
    print 'Calling make_mosaic'
    #with open('mosaic-header.pickle','w') as f:
    #    pickle.dump(header,f)

    make_mosaic(mos_args)

    print 'Blanking the mosaic...'
Example #3
0
        if not missingpointing and (currentdict['status'] != 'Archived'
                                    or currentdict['archive_version'] != 4):
            print('Pointing', p, 'not archived with archive_version 4')
            missingpointing = True
    if not (args.no_check) and missingpointing == True:
        sdb.close()
        raise RuntimeError('Failed to find a required pointing')
    sdb.close()
    print('Mosaicing using directories', mosaicdirs)

    # now construct the inputs for make_mosaic

    mos_args = dotdict({
        'save': True,
        'load': True,
        'exact': False,
        'use_shifted': True,
        'find_noise': True
    })
    mos_args.astromap_blank = args.astromap_blank
    mos_args.beamcut = args.beamcut
    mos_args.directories = mosaicdirs
    mos_args.band = args.band
    if args.do_scaling:
        print('Applying scales', scales)
        mos_args.scale = scales

    if not (args.no_highres):
        header, himsize = make_header(maxsep, mospointingname,
                                      pointingdict[mospointingname][1],
                                      pointingdict[mospointingname][2], 1.5,