Esempio n. 1
0
    fminax = fmajax
    fpa = NP.zeros(n_src)
    ctlgobj = CTLG.Catalog('PS',
                           freq_catalog * 1e9,
                           NP.hstack(
                               (ra_deg.reshape(-1, 1), dec_deg.reshape(-1,
                                                                       1))),
                           fpeak,
                           spectral_index=spindex,
                           src_shape=NP.hstack(
                               (fmajax.reshape(-1, 1), fminax.reshape(-1, 1),
                                fpa.reshape(-1, 1))),
                           src_shape_units=['arcmin', 'arcmin', 'degree'])
    fg_str = 'point'

skymod = CTLG.SkyModel(ctlgobj)

## Start the observation

# PDB.set_trace()
# progress = PGB.ProgressBar(widgets=[PGB.Percentage(), PGB.Bar(), PGB.ETA()], maxval=len(bl_chunk)).start()
# for i in range(len(bl_chunk)):
#     outfile = '/data3/t_nithyanandan/project_MWA/multi_baseline_visibilities_'+obs_mode+'_baseline_range_{0:.1f}-{1:.1f}_'.format(bl_length[baseline_bin_indices[bl_chunk[i]]],bl_length[min(baseline_bin_indices[bl_chunk[i]]+baseline_chunk_size-1,total_baselines-1)])+'gaussian_FG_model_'+fg_str+'_{0:0d}_'.format(nside)+bpass_shape+'{0:.1f}'.format(oversampling_factor)+'_part_{0:0d}'.format(i)
#     ia = RI.InterferometerArray(labels[baseline_bin_indices[bl_chunk[i]]:min(baseline_bin_indices[bl_chunk[i]]+baseline_chunk_size,total_baselines)], bl[baseline_bin_indices[bl_chunk[i]]:min(baseline_bin_indices[bl_chunk[i]]+baseline_chunk_size,total_baselines),:], chans, telescope=telescope, latitude=latitude, A_eff=A_eff, freq_scale='GHz')
#     ts = time.time()
#     ia.observing_run(pointing_init, skymod, t_snap, t_obs, chans, bpass, Tsys, lst_init, mode=obs_mode, freq_scale='GHz', brightness_units=flux_unit, memsave=True)
#     print 'The last chunk of {0:0d} baselines required {1:.1f} minutes'.format(baseline_chunk_size, (time.time()-ts)/60.0)
#     ia.delay_transform(oversampling_factor-1.0, freq_wts=window)
#     ia.save(outfile, verbose=True, tabtype='BinTableHDU', overwrite=True)
#     progress.update(i+1)
# progress.finish()
Esempio n. 2
0
                ec = gc.transform_to('icrs')
            else:
                ec = SkyCoord(ra=NP.degrees(phi),
                              dec=90.0 - NP.degrees(theta),
                              unit='deg',
                              frame='icrs')

            spec_parms = None
            spec_type = 'spectrum'
            dsm_inspec = NP.asarray(dsm_inspec)
            catlabel = NP.repeat('DSM', dsm_inspec.shape[0])

            dsm_in = SM.SkyModel(catlabel,
                                 freqs[chan],
                                 NP.hstack((ec.ra.degree.reshape(-1, 1),
                                            ec.dec.degree.reshape(-1, 1))),
                                 spec_type,
                                 spectrum=indata,
                                 spec_parms=None)
            dsm_out_dict = dsm_in.to_healpix(freqs[chan],
                                             out_nside,
                                             in_units=dsm_units,
                                             dsm_out_coords=out_coord,
                                             out_units=out_units)
            dsm_out[:, chan] = dsm_out_dict['spectrum']

if ('csm' in inp_skymodels) or ('CSM' in inp_skymodels):

    freq_SUMSS = 0.843  # in GHz
    catalog = NP.loadtxt(SUMSS_file,
                         usecols=(0, 1, 2, 3, 4, 5, 10, 12, 13, 14, 15, 16))