Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools for testing #6

Open
keflavich opened this issue Jun 17, 2016 · 11 comments
Open

Tools for testing #6

keflavich opened this issue Jun 17, 2016 · 11 comments

Comments

@keflavich
Copy link
Contributor

keflavich commented Jun 17, 2016

We can use image_registration to make synthetic images

np.random.seed(0)
im = image_registration.tests.make_extended(imsize=256., powerlaw=1.5)

cc @baobabyoo

@keflavich
Copy link
Contributor Author

image

@keflavich
Copy link
Contributor Author

"synthetic interferometric imaging":

ygrid, xgrid = np.indices(im.shape, dtype='float')
rr = ((xgrid-im.shape[1]/2)**2+(ygrid-im.shape[0]/2)**2)**0.5
ring = (rr>=8) & (rr<=(256/3.))
pl.imshow(ring)
imfft = np.fft.fft2(im)
imfft_interferometered = imfft * np.fft.fftshift(ring)
im_interferometered = np.fft.ifft2(imfft_interferometered)

ring:
image

"interferometered" image:
image

@keflavich
Copy link
Contributor Author

from astropy import convolution
singledish_im = convolution.convolve_fft(im, convolution.Gaussian2DKernel(40/2.35), boundary='fill', fill_value=im.mean())

image

@keflavich
Copy link
Contributor Author

from uvcombine.uvcombine import feather_kernel, fftmerge

pixscale = 1
lowresfwhm = 40
nax1,nax2 = im.shape
kfft, ikfft = feather_kernel(nax2, nax1, lowresfwhm, pixscale,)


im_hi = im_interferometered.real
im_low = singledish_im
lowresscalefactor=1
replace_hires=False
highpassfilterSD = False
deconvSD = False
highresscalefactor=1
fftsum, combo = fftmerge(kfft, ikfft, im_hi*highresscalefactor,
                         im_low*lowresscalefactor,
                         replace_hires=replace_hires,
                         highpassfilterSD=highpassfilterSD,
                         deconvSD=deconvSD,
                        )

combined, real:
image

original - feather combined:

image

@keflavich
Copy link
Contributor Author

Gaussian synthetic image:

# 20 pixel gaussian as input image
singledish_kernel = np.exp(-rr**2 / (2*(20/2.35)**2))
# "interferometrically" observe: (note fftshift!!!!)
sd_interferometered = np.fft.ifft2(np.fft.fft2(singledish_kernel) * np.fft.fftshift(ring))
# single-dish image
lowresfwhm = 40
im_low = singledish_im = convolution.convolve_fft(singledish_kernel, convolution.Gaussian2DKernel(lowresfwhm/2.35), boundary='fill', fill_value=0)
kfft, ikfft = feather_kernel(nax2, nax1, lowresfwhm, pixscale,)

im_hi = sd_interferometered.real
fftsum, combo = fftmerge(kfft, ikfft, im_hi*highresscalefactor,
                         im_low*lowresscalefactor,
                         replace_hires=replace_hires,
                         highpassfilterSD=highpassfilterSD,
                         deconvSD=deconvSD,
                        )

input:
image

interferometered:
image

combined:

image

@keflavich
Copy link
Contributor Author

Creating an exponential kernel:


expkernel[rr < 8] = 1.0
expkernel[rr >= 8] = (np.exp(-rr/10.) / np.exp(-8./10.))[rr>=8]
kfft = expkernel
ikfft = 1-expkernel
fftsum, combo = fftmerge(kfft, ikfft, im_hi*highresscalefactor,
                         im_low*lowresscalefactor,
                         replace_hires=replace_hires,
                         highpassfilterSD=highpassfilterSD,
                         deconvSD=deconvSD,
                        )
expcombo = combo

lowresfwhm = 40
# note the *u.deg "hack"
kfft, ikfft = feather_kernel(nax2, nax1, lowresfwhm*u.deg, pixscale,)
fftsum, combo = fftmerge(kfft, ikfft, im_hi*highresscalefactor,
                         im_low*lowresscalefactor,
                         replace_hires=replace_hires,
                         highpassfilterSD=highpassfilterSD,
                         deconvSD=deconvSD,
                        )
feathercombo = combo

@keflavich
Copy link
Contributor Author

Note that there has been some simulation of array combination on the ALMA memo series, specifically simulations performed in Memo 488 which were criticized in the subsequent memo. Older imaging simulations for ACA+12m were done in 368. 398 describes a complete simulation pipeline.

@keflavich
Copy link
Contributor Author

See https://github.com/radio-astro-tools/uvcombine/blob/master/examples/test_examples.py for a written-out script version of this. Colorbar'd, nicer figures:

inputimage_pl1 5
feathered_image_pl1 5
interf_image_pl1 5
residual_feathered_image_pl1 5
singledish_image_pl1 5
uvcoverage_ring

@keflavich
Copy link
Contributor Author

@keflavich
Copy link
Contributor Author

@keflavich
Copy link
Contributor Author

Another important resource:
http://esoads.eso.org/abs/2009PASJ...61..873K
These folks have done some careful analysis of various effects we were exploring here and came up with some heuristics, though they used some simplified inputs (sphere, ellipse)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant