• No results found

6.2 Description of pyvfit

6.2.1 Basic equations of Synthesis Imaging

To derive the response of an interferometer we first introduce some definitions and a sys- tem of coordinates, following standard conventions as in Thompson (1999). Let us call

bthe baseline vector connecting two antennas on the ground andsthe unit vector (the

same for all the antennas) pointing towards the source. It is useful to rewrite⃗s=⃗s0+⃗σ, where⃗s0represents thephase centerof the synthesized field of view. It is possible to show (Thompson 1999) that the response of the interferometer to a source of brightnessIis:

Vobs(⃗b) =

S

A(⃗σ)I(⃗σ)e2πiν ⃗b·⃗σ/cdΩ, (6.1)

whereν =c/λis the radiation frequency,A(⃗σ)is the normalized antenna reception pat- tern andΩSis the angular size of the source as it appears on sky Eq. (6.1) defines the complex visibilityof the source. The brightnessIis a flux density and is therefore measured

Description ofpyvfit 101 in Jy/ sr or Jy per beam area²; the visibilityVobsis a flux and is measured in Jy. Eq. (6.1) has been derived under the assumption that the brightnessIis constant within the band- width∆νof the observations, and that the source is in the far field of the interferometer and is spatially incoherent (i.e., that the contribution to the brightnessIfrom different regions of the source can be considered uncorrelated).

It is useful to define a system of coordinates for the baseline vector(u,v,w), whereu points towards the East,vtowards the North andwtowards⃗s0, all of them being measured in units of the observing wavelengthλ. Positions on sky have coordinates(l,m), which are the direction cosines computed w.r.t. theuandvaxes. An image in the(l,m)plane can be regarded as the projection of the celestial sphere onto a plane tangent to the sphere in (l,m) = (0,0).

In the assumption of small field imaging it is possible to rewrite Eq. (6.1) as:

Vobs(u,v) = +−∞ +−∞ I(l,m)e−2πi(ul+vm)dldm, (6.2)

where we have made the fair assumption that for the primary beam A(l,m)≈1 where I(l,m)̸=0 and zero otherwise.

Interferometers measure the visibility functionVobs(u,v)in a discrete set of locations (uk,vk), with 1 k M. In the following, we shall refer to these locations assampling points.

In order to compare a synthetic, or model, brightnessImod(l,m)produced by a model to the interferometric data we need to compute the synthetic visibilitiesVmodaccording to Eq. (6.2): Vmod(u,v) = +−∞ +−∞ Imod(l,m)e−2πi(ul+vm)dldm (6.3)

and then to sampleVmod(u,v)at the same sampling points(uk,vk)where the observa- tions were taken. Finally, once the synthetic visibility function has been sampled, we can compare it to the measurements by computing theχ2:

χ2 =

M

k=1

|Vobs(uk,vk)−Vmod(uk,vk)|2w2k, (6.4)

wherewkis the theoretical weight associated to the visibility measurement in(uk,vk)and is assumed independent from the fit parameters.

We conclude this theoretical section recalling a basic property of the Fourier Transform that becomes particularly useful to fit the location of a source on sky, that is, to find the angular offsets∆α and∆δ (right ascension and declination, respectively) between the actual source location and the phase center(α0, δ0). In particular, the behaviour of the Fourier Transform under translations allows us to perform a translation in the image plane I(l,m)→I(l−∆l,m−∆m)by simply multiplying the complex visibilities by a phase factor exp [2πi(u∆l+v∆m)], where∆l = sin(∆α)and∆m= sin(∆δ)for sufficiently small imaging fields.

102 GPU-accelerated library for the analysis of interferometric observations

Tazzari, M. et al.: GPU-accelerated library for the analysis of interferometric observations

the noise of complex visibilities can be fairly considered uncor- related (Wrobel & Walker 1999) (thus ensuring that the covari- ance matrix is diagonal).

In this study we adopt approach (b), namely the fitting in the Fourier domain. We develop a tool to accelerate the computation

of the 2between a model image and the observed interferomet-

ric data. Before introducing the tool, we recall the fundamental equations of synthesis imaging and define the relevant quantities used in the code.

2.1. Basic equations of Synthesis Imaging

To derive the response of an interferometer we first introduce some definitions and a system of coordinates, following standard

conventions as in Thompson (1999). Let us callbthe baseline

vector connecting two antennas on the ground andsthe unit vec-

tor (the same for all the antennas) pointing towards the source.

It is useful to rewrites“s0` , wheres0represents thephase

centerof the synthesized field of view. It is possible to show that

the response of the interferometer to a source of brightnessIis:

Vobspbq “

ª

⌦S

Ap qIp qe´2⇡i⌫b¨ {cd, (1)

whereAp qis the normalized antenna reception pattern and⌦S

is the angular size of the source as it appears on sky. Eq. (1)

can be considered the definition of thecomplex visibilityof the

sourceI. The brightnessIis a flux density and is therefore mea-

sured in Jy/sr or Jy per beam area2; the visibilityVobsis a flux

and is measured in Jy. Eq. (1) has been derived under the as-

sumption that the brightnessIis constant within the bandwidth

⌫of the observations, and that the source is in the far field of

the interferometer and is spatially incoherent (i.e., that the con-

tribution to the brightnessIfrom di↵erent regions of the source

can be considered uncorrelated).

It is useful to define a system of coordinates for the baseline

vectorpu, v, wq, whereupoints towards the East,vtowards the

North andwtowardss0, all of them being measured in units of

the observing wavelength . Positions on sky have coordinates

pl,mq, which are the direction cosines computed w.r.t. theuand

vaxes. An image in thepl,mqplane can be regarded as the pro-

jection of the celestial sphere onto a plane tangent to the sphere

inpl,mq “ p0,0q.

In the assumption of small field imaging it is possible to rewrite Eq. (1) as:

Vobspu, vq “ ª`8 ´8 ª`8 ´8 Ipl,mqe ´2⇡ipul`vmqdldm, (2) where we have made the fair assumption that the primary beam

Apl,mq «1 whereIpl,mq ‰0 and zero otherwise.

Interferometers measure the visibility functionVobspu, vqin a

discrete set of locationspuk, vkq, with 1§k§M. In the follow-

ing, we shall refer to these locations assampling points.

In order to compare a synthetic brightnessImodpl,mq pro-

duced by a model to the interferometric data we need to compute

the synthetic visibilitiesVmodaccording to Eq. (2):

Vmodpu, vq “ ª`8 ´8 ª`8 ´8 Imodpl,mqe ´2⇡ipul`vmqdldm (3)

and then to sample Vmodpu, vq in the same sampling points

puk, vkqwhere the observations were taken. Finally, once the syn-

thetic visibility function has been sampled, we can compare it to 2 The eective area of the synthesized beam.

the measurements by computing the 2:

2ÿM

k“1

|Vobspuk, vkq ´Vmodpuk, vkq|2w2k, (4)

where wk is the theoretical weight associated to the visibility

measurement inpuk, vkq.

We conclude this theoretical section recalling a basic prop- erty of Fourier Transform that becomes particularly useful to fit the location of a source on sky, that is, to find the angu-

lar o↵sets ↵and (right ascension and declination, respec-

tively) between the actual source location and the phase center

p↵0, 0q. In particular, the behaviour of Fourier Transform un-

der translations allows us to operate a translation in the image

plane Ipl,mq Ñ Ipl´ l,m´ mq by simply multiplying the

complex visibilities by a phase factor expr´2⇡ipu l`v mqs,

where l “ sinp ↵q and m “ sinp qfor sufficiently small

imaging fields. 2.2. Usage ofpyvfit

pyvfit can be imported as a common Python package, with

its functions o↵ering a simple interface to the GPU accelerated

routines. Here below we show an example on how to use the tool.

from package import libgpu_dp # double precision

# model image

# in this example: point source

Nx = 1024 # matrix size

I_mod = np.zeros((Nx, Nx), dtype='complex128') I_mod[Nx/2, Nx/2] = 1.0 # [Jy/sr]

cell = 0.01 # cell angular size [arcsec]

# observational data # u, v: arrays [wavelength] # Re, Im: arrays [Jy] # w: array

# angular offsets (optional)

Delta_alpha = 0.5 # [arcsec]

Delta_delta = -2.5 # [arcsec]

# identifier for this execution (optional)

rank = 0

# execution

chi2_dp = acc_lib_dp.chi2(I_mod, cell, u, v, Re, Im, w,

Delta_alpha, Delta_delta, rank)

Let us analyze the steps for executing thechi2function:

1. We import the double precision versionlibgpu_dpfrom the

package (to import the single precision one just replace_dp

with_sp).

2. For this example, we create a mock model imageImodin a

square matrix of sizeNxˆNx and double precision values.

In this example we choose the simplest model, i.e. a point

source located at the image center. In a real case, Imod can

be whatever brightness distribution in the form of an image.

Article number, page 3 of 11

Fig. 6.1 Example usage of pyvfit

Related documents