コード例 #1
0
def setup_chi2Profile(nxy, nsamples):

    pars = {'wle_m': 0.00088, 'dRA': 2.3, 'dDec': 3.2, 'PA': 88.}
    Rmin, dR, nrad, inc, profile_mode = 0.001, 0.001, 2000, 20., 'Gauss'
    Rmin *= arcsec
    dR *= arcsec

    wle_m = pars['wle_m']
    dRA = pars['dRA']
    dDec = pars['dDec']
    PA = pars['PA']

    # generate the samples
    maxuv_generator = 3e3
    udat, vdat = create_sampling_points(nsamples,
                                        maxuv_generator,
                                        dtype=options.dtype)
    x, _, w = generate_random_vis(nsamples, options.dtype)

    _, _, maxuv = matrix_size(udat, vdat)
    maxuv /= wle_m
    dxy = 1 / maxuv
    # compute the matrix size and maxuv
    # nxy, dxy = g_double.get_image_size(udat/wle_m, vdat/wle_m)

    # compute radial profile
    intensity = radial_profile(Rmin,
                               dR,
                               nrad,
                               profile_mode,
                               dtype=options.dtype,
                               gauss_width=150. * arcsec)

    return intensity, Rmin, dR, nxy, dxy, udat / wle_m, vdat / wle_m, x.real.copy(
    ), x.imag.copy(), w, dRA, dDec, inc, PA
コード例 #2
0
def setup_chi2Image(nxy, nsamples):

    # these number can be freely changed for this speed test
    dRA = -3.1
    dDec = 2.5
    PA = 80.

    maxuv_generator = 3e3
    udat, vdat = create_sampling_points(nsamples,
                                        maxuv_generator,
                                        dtype='float64')
    x, _, w = generate_random_vis(nsamples, options.dtype)

    _, _, maxuv = matrix_size(udat, vdat)
    dxy = 1 / maxuv

    # create model image (it happens to have 0 imaginary part)
    image_ref = create_reference_image(size=nxy,
                                       kernel='gaussian',
                                       dtype=options.dtype)

    return image_ref, dxy, udat, vdat, x.real.copy(), x.imag.copy(
    ), w, dRA, dDec, PA