Exemplo n.º 1
0
sigma['gaussian_ps']['ero']  = {'': 2.3/2.35*arcsec, 'z1': 2.4*arcsec/2.35}
sigma['gaussian_ps']['drg']  = {'': 0.7/2.35*arcsec, 'z1': 0.7*arcsec/2.35}


datapath = '/data2/lindroos/ecdfs/aless/stack'
# vis = {}
model='gaussian_ps'

# for sample in samples:
#     for subsample in subsamples:

for sample in ['drg']:
    for subsample in ['z1']:

        vis = os.path.join(datapath, sample+subsample, 'stack.uv.ms')

        parameters, chi2 = \
            vesta.run(vis=vis, model=model,
                    flux_ext=flux_ext[model][sample][subsample], dflux_ext = 0.9e-3,
                    flux_ps=flux_ps[model][sample][subsample], dflux_ps = 0.9e-3,
                    sigma=sigma[model][sample][subsample], dsigma=0.40*arcsec,
                    x=0., y=0., nscan = 20)

        np.save('results/{}_{}_{}_parameters.npy'.format(sample, subsample, model),
                parameters)
        np.save('results/{}_{}_{}_chi2.npy'.format(sample, subsample, model),
                chi2)

        

Exemplo n.º 2
0
        sigmas = np.linspace(sigma-dsigma, sigma+dsigma, nscan)
        fluxes_ext, fluxes_ps, sigmas = meshgrid(fluxes_ext, fluxes_ps, sigmas, indexing='xy')

        parameters = np.zeros(shape+[5])
        parameters[:,:,:,0] = fluxes_ext
        parameters[:,:,:,1] = xs
        parameters[:,:,:,2] = ys
        parameters[:,:,:,3] = sigmas
        parameters[:,:,:,4] = fluxes_ps
#         fluxes,sigmas = np.meshgrid(fluxes, sigmas)
    

    chi2_scan = libchi2.c_chi2_scan
    c_chi2 = c_ndarray(chi2, dtype=chi2.dtype, ndim=chi2.ndim)
    c_parameters = c_ndarray(parameters, dtype=parameters.dtype, ndim=parameters.ndim)
    chi2_scan(c_chi2, c_int(chi2.ndim), c_char_p(vis), c_model[model], c_parameters)
    return parameters, chi2


if __name__ == '__main__':
    import vesta
    parameters, chi2 = \
        vesta.run(vis = '/data2/lindroos/ecdfs/aless/stack/sbzk/stack.uv.ms',
                  flux = 2.3349e-3, dflux = 0.6e-3,
                  sigma=0.30536*arcsec, dsigma=0.16*arcsec,
                  x=1.489274040147295e-07, y=9.887614358626681e-09,
                  nscan = 20)

    np.save('results/sbzk_parameters.npy', parameters)
    np.save('results/sbzk_chi2.npy', chi2)