Skip to content

Stokes I Simultaneous Image and Instrument Modeling

In this tutorial, we will create a preliminary reconstruction of the 2017 M87 data on April 6 by simultaneously creating an image and model for the instrument. By instrument model, we mean something akin to self-calibration in traditional VLBI imaging terminology. However, unlike traditional self-cal, we will solve for the gains each time we update the image self-consistently. This allows us to model the correlations between gains and the image.

To get started we load Comrade.

julia
using Comrade


using VLBIFiles
using LinearAlgebra

For reproducibility we use a stable random number genreator

julia
using StableRNGs
rng = StableRNG(42)
StableRNGs.LehmerRNG(state=0x00000000000000000000000000000055)

Load the Data

To download the data visit https://doi.org/10.25739/g85n-f134 First we will load our data:

julia
uvd = VLBIFiles.load(
    VLBIFiles.UVData,
    joinpath(__DIR, "..", "..", "Data", "SR1_M87_2017_096_lo_hops_netcal_StokesI.uvfits")
)
VLBIFiles.UVData("/home/runner/work/Comrade.jl/Comrade.jl/examples/Data/SR1_M87_2017_096_lo_hops_netcal_StokesI.uvfits", VLBIFiles.UVHeader(SIMPLE  =                    T / conforms to FITS standard
BITPIX  =                  -32 / array data type
NAXIS   =                    7 / number of array dimensions
NAXIS1  =                    0
NAXIS2  =                    3
NAXIS3  =                    4
NAXIS4  =                    1
NAXIS5  =                    1
NAXIS6  =                    1
NAXIS7  =                    1
EXTEND  =                    T
GROUPS  =                    T / has groups
PCOUNT  =                    9 / number of parameters
GCOUNT  =                 8645 / number of groups
OBSRA   =    187.7059307575226
OBSDEC  =    12.39112323919932
OBJECT  = 'M87     '          
MJD     =              57849.0
DATE-OBS= '2017-04-06'        
BSCALE  =                  1.0
BZERO   =                  0.0
BUNIT   = 'JY      '          
VELREF  =                    3
EQUINOX = 'J2000   '          
ALTRPIX =                  1.0
ALTRVAL =                  0.0
TELESCOP= 'VLBA    '          
INSTRUME= 'VLBA    '          
OBSERVER= 'EHT     '          
CTYPE2  = 'COMPLEX '          
CRVAL2  =                  1.0
CDELT2  =                  1.0
CRPIX2  =                  1.0
CROTA2  =                  0.0
CTYPE3  = 'STOKES  '          
CRVAL3  =                 -1.0
CDELT3  =                 -1.0
CRPIX3  =                  1.0
CROTA3  =                  0.0
CTYPE4  = 'FREQ    '          
CRVAL4  =     2.27070703125e11
CDELT4  =              1.856e9
CRPIX4  =                  1.0
CROTA4  =                  0.0
CTYPE6  = 'RA      '          
CRVAL6  =    187.7059307575226
CDELT6  =                  1.0
CRPIX6  =                  1.0
CROTA6  =                  0.0
CTYPE7  = 'DEC     '          
CRVAL7  =    12.39112323919932
CDELT7  =                  1.0
CRPIX7  =                  1.0
CROTA7  =                  0.0
PTYPE1  = 'UU---SIN'          
PSCAL1  =  4.4039146672722e-12
PZERO1  =                  0.0
PTYPE2  = 'VV---SIN'          
PSCAL2  =  4.4039146672722e-12
PZERO2  =                  0.0
PTYPE3  = 'WW---SIN'          
PSCAL3  =  4.4039146672722e-12
PZERO3  =                  0.0
PTYPE4  = 'BASELINE'          
PSCAL4  =                  1.0
PZERO4  =                  0.0
PTYPE5  = 'DATE    '          
PSCAL5  =                  1.0
PZERO5  =                  0.0
PTYPE6  = 'DATE    '          
PSCAL6  =                  1.0
PZERO6  =                  0.0
PTYPE7  = 'INTTIM  '          
PSCAL7  =                  1.0
PZERO7  =                  0.0
PTYPE8  = 'TAU1    '          
PSCAL8  =                  1.0
PZERO8  =                  0.0
PTYPE9  = 'TAU2    '          
PSCAL9  =                  1.0
PZERO9  =                  0.0
HISTORY AIPS SORT ORDER='TB', "M87", Dates.Date("2017-04-06"), [:RR, :LL, :RL, :LR], 2.27070703125e11 Hz), VLBIFiles.FrequencyWindow[VLBIFiles.FrequencyWindow(1, 1, 2.270707f11 Hz, 1.856f9 Hz, 1, 1, 1.0f0)], VLBIFiles.AntArray[VLBIFiles.AntArray("VLBA", 2.270707f11 Hz, {1 = Antenna AA, 2 = Antenna AP, 3 = Antenna AZ, 4 = Antenna JC, 5 = Antenna LM, 6 = Antenna PV, 7 = Antenna SM, 8 = Antenna SR}, [0.0, 0.0, 0.0])])

Extract scan-averaged complex visibilities. Then inflate the noise by 2% to account for residual calibration errors.

julia
dvis = extract_table(uvd, Visibilities(; time_average = VLBI.GapBasedScans()))
add_fractional_noise!(dvis, 0.02)
EHTObservationTable{Comrade.EHTVisibilityDatum{:I}}
  source:      M87
  mjd:         57849
  bandwidth:   1.856e9
  sites:       [:AA, :AP, :AZ, :JC, :LM, :PV, :SM]
  nsamples:    274

##Building the Model/Posterior

Now, we must build our intensity/visibility model. That is, the model that takes in a named tuple of parameters and perhaps some metadata required to construct the model. For our model, we will use a raster or ContinuousImage for our image model. The model is given below:

The model construction is very similar to Imaging a Black Hole using only Closure Quantities, except we include a large scale gaussian since we want to model the zero baselines. For more information about the image model please read the closure-only example. We use the @sky macro to bundle the model and its priors in one block. Each name ~ dist line adds an entry to the prior; everything else is the model body.

julia
using VLBIImagePriors
using Distributions
@sky function sky(grid; ftot, mimg, cprior)
    c ~ cprior
    σimg ~ VLBITruncated(VLBIGaussian(0.0, 0.5); lower = 0.0)
    fg ~ VLBIUniform(0.0, 1.0)
    # Apply the GMRF fluctuations to the image
    rast = apply_fluctuations(CenteredLR(), mimg, σimg .* c.params)
    pimg = parent(rast)
    @. pimg = (ftot * (1 - fg)) * pimg
    m = ContinuousImage(rast, BSplinePulse{3}())
    # Add a large-scale gaussian to deal with the over-resolved mas flux
    g = modify(Gaussian(), Stretch(μas2rad(500.0), μas2rad(500.0)), Renormalize(ftot * fg))
    x, y = centroid(m)
    return shifted(m, -x, -y) + g
end
sky (generic function with 1 method)

Now, let's set up our image model. The EHT's nominal resolution is 20-25 μas. Additionally, the EHT is not very sensitive to a larger field of view. Typically 60-80 μas is enough to describe the compact flux of M87. Given this, we only need to use a small number of pixels to describe our image.

julia
npix = 48
fovx = μas2rad(200.0)
fovy = μas2rad(200.0)
9.69627362219072e-10

Now let's form our cache's. First, we have our usual image cache which is needed to numerically compute the visibilities.

julia
grid = imagepixels(fovx, fovy, npix, npix)
RectiGrid(
executor: ComradeBase.Serial()
Dimensions: 
(↓ X Sampled{Float64} LinRange{Float64}(-4.747133960864206e-10, 4.747133960864206e-10, 48) ForwardOrdered Regular Points,
→ Y Sampled{Float64} LinRange{Float64}(-4.747133960864206e-10, 4.747133960864206e-10, 48) ForwardOrdered Regular Points)
)

Since we are using a Gaussian Markov random field prior we need to first specify our mean image. This behaves somewhat similary to a entropy regularizer in that it will start with an initial guess for the image structure. For this tutorial we will use a a symmetric Gaussian with a FWHM of 50 μas

julia
fwhmfac = 2 * sqrt(2 * log(2))
mpr = modify(Gaussian(), Stretch(μas2rad(60.0) ./ fwhmfac))
mimg_raw = intensitymap(mpr, grid)
mimg = mimg_raw ./ Comrade.flux(mimg_raw)
┌ 48×48 IntensityMap{Float64, 2} ┐
├────────────────────────────────┴─────────────────────────────────────── dims ┐
  ↓ X Sampled{Float64} LinRange{Float64}(-4.747133960864206e-10, 4.747133960864206e-10, 48) ForwardOrdered Regular Points,
  → Y Sampled{Float64} LinRange{Float64}(-4.747133960864206e-10, 4.747133960864206e-10, 48) ForwardOrdered Regular Points
└──────────────────────────────────────────────────────────────────────────────┘
  ↓ →          -4.74713e-10  -4.54513e-10  -4.34312e-10  -4.14112e-10  -3.93911e-10  -3.73711e-10  -3.5351e-10  -3.33309e-10  -3.13109e-10  -2.92908e-10  -2.72708e-10  -2.52507e-10  -2.32307e-10  -2.12106e-10  -1.91905e-10  -1.71705e-10  -1.51504e-10  -1.31304e-10  -1.11103e-10  -9.09026e-11  -7.0702e-11   -5.05014e-11  -3.03009e-11  -1.01003e-11  1.01003e-11  3.03009e-11  5.05014e-11  7.0702e-11   9.09026e-11  1.11103e-10  1.31304e-10  1.51504e-10  1.71705e-10  1.91905e-10  2.12106e-10  2.32307e-10  2.52507e-10  2.72708e-10  2.92908e-10  3.13109e-10  3.33309e-10  3.5351e-10  3.73711e-10  3.93911e-10  4.14112e-10  4.34312e-10  4.54513e-10  4.74713e-10
 -4.74713e-10   1.64194e-9    3.03721e-9    5.46989e-9    9.59111e-9    1.63736e-8    2.72149e-8    4.40409e-8   6.9389e-8     1.06442e-7    1.58971e-7    2.3116e-7     3.27259e-7    4.51084e-7    6.05354e-7    7.90948e-7    1.00617e-6    1.24618e-6    1.50272e-6    1.76426e-6    2.01665e-6    2.24433e-6    2.4318e-6     2.5654e-6     2.63493e-6   2.63493e-6   2.5654e-6    2.4318e-6    2.24433e-6   2.01665e-6   1.76426e-6   1.50272e-6   1.24618e-6   1.00617e-6   7.90948e-7   6.05354e-7   4.51084e-7   3.27259e-7   2.3116e-7    1.58971e-7   1.06442e-7   6.9389e-8    4.40409e-8  2.72149e-8   1.63736e-8   9.59111e-9   5.46989e-9   3.03721e-9   1.64194e-9
 -4.54513e-10   3.03721e-9    5.61814e-9    1.0118e-8     1.77413e-8    3.02874e-8    5.03414e-8    8.14655e-8   1.28354e-7    1.96893e-7    2.9406e-7     4.27592e-7    6.05354e-7    8.34402e-7    1.11977e-6    1.46307e-6    1.86119e-6    2.30516e-6    2.77969e-6    3.26347e-6    3.73034e-6    4.15149e-6    4.49827e-6    4.7454e-6     4.87402e-6   4.87402e-6   4.7454e-6    4.49827e-6   4.15149e-6   3.73034e-6   3.26347e-6   2.77969e-6   2.30516e-6   1.86119e-6   1.46307e-6   1.11977e-6   8.34402e-7   6.05354e-7   4.27592e-7   2.9406e-7    1.96893e-7   1.28354e-7   8.14655e-8  5.03414e-8   3.02874e-8   1.77413e-8   1.0118e-8    5.61814e-9   3.03721e-9
 -4.34312e-10   5.46989e-9    1.0118e-8     1.82222e-8    3.19514e-8    5.45465e-8    9.06628e-8    1.46716e-7   2.3116e-7     3.54596e-7    5.29591e-7    7.70077e-7    1.09022e-6    1.50272e-6    2.01665e-6    2.63493e-6    3.35192e-6    4.15149e-6    5.00611e-6    5.87738e-6    6.7182e-6     7.47666e-6    8.1012e-6     8.54628e-6    8.7779e-6    8.7779e-6    8.54628e-6   8.1012e-6    7.47666e-6   6.7182e-6    5.87738e-6   5.00611e-6   4.15149e-6   3.35192e-6   2.63493e-6   2.01665e-6   1.50272e-6   1.09022e-6   7.70077e-7   5.29591e-7   3.54596e-7   2.3116e-7    1.46716e-7  9.06628e-8   5.45465e-8   3.19514e-8   1.82222e-8   1.0118e-8    5.46989e-9
 -4.14112e-10   9.59111e-9    1.77413e-8    3.19514e-8    5.60248e-8    9.56437e-8    1.58971e-7    2.57257e-7   4.05324e-7    6.21761e-7    9.28604e-7    1.35028e-6    1.91163e-6    2.63493e-6    3.53607e-6    4.62018e-6    5.87738e-6    7.27937e-6    8.7779e-6     1.03056e-5    1.17799e-5    1.31099e-5    1.42049e-5    1.49854e-5    1.53915e-5   1.53915e-5   1.49854e-5   1.42049e-5   1.31099e-5   1.17799e-5   1.03056e-5   8.7779e-6    7.27937e-6   5.87738e-6   4.62018e-6   3.53607e-6   2.63493e-6   1.91163e-6   1.35028e-6   9.28604e-7   6.21761e-7   4.05324e-7   2.57257e-7  1.58971e-7   9.56437e-8   5.60248e-8   3.19514e-8   1.77413e-8   9.59111e-9
 -3.93911e-10   1.63736e-8    3.02874e-8    5.45465e-8    9.56437e-8    1.6328e-7     2.71391e-7    4.39181e-7   6.91956e-7    1.06145e-6    1.58528e-6    2.30516e-6    3.26347e-6    4.49827e-6    6.03667e-6    7.88743e-6    1.00337e-5    1.24271e-5    1.49854e-5    1.75934e-5    2.01103e-5    2.23807e-5    2.42502e-5    2.55825e-5    2.62759e-5   2.62759e-5   2.55825e-5   2.42502e-5   2.23807e-5   2.01103e-5   1.75934e-5   1.49854e-5   1.24271e-5   1.00337e-5   7.88743e-6   6.03667e-6   4.49827e-6   3.26347e-6   2.30516e-6   1.58528e-6   1.06145e-6   6.91956e-7   4.39181e-7  2.71391e-7   1.6328e-7    9.56437e-8   5.45465e-8   3.02874e-8   1.63736e-8
 -3.73711e-10   2.72149e-8    5.03414e-8    9.06628e-8    1.58971e-7    2.71391e-7    4.51084e-7    7.29972e-7   1.15011e-6    1.76426e-6    2.63493e-6    3.83144e-6    5.42428e-6    7.47666e-6    1.00337e-5    1.31099e-5    1.66772e-5    2.06554e-5    2.49075e-5    2.92423e-5    3.34258e-5    3.71995e-5    4.03068e-5    4.25212e-5    4.36736e-5   4.36736e-5   4.25212e-5   4.03068e-5   3.71995e-5   3.34258e-5   2.92423e-5   2.49075e-5   2.06554e-5   1.66772e-5   1.31099e-5   1.00337e-5   7.47666e-6   5.42428e-6   3.83144e-6   2.63493e-6   1.76426e-6   1.15011e-6   7.29972e-7  4.51084e-7   2.71391e-7   1.58971e-7   9.06628e-8   5.03414e-8   2.72149e-8
 -3.5351e-10    4.40409e-8    8.14655e-8    1.46716e-7    2.57257e-7    4.39181e-7    7.29972e-7    1.18129e-6   1.86119e-6    2.85503e-6    4.26401e-6    6.20028e-6    8.7779e-6     1.20992e-5    1.62371e-5    2.12152e-5    2.6988e-5     3.34258e-5    4.03068e-5    4.73218e-5    5.40916e-5    6.01984e-5    6.52269e-5    6.88104e-5    7.06754e-5   7.06754e-5   6.88104e-5   6.52269e-5   6.01984e-5   5.40916e-5   4.73218e-5   4.03068e-5   3.34258e-5   2.6988e-5    2.12152e-5   1.62371e-5   1.20992e-5   8.7779e-6    6.20028e-6   4.26401e-6   2.85503e-6   1.86119e-6   1.18129e-6  7.29972e-7   4.39181e-7   2.57257e-7   1.46716e-7   8.14655e-8   4.40409e-8
 -3.33309e-10   6.9389e-8     1.28354e-7    2.3116e-7     4.05324e-7    6.91956e-7    1.15011e-6    1.86119e-6   2.93241e-6    4.49827e-6    6.7182e-6     9.76891e-6    1.38301e-5    1.9063e-5     2.55825e-5    3.34258e-5    4.25212e-5    5.26643e-5    6.35057e-5    7.45582e-5    8.52246e-5    9.48462e-5    0.000102769   0.000108415   0.000111353  0.000111353  0.000108415  0.000102769  9.48462e-5   8.52246e-5   7.45582e-5   6.35057e-5   5.26643e-5   4.25212e-5   3.34258e-5   2.55825e-5   1.9063e-5    1.38301e-5   9.76891e-6   6.7182e-6    4.49827e-6   2.93241e-6   1.86119e-6  1.15011e-6   6.91956e-7   4.05324e-7   2.3116e-7    1.28354e-7   6.9389e-8
 -3.13109e-10   1.06442e-7    1.96893e-7    3.54596e-7    6.21761e-7    1.06145e-6    1.76426e-6    2.85503e-6   4.49827e-6    6.90028e-6    1.03056e-5    1.49854e-5    2.12152e-5    2.92423e-5    3.92432e-5    5.12746e-5    6.52269e-5    8.07862e-5    9.74168e-5    0.000114371   0.000130733   0.000145493   0.000157646   0.000166307   0.000170814  0.000170814  0.000166307  0.000157646  0.000145493  0.000130733  0.000114371  9.74168e-5   8.07862e-5   6.52269e-5   5.12746e-5   3.92432e-5   2.92423e-5   2.12152e-5   1.49854e-5   1.03056e-5   6.90028e-6   4.49827e-6   2.85503e-6  1.76426e-6   1.06145e-6   6.21761e-7   3.54596e-7   1.96893e-7   1.06442e-7
 -2.92908e-10   1.58971e-7    2.9406e-7     5.29591e-7    9.28604e-7    1.58528e-6    2.63493e-6    4.26401e-6   6.7182e-6     1.03056e-5    1.53915e-5    2.23807e-5    3.1685e-5     4.36736e-5    5.861e-5      7.6579e-5     9.74168e-5    0.000120655   0.000145493   0.000170814   0.000195251   0.000217294   0.000235445   0.00024838    0.000255112  0.000255112  0.00024838   0.000235445  0.000217294  0.000195251  0.000170814  0.000145493  0.000120655  9.74168e-5   7.6579e-5    5.861e-5     4.36736e-5   3.1685e-5    2.23807e-5   1.53915e-5   1.03056e-5   6.7182e-6    4.26401e-6  2.63493e-6   1.58528e-6   9.28604e-7   5.29591e-7   2.9406e-7    1.58971e-7
 -2.72708e-10   2.3116e-7     4.27592e-7    7.70077e-7    1.35028e-6    2.30516e-6    3.83144e-6    6.20028e-6   9.76891e-6    1.49854e-5    2.23807e-5    3.25437e-5    4.60731e-5    6.35057e-5    8.52246e-5    0.000111353   0.000141653   0.000175444   0.00021156    0.00024838    0.000283914   0.000315967   0.00034236    0.000361169   0.000370958  0.000370958  0.000361169  0.00034236   0.000315967  0.000283914  0.00024838   0.00021156   0.000175444  0.000141653  0.000111353  8.52246e-5   6.35057e-5   4.60731e-5   3.25437e-5   2.23807e-5   1.49854e-5   9.76891e-6   6.20028e-6  3.83144e-6   2.30516e-6   1.35028e-6   7.70077e-7   4.27592e-7   2.3116e-7
 -2.52507e-10   3.27259e-7    6.05354e-7    1.09022e-6    1.91163e-6    3.26347e-6    5.42428e-6    8.7779e-6    1.38301e-5    2.12152e-5    3.1685e-5     4.60731e-5    6.52269e-5    8.99068e-5    0.000120655   0.000157646   0.000200543   0.00024838    0.000299512   0.000351639   0.000401944   0.000447323   0.000484688   0.000511317   0.000525175  0.000525175  0.000511317  0.000484688  0.000447323  0.000401944  0.000351639  0.000299512  0.00024838   0.000200543  0.000157646  0.000120655  8.99068e-5   6.52269e-5   4.60731e-5   3.1685e-5    2.12152e-5   1.38301e-5   8.7779e-6   5.42428e-6   3.26347e-6   1.91163e-6   1.09022e-6   6.05354e-7   3.27259e-7
 -2.32307e-10   4.51084e-7    8.34402e-7    1.50272e-6    2.63493e-6    4.49827e-6    7.47666e-6    1.20992e-5   1.9063e-5     2.92423e-5    4.36736e-5    6.35057e-5    8.99068e-5    0.000123925   0.000166307   0.000217294   0.000276422   0.00034236    0.000412838   0.000484688   0.000554028   0.000616576   0.00066808    0.000704784   0.000723885  0.000723885  0.000704784  0.00066808   0.000616576  0.000554028  0.000484688  0.000412838  0.00034236   0.000276422  0.000217294  0.000166307  0.000123925  8.99068e-5   6.35057e-5   4.36736e-5   2.92423e-5   1.9063e-5    1.20992e-5  7.47666e-6   4.49827e-6   2.63493e-6   1.50272e-6   8.34402e-7   4.51084e-7
 -2.12106e-10   6.05354e-7    1.11977e-6    2.01665e-6    3.53607e-6    6.03667e-6    1.00337e-5    1.62371e-5   2.55825e-5    3.92432e-5    5.861e-5      8.52246e-5    0.000120655   0.000166307   0.000223183   0.000291608   0.000370958   0.000459446   0.000554028   0.000650451   0.000743504   0.000827444   0.000896562   0.000945818   0.000971453  0.000971453  0.000945818  0.000896562  0.000827444  0.000743504  0.000650451  0.000554028  0.000459446  0.000370958  0.000291608  0.000223183  0.000166307  0.000120655  8.52246e-5   5.861e-5     3.92432e-5   2.55825e-5   1.62371e-5  1.00337e-5   6.03667e-6   3.53607e-6   2.01665e-6   1.11977e-6   6.05354e-7
 -1.91905e-10   7.90948e-7    1.46307e-6    2.63493e-6    4.62018e-6    7.88743e-6    1.31099e-5    2.12152e-5   3.34258e-5    5.12746e-5    7.6579e-5     0.000111353   0.000157646   0.000217294   0.000291608   0.000381012   0.000484688   0.000600306   0.000723885   0.00084987    0.000971453   0.00108113    0.00117144    0.00123579    0.00126929   0.00126929   0.00123579   0.00117144   0.00108113   0.000971453  0.00084987   0.000723885  0.000600306  0.000484688  0.000381012  0.000291608  0.000217294  0.000157646  0.000111353  7.6579e-5    5.12746e-5   3.34258e-5   2.12152e-5  1.31099e-5   7.88743e-6   4.62018e-6   2.63493e-6   1.46307e-6   7.90948e-7
 -1.71705e-10   1.00617e-6    1.86119e-6    3.35192e-6    5.87738e-6    1.00337e-5    1.66772e-5    2.6988e-5    4.25212e-5    6.52269e-5    9.74168e-5    0.000141653   0.000200543   0.000276422   0.000370958   0.000484688   0.000616576   0.000763655   0.000920861   0.00108113    0.00123579    0.00137531    0.00149019    0.00157206    0.00161467   0.00161467   0.00157206   0.00149019   0.00137531   0.00123579   0.00108113   0.000920861  0.000763655  0.000616576  0.000484688  0.000370958  0.000276422  0.000200543  0.000141653  9.74168e-5   6.52269e-5   4.25212e-5   2.6988e-5   1.66772e-5   1.00337e-5   5.87738e-6   3.35192e-6   1.86119e-6   1.00617e-6
 -1.51504e-10   1.24618e-6    2.30516e-6    4.15149e-6    7.27937e-6    1.24271e-5    2.06554e-5    3.34258e-5   5.26643e-5    8.07862e-5    0.000120655   0.000175444   0.00024838    0.00034236    0.000459446   0.000600306   0.000763655   0.000945818   0.00114052    0.00133902    0.00153058    0.00170338    0.00184567    0.00194707    0.00199984   0.00199984   0.00194707   0.00184567   0.00170338   0.00153058   0.00133902   0.00114052   0.000945818  0.000763655  0.000600306  0.000459446  0.00034236   0.00024838   0.000175444  0.000120655  8.07862e-5   5.26643e-5   3.34258e-5  2.06554e-5   1.24271e-5   7.27937e-6   4.15149e-6   2.30516e-6   1.24618e-6
 -1.31304e-10   1.50272e-6    2.77969e-6    5.00611e-6    8.7779e-6     1.49854e-5    2.49075e-5    4.03068e-5   6.35057e-5    9.74168e-5    0.000145493   0.00021156    0.000299512   0.000412838   0.000554028   0.000723885   0.000920861   0.00114052    0.00137531    0.00161467    0.00184567    0.00205404    0.00222561    0.00234789    0.00241152   0.00241152   0.00234789   0.00222561   0.00205404   0.00184567   0.00161467   0.00137531   0.00114052   0.000920861  0.000723885  0.000554028  0.000412838  0.000299512  0.00021156   0.000145493  9.74168e-5   6.35057e-5   4.03068e-5  2.49075e-5   1.49854e-5   8.7779e-6    5.00611e-6   2.77969e-6   1.50272e-6
 -1.11103e-10   1.76426e-6    3.26347e-6    5.87738e-6    1.03056e-5    1.75934e-5    2.92423e-5    4.73218e-5   7.45582e-5    0.000114371   0.000170814   0.00024838    0.000351639   0.000484688   0.000650451   0.00084987    0.00108113    0.00133902    0.00161467    0.00189569    0.00216689    0.00241152    0.00261296    0.00275651    0.00283122   0.00283122   0.00275651   0.00261296   0.00241152   0.00216689   0.00189569   0.00161467   0.00133902   0.00108113   0.00084987   0.000650451  0.000484688  0.000351639  0.00024838   0.000170814  0.000114371  7.45582e-5   4.73218e-5  2.92423e-5   1.75934e-5   1.03056e-5   5.87738e-6   3.26347e-6   1.76426e-6
 -9.09026e-11   2.01665e-6    3.73034e-6    6.7182e-6     1.17799e-5    2.01103e-5    3.34258e-5    5.40916e-5   8.52246e-5    0.000130733   0.000195251   0.000283914   0.000401944   0.000554028   0.000743504   0.000971453   0.00123579    0.00153058    0.00184567    0.00216689    0.00247688    0.00275651    0.00298677    0.00315086    0.00323626   0.00323626   0.00315086   0.00298677   0.00275651   0.00247688   0.00216689   0.00184567   0.00153058   0.00123579   0.000971453  0.000743504  0.000554028  0.000401944  0.000283914  0.000195251  0.000130733  8.52246e-5   5.40916e-5  3.34258e-5   2.01103e-5   1.17799e-5   6.7182e-6    3.73034e-6   2.01665e-6
 -7.0702e-11    2.24433e-6    4.15149e-6    7.47666e-6    1.31099e-5    2.23807e-5    3.71995e-5    6.01984e-5   9.48462e-5    0.000145493   0.000217294   0.000315967   0.000447323   0.000616576   0.000827444   0.00108113    0.00137531    0.00170338    0.00205404    0.00241152    0.00275651    0.00306772    0.00332397    0.00350659    0.00360162   0.00360162   0.00350659   0.00332397   0.00306772   0.00275651   0.00241152   0.00205404   0.00170338   0.00137531   0.00108113   0.000827444  0.000616576  0.000447323  0.000315967  0.000217294  0.000145493  9.48462e-5   6.01984e-5  3.71995e-5   2.23807e-5   1.31099e-5   7.47666e-6   4.15149e-6   2.24433e-6
 -5.05014e-11   2.4318e-6     4.49827e-6    8.1012e-6     1.42049e-5    2.42502e-5    4.03068e-5    6.52269e-5   0.000102769   0.000157646   0.000235445   0.00034236    0.000484688   0.00066808    0.000896562   0.00117144    0.00149019    0.00184567    0.00222561    0.00261296    0.00298677    0.00332397    0.00360162    0.0037995     0.00390247   0.00390247   0.0037995    0.00360162   0.00332397   0.00298677   0.00261296   0.00222561   0.00184567   0.00149019   0.00117144   0.000896562  0.00066808   0.000484688  0.00034236   0.000235445  0.000157646  0.000102769  6.52269e-5  4.03068e-5   2.42502e-5   1.42049e-5   8.1012e-6    4.49827e-6   2.4318e-6
 -3.03009e-11   2.5654e-6     4.7454e-6     8.54628e-6    1.49854e-5    2.55825e-5    4.25212e-5    6.88104e-5   0.000108415   0.000166307   0.00024838    0.000361169   0.000511317   0.000704784   0.000945818   0.00123579    0.00157206    0.00194707    0.00234789    0.00275651    0.00315086    0.00350659    0.0037995     0.00400824    0.00411687   0.00411687   0.00400824   0.0037995    0.00350659   0.00315086   0.00275651   0.00234789   0.00194707   0.00157206   0.00123579   0.000945818  0.000704784  0.000511317  0.000361169  0.00024838   0.000166307  0.000108415  6.88104e-5  4.25212e-5   2.55825e-5   1.49854e-5   8.54628e-6   4.7454e-6    2.5654e-6
 -1.01003e-11   2.63493e-6    4.87402e-6    8.7779e-6     1.53915e-5    2.62759e-5    4.36736e-5    7.06754e-5   0.000111353   0.000170814   0.000255112   0.000370958   0.000525175   0.000723885   0.000971453   0.00126929    0.00161467    0.00199984    0.00241152    0.00283122    0.00323626    0.00360162    0.00390247    0.00411687    0.00422845   0.00422845   0.00411687   0.00390247   0.00360162   0.00323626   0.00283122   0.00241152   0.00199984   0.00161467   0.00126929   0.000971453  0.000723885  0.000525175  0.000370958  0.000255112  0.000170814  0.000111353  7.06754e-5  4.36736e-5   2.62759e-5   1.53915e-5   8.7779e-6    4.87402e-6   2.63493e-6
  1.01003e-11   2.63493e-6    4.87402e-6    8.7779e-6     1.53915e-5    2.62759e-5    4.36736e-5    7.06754e-5   0.000111353   0.000170814   0.000255112   0.000370958   0.000525175   0.000723885   0.000971453   0.00126929    0.00161467    0.00199984    0.00241152    0.00283122    0.00323626    0.00360162    0.00390247    0.00411687    0.00422845   0.00422845   0.00411687   0.00390247   0.00360162   0.00323626   0.00283122   0.00241152   0.00199984   0.00161467   0.00126929   0.000971453  0.000723885  0.000525175  0.000370958  0.000255112  0.000170814  0.000111353  7.06754e-5  4.36736e-5   2.62759e-5   1.53915e-5   8.7779e-6    4.87402e-6   2.63493e-6
  3.03009e-11   2.5654e-6     4.7454e-6     8.54628e-6    1.49854e-5    2.55825e-5    4.25212e-5    6.88104e-5   0.000108415   0.000166307   0.00024838    0.000361169   0.000511317   0.000704784   0.000945818   0.00123579    0.00157206    0.00194707    0.00234789    0.00275651    0.00315086    0.00350659    0.0037995     0.00400824    0.00411687   0.00411687   0.00400824   0.0037995    0.00350659   0.00315086   0.00275651   0.00234789   0.00194707   0.00157206   0.00123579   0.000945818  0.000704784  0.000511317  0.000361169  0.00024838   0.000166307  0.000108415  6.88104e-5  4.25212e-5   2.55825e-5   1.49854e-5   8.54628e-6   4.7454e-6    2.5654e-6
  5.05014e-11   2.4318e-6     4.49827e-6    8.1012e-6     1.42049e-5    2.42502e-5    4.03068e-5    6.52269e-5   0.000102769   0.000157646   0.000235445   0.00034236    0.000484688   0.00066808    0.000896562   0.00117144    0.00149019    0.00184567    0.00222561    0.00261296    0.00298677    0.00332397    0.00360162    0.0037995     0.00390247   0.00390247   0.0037995    0.00360162   0.00332397   0.00298677   0.00261296   0.00222561   0.00184567   0.00149019   0.00117144   0.000896562  0.00066808   0.000484688  0.00034236   0.000235445  0.000157646  0.000102769  6.52269e-5  4.03068e-5   2.42502e-5   1.42049e-5   8.1012e-6    4.49827e-6   2.4318e-6
  7.0702e-11    2.24433e-6    4.15149e-6    7.47666e-6    1.31099e-5    2.23807e-5    3.71995e-5    6.01984e-5   9.48462e-5    0.000145493   0.000217294   0.000315967   0.000447323   0.000616576   0.000827444   0.00108113    0.00137531    0.00170338    0.00205404    0.00241152    0.00275651    0.00306772    0.00332397    0.00350659    0.00360162   0.00360162   0.00350659   0.00332397   0.00306772   0.00275651   0.00241152   0.00205404   0.00170338   0.00137531   0.00108113   0.000827444  0.000616576  0.000447323  0.000315967  0.000217294  0.000145493  9.48462e-5   6.01984e-5  3.71995e-5   2.23807e-5   1.31099e-5   7.47666e-6   4.15149e-6   2.24433e-6
  9.09026e-11   2.01665e-6    3.73034e-6    6.7182e-6     1.17799e-5    2.01103e-5    3.34258e-5    5.40916e-5   8.52246e-5    0.000130733   0.000195251   0.000283914   0.000401944   0.000554028   0.000743504   0.000971453   0.00123579    0.00153058    0.00184567    0.00216689    0.00247688    0.00275651    0.00298677    0.00315086    0.00323626   0.00323626   0.00315086   0.00298677   0.00275651   0.00247688   0.00216689   0.00184567   0.00153058   0.00123579   0.000971453  0.000743504  0.000554028  0.000401944  0.000283914  0.000195251  0.000130733  8.52246e-5   5.40916e-5  3.34258e-5   2.01103e-5   1.17799e-5   6.7182e-6    3.73034e-6   2.01665e-6
  1.11103e-10   1.76426e-6    3.26347e-6    5.87738e-6    1.03056e-5    1.75934e-5    2.92423e-5    4.73218e-5   7.45582e-5    0.000114371   0.000170814   0.00024838    0.000351639   0.000484688   0.000650451   0.00084987    0.00108113    0.00133902    0.00161467    0.00189569    0.00216689    0.00241152    0.00261296    0.00275651    0.00283122   0.00283122   0.00275651   0.00261296   0.00241152   0.00216689   0.00189569   0.00161467   0.00133902   0.00108113   0.00084987   0.000650451  0.000484688  0.000351639  0.00024838   0.000170814  0.000114371  7.45582e-5   4.73218e-5  2.92423e-5   1.75934e-5   1.03056e-5   5.87738e-6   3.26347e-6   1.76426e-6
  1.31304e-10   1.50272e-6    2.77969e-6    5.00611e-6    8.7779e-6     1.49854e-5    2.49075e-5    4.03068e-5   6.35057e-5    9.74168e-5    0.000145493   0.00021156    0.000299512   0.000412838   0.000554028   0.000723885   0.000920861   0.00114052    0.00137531    0.00161467    0.00184567    0.00205404    0.00222561    0.00234789    0.00241152   0.00241152   0.00234789   0.00222561   0.00205404   0.00184567   0.00161467   0.00137531   0.00114052   0.000920861  0.000723885  0.000554028  0.000412838  0.000299512  0.00021156   0.000145493  9.74168e-5   6.35057e-5   4.03068e-5  2.49075e-5   1.49854e-5   8.7779e-6    5.00611e-6   2.77969e-6   1.50272e-6
  1.51504e-10   1.24618e-6    2.30516e-6    4.15149e-6    7.27937e-6    1.24271e-5    2.06554e-5    3.34258e-5   5.26643e-5    8.07862e-5    0.000120655   0.000175444   0.00024838    0.00034236    0.000459446   0.000600306   0.000763655   0.000945818   0.00114052    0.00133902    0.00153058    0.00170338    0.00184567    0.00194707    0.00199984   0.00199984   0.00194707   0.00184567   0.00170338   0.00153058   0.00133902   0.00114052   0.000945818  0.000763655  0.000600306  0.000459446  0.00034236   0.00024838   0.000175444  0.000120655  8.07862e-5   5.26643e-5   3.34258e-5  2.06554e-5   1.24271e-5   7.27937e-6   4.15149e-6   2.30516e-6   1.24618e-6
  1.71705e-10   1.00617e-6    1.86119e-6    3.35192e-6    5.87738e-6    1.00337e-5    1.66772e-5    2.6988e-5    4.25212e-5    6.52269e-5    9.74168e-5    0.000141653   0.000200543   0.000276422   0.000370958   0.000484688   0.000616576   0.000763655   0.000920861   0.00108113    0.00123579    0.00137531    0.00149019    0.00157206    0.00161467   0.00161467   0.00157206   0.00149019   0.00137531   0.00123579   0.00108113   0.000920861  0.000763655  0.000616576  0.000484688  0.000370958  0.000276422  0.000200543  0.000141653  9.74168e-5   6.52269e-5   4.25212e-5   2.6988e-5   1.66772e-5   1.00337e-5   5.87738e-6   3.35192e-6   1.86119e-6   1.00617e-6
  1.91905e-10   7.90948e-7    1.46307e-6    2.63493e-6    4.62018e-6    7.88743e-6    1.31099e-5    2.12152e-5   3.34258e-5    5.12746e-5    7.6579e-5     0.000111353   0.000157646   0.000217294   0.000291608   0.000381012   0.000484688   0.000600306   0.000723885   0.00084987    0.000971453   0.00108113    0.00117144    0.00123579    0.00126929   0.00126929   0.00123579   0.00117144   0.00108113   0.000971453  0.00084987   0.000723885  0.000600306  0.000484688  0.000381012  0.000291608  0.000217294  0.000157646  0.000111353  7.6579e-5    5.12746e-5   3.34258e-5   2.12152e-5  1.31099e-5   7.88743e-6   4.62018e-6   2.63493e-6   1.46307e-6   7.90948e-7
  2.12106e-10   6.05354e-7    1.11977e-6    2.01665e-6    3.53607e-6    6.03667e-6    1.00337e-5    1.62371e-5   2.55825e-5    3.92432e-5    5.861e-5      8.52246e-5    0.000120655   0.000166307   0.000223183   0.000291608   0.000370958   0.000459446   0.000554028   0.000650451   0.000743504   0.000827444   0.000896562   0.000945818   0.000971453  0.000971453  0.000945818  0.000896562  0.000827444  0.000743504  0.000650451  0.000554028  0.000459446  0.000370958  0.000291608  0.000223183  0.000166307  0.000120655  8.52246e-5   5.861e-5     3.92432e-5   2.55825e-5   1.62371e-5  1.00337e-5   6.03667e-6   3.53607e-6   2.01665e-6   1.11977e-6   6.05354e-7
  2.32307e-10   4.51084e-7    8.34402e-7    1.50272e-6    2.63493e-6    4.49827e-6    7.47666e-6    1.20992e-5   1.9063e-5     2.92423e-5    4.36736e-5    6.35057e-5    8.99068e-5    0.000123925   0.000166307   0.000217294   0.000276422   0.00034236    0.000412838   0.000484688   0.000554028   0.000616576   0.00066808    0.000704784   0.000723885  0.000723885  0.000704784  0.00066808   0.000616576  0.000554028  0.000484688  0.000412838  0.00034236   0.000276422  0.000217294  0.000166307  0.000123925  8.99068e-5   6.35057e-5   4.36736e-5   2.92423e-5   1.9063e-5    1.20992e-5  7.47666e-6   4.49827e-6   2.63493e-6   1.50272e-6   8.34402e-7   4.51084e-7
  2.52507e-10   3.27259e-7    6.05354e-7    1.09022e-6    1.91163e-6    3.26347e-6    5.42428e-6    8.7779e-6    1.38301e-5    2.12152e-5    3.1685e-5     4.60731e-5    6.52269e-5    8.99068e-5    0.000120655   0.000157646   0.000200543   0.00024838    0.000299512   0.000351639   0.000401944   0.000447323   0.000484688   0.000511317   0.000525175  0.000525175  0.000511317  0.000484688  0.000447323  0.000401944  0.000351639  0.000299512  0.00024838   0.000200543  0.000157646  0.000120655  8.99068e-5   6.52269e-5   4.60731e-5   3.1685e-5    2.12152e-5   1.38301e-5   8.7779e-6   5.42428e-6   3.26347e-6   1.91163e-6   1.09022e-6   6.05354e-7   3.27259e-7
  2.72708e-10   2.3116e-7     4.27592e-7    7.70077e-7    1.35028e-6    2.30516e-6    3.83144e-6    6.20028e-6   9.76891e-6    1.49854e-5    2.23807e-5    3.25437e-5    4.60731e-5    6.35057e-5    8.52246e-5    0.000111353   0.000141653   0.000175444   0.00021156    0.00024838    0.000283914   0.000315967   0.00034236    0.000361169   0.000370958  0.000370958  0.000361169  0.00034236   0.000315967  0.000283914  0.00024838   0.00021156   0.000175444  0.000141653  0.000111353  8.52246e-5   6.35057e-5   4.60731e-5   3.25437e-5   2.23807e-5   1.49854e-5   9.76891e-6   6.20028e-6  3.83144e-6   2.30516e-6   1.35028e-6   7.70077e-7   4.27592e-7   2.3116e-7
  2.92908e-10   1.58971e-7    2.9406e-7     5.29591e-7    9.28604e-7    1.58528e-6    2.63493e-6    4.26401e-6   6.7182e-6     1.03056e-5    1.53915e-5    2.23807e-5    3.1685e-5     4.36736e-5    5.861e-5      7.6579e-5     9.74168e-5    0.000120655   0.000145493   0.000170814   0.000195251   0.000217294   0.000235445   0.00024838    0.000255112  0.000255112  0.00024838   0.000235445  0.000217294  0.000195251  0.000170814  0.000145493  0.000120655  9.74168e-5   7.6579e-5    5.861e-5     4.36736e-5   3.1685e-5    2.23807e-5   1.53915e-5   1.03056e-5   6.7182e-6    4.26401e-6  2.63493e-6   1.58528e-6   9.28604e-7   5.29591e-7   2.9406e-7    1.58971e-7
  3.13109e-10   1.06442e-7    1.96893e-7    3.54596e-7    6.21761e-7    1.06145e-6    1.76426e-6    2.85503e-6   4.49827e-6    6.90028e-6    1.03056e-5    1.49854e-5    2.12152e-5    2.92423e-5    3.92432e-5    5.12746e-5    6.52269e-5    8.07862e-5    9.74168e-5    0.000114371   0.000130733   0.000145493   0.000157646   0.000166307   0.000170814  0.000170814  0.000166307  0.000157646  0.000145493  0.000130733  0.000114371  9.74168e-5   8.07862e-5   6.52269e-5   5.12746e-5   3.92432e-5   2.92423e-5   2.12152e-5   1.49854e-5   1.03056e-5   6.90028e-6   4.49827e-6   2.85503e-6  1.76426e-6   1.06145e-6   6.21761e-7   3.54596e-7   1.96893e-7   1.06442e-7
  3.33309e-10   6.9389e-8     1.28354e-7    2.3116e-7     4.05324e-7    6.91956e-7    1.15011e-6    1.86119e-6   2.93241e-6    4.49827e-6    6.7182e-6     9.76891e-6    1.38301e-5    1.9063e-5     2.55825e-5    3.34258e-5    4.25212e-5    5.26643e-5    6.35057e-5    7.45582e-5    8.52246e-5    9.48462e-5    0.000102769   0.000108415   0.000111353  0.000111353  0.000108415  0.000102769  9.48462e-5   8.52246e-5   7.45582e-5   6.35057e-5   5.26643e-5   4.25212e-5   3.34258e-5   2.55825e-5   1.9063e-5    1.38301e-5   9.76891e-6   6.7182e-6    4.49827e-6   2.93241e-6   1.86119e-6  1.15011e-6   6.91956e-7   4.05324e-7   2.3116e-7    1.28354e-7   6.9389e-8
  3.5351e-10    4.40409e-8    8.14655e-8    1.46716e-7    2.57257e-7    4.39181e-7    7.29972e-7    1.18129e-6   1.86119e-6    2.85503e-6    4.26401e-6    6.20028e-6    8.7779e-6     1.20992e-5    1.62371e-5    2.12152e-5    2.6988e-5     3.34258e-5    4.03068e-5    4.73218e-5    5.40916e-5    6.01984e-5    6.52269e-5    6.88104e-5    7.06754e-5   7.06754e-5   6.88104e-5   6.52269e-5   6.01984e-5   5.40916e-5   4.73218e-5   4.03068e-5   3.34258e-5   2.6988e-5    2.12152e-5   1.62371e-5   1.20992e-5   8.7779e-6    6.20028e-6   4.26401e-6   2.85503e-6   1.86119e-6   1.18129e-6  7.29972e-7   4.39181e-7   2.57257e-7   1.46716e-7   8.14655e-8   4.40409e-8
  3.73711e-10   2.72149e-8    5.03414e-8    9.06628e-8    1.58971e-7    2.71391e-7    4.51084e-7    7.29972e-7   1.15011e-6    1.76426e-6    2.63493e-6    3.83144e-6    5.42428e-6    7.47666e-6    1.00337e-5    1.31099e-5    1.66772e-5    2.06554e-5    2.49075e-5    2.92423e-5    3.34258e-5    3.71995e-5    4.03068e-5    4.25212e-5    4.36736e-5   4.36736e-5   4.25212e-5   4.03068e-5   3.71995e-5   3.34258e-5   2.92423e-5   2.49075e-5   2.06554e-5   1.66772e-5   1.31099e-5   1.00337e-5   7.47666e-6   5.42428e-6   3.83144e-6   2.63493e-6   1.76426e-6   1.15011e-6   7.29972e-7  4.51084e-7   2.71391e-7   1.58971e-7   9.06628e-8   5.03414e-8   2.72149e-8
  3.93911e-10   1.63736e-8    3.02874e-8    5.45465e-8    9.56437e-8    1.6328e-7     2.71391e-7    4.39181e-7   6.91956e-7    1.06145e-6    1.58528e-6    2.30516e-6    3.26347e-6    4.49827e-6    6.03667e-6    7.88743e-6    1.00337e-5    1.24271e-5    1.49854e-5    1.75934e-5    2.01103e-5    2.23807e-5    2.42502e-5    2.55825e-5    2.62759e-5   2.62759e-5   2.55825e-5   2.42502e-5   2.23807e-5   2.01103e-5   1.75934e-5   1.49854e-5   1.24271e-5   1.00337e-5   7.88743e-6   6.03667e-6   4.49827e-6   3.26347e-6   2.30516e-6   1.58528e-6   1.06145e-6   6.91956e-7   4.39181e-7  2.71391e-7   1.6328e-7    9.56437e-8   5.45465e-8   3.02874e-8   1.63736e-8
  4.14112e-10   9.59111e-9    1.77413e-8    3.19514e-8    5.60248e-8    9.56437e-8    1.58971e-7    2.57257e-7   4.05324e-7    6.21761e-7    9.28604e-7    1.35028e-6    1.91163e-6    2.63493e-6    3.53607e-6    4.62018e-6    5.87738e-6    7.27937e-6    8.7779e-6     1.03056e-5    1.17799e-5    1.31099e-5    1.42049e-5    1.49854e-5    1.53915e-5   1.53915e-5   1.49854e-5   1.42049e-5   1.31099e-5   1.17799e-5   1.03056e-5   8.7779e-6    7.27937e-6   5.87738e-6   4.62018e-6   3.53607e-6   2.63493e-6   1.91163e-6   1.35028e-6   9.28604e-7   6.21761e-7   4.05324e-7   2.57257e-7  1.58971e-7   9.56437e-8   5.60248e-8   3.19514e-8   1.77413e-8   9.59111e-9
  4.34312e-10   5.46989e-9    1.0118e-8     1.82222e-8    3.19514e-8    5.45465e-8    9.06628e-8    1.46716e-7   2.3116e-7     3.54596e-7    5.29591e-7    7.70077e-7    1.09022e-6    1.50272e-6    2.01665e-6    2.63493e-6    3.35192e-6    4.15149e-6    5.00611e-6    5.87738e-6    6.7182e-6     7.47666e-6    8.1012e-6     8.54628e-6    8.7779e-6    8.7779e-6    8.54628e-6   8.1012e-6    7.47666e-6   6.7182e-6    5.87738e-6   5.00611e-6   4.15149e-6   3.35192e-6   2.63493e-6   2.01665e-6   1.50272e-6   1.09022e-6   7.70077e-7   5.29591e-7   3.54596e-7   2.3116e-7    1.46716e-7  9.06628e-8   5.45465e-8   3.19514e-8   1.82222e-8   1.0118e-8    5.46989e-9
  4.54513e-10   3.03721e-9    5.61814e-9    1.0118e-8     1.77413e-8    3.02874e-8    5.03414e-8    8.14655e-8   1.28354e-7    1.96893e-7    2.9406e-7     4.27592e-7    6.05354e-7    8.34402e-7    1.11977e-6    1.46307e-6    1.86119e-6    2.30516e-6    2.77969e-6    3.26347e-6    3.73034e-6    4.15149e-6    4.49827e-6    4.7454e-6     4.87402e-6   4.87402e-6   4.7454e-6    4.49827e-6   4.15149e-6   3.73034e-6   3.26347e-6   2.77969e-6   2.30516e-6   1.86119e-6   1.46307e-6   1.11977e-6   8.34402e-7   6.05354e-7   4.27592e-7   2.9406e-7    1.96893e-7   1.28354e-7   8.14655e-8  5.03414e-8   3.02874e-8   1.77413e-8   1.0118e-8    5.61814e-9   3.03721e-9
  4.74713e-10   1.64194e-9    3.03721e-9    5.46989e-9    9.59111e-9    1.63736e-8    2.72149e-8    4.40409e-8   6.9389e-8     1.06442e-7    1.58971e-7    2.3116e-7     3.27259e-7    4.51084e-7    6.05354e-7    7.90948e-7    1.00617e-6    1.24618e-6    1.50272e-6    1.76426e-6    2.01665e-6    2.24433e-6    2.4318e-6     2.5654e-6     2.63493e-6   2.63493e-6   2.5654e-6    2.4318e-6    2.24433e-6   2.01665e-6   1.76426e-6   1.50272e-6   1.24618e-6   1.00617e-6   7.90948e-7   6.05354e-7   4.51084e-7   3.27259e-7   2.3116e-7    1.58971e-7   1.06442e-7   6.9389e-8    4.40409e-8  2.72149e-8   1.63736e-8   9.59111e-9   5.46989e-9   3.03721e-9   1.64194e-9

To make the Gaussian Markov random field efficient we first precompute a bunch of quantities that allow us to scale things linearly with the number of image pixels. The returns a functional that accepts a single argument related to the correlation length of the field. The second argument defines the underlying random field of the Markov process. Here we are using a zero mean and unit variance Gaussian Markov random field. For this tutorial we will use the first order random field

julia
cprior = corr_image_prior(grid, dvis)
HierarchicalPrior(
	map: 
	ConditionalMarkov(
Random Field: VLBIImagePriors.GaussMarkovRandomField
Graph: MarkovRandomFieldGraph{1}(
dims: (48, 48)
)
)	hyper prior: 
	VLBIImagePriors.VLBITruncated{VLBIImagePriors.AffineDistribution{VLBIImagePriors.StdInverseGamma{Float64, Float64, 0}, 0, Float64, Float64}, Float64, Int64, Float64}(
untruncated: AffineDistribution(base=StdInverseGamma, loc::0.0, scale::27.594779864122227)
lower: 1.0
upper: 96
logtp: -0.2874456235859887
lcdf: 1.036905971756796e-12
)

)

Now we can construct our sky model. We fix the total flux to the observed value 1.1 because total flux is degenerate with a global shift in the gain amplitudes.

julia
skym = sky(grid; ftot = 1.1, mimg, cprior)
SkyModel
  with map: _sky_sky
   on grid: 
RectiGrid(
executor: ComradeBase.Serial()
Dimensions: 
(↓ X Sampled{Float64} LinRange{Float64}(-4.747133960864206e-10, 4.747133960864206e-10, 48) ForwardOrdered Regular Points,
→ Y Sampled{Float64} LinRange{Float64}(-4.747133960864206e-10, 4.747133960864206e-10, 48) ForwardOrdered Regular Points)
)
   )

Unlike other imaging examples (e.g., Imaging a Black Hole using only Closure Quantities) we also need to include a model for the instrument, i.e., gains. The gains will be broken into two components

  • Gain amplitudes which are typically known to 10-20%, except for LMT, which has amplitudes closer to 50-100%.

  • Gain phases which are more difficult to constrain and can shift rapidly.

julia
gain(x) = exp(complex(x.lg, x.gp))
G = SingleStokesGain(gain)

intpr = (
    lg = ArrayPrior(IIDSitePrior(IntegSeg(), VLBIGaussian(0.0, 0.2)); LM = IIDSitePrior(IntegSeg(), VLBIGaussian(0.0, 1.0))),
    gp = ArrayPrior(IIDSitePrior(IntegSeg(), DiagonalVonMises(0.0, inv(π^2))); refant = SEFDReference(0.0), phase = true),
)
intmodel = InstrumentModel(G, intpr)
InstrumentModel
  with Jones: SingleStokesGain
  with reference basis: PolarizedTypes.CirBasis()

To form the posterior we just combine the skymodel, instrument model and the data. To utilize gradients of the posterior we also need to load Enzyme.jl. Under the hood, Comrade will use Enzyme to compute the gradients of the posterior.

julia
using Enzyme
post = VLBIPosterior(skym, intmodel, dvis);

Optimization and Sampling

Now we need to actually compute our image. For this we will first follow standard approaches in VLBI and find the maximum a posteriori (MAP) estimate of the image and instrument model. This is done using the comrade_opt function which accepts the posterior, an optimization algorithm, and some keyword arguments. For this tutorial we will use the L-BFGS algorithm. For more information about the optimization algorithms available see the Optimization.jl docs.

julia
using Optimization, OptimizationLBFGSB
xopt, sol = comrade_opt(
    post, LBFGSB(); initial_params = prior_sample(rng, post),
    maxiters = 2000, g_tol = 1.0e-1
);

Warning

Fitting gains tends to be very difficult, meaning that optimization can take a lot longer. The upside is that we usually get nicer images.

First we will evaluate our fit by plotting the residuals

julia
using CairoMakie
using DisplayAs
res = residuals(post, xopt)
plotfields(res[1], :uvdist, :res) |> DisplayAs.PNG |> DisplayAs.Text

These look reasonable, although there may be some minor overfitting. This could be improved in a few ways, but that is beyond the goal of this quick tutorial. Plotting the image, we see that we have a much cleaner version of the closure-only image from Imaging a Black Hole using only Closure Quantities.

julia
g = imagepixels(fovx, fovy, 128, 128)
img = intensitymap(skymodel(post, xopt), g)
imageviz(img, size = (500, 400)) |> DisplayAs.PNG |> DisplayAs.Text

Because we also fit the instrument model, we can inspect their parameters. First, let's query the posterior object with the optimal parameters to get the instrument model.

julia
intopt = instrumentmodel(post, xopt)
126-element Comrade.SiteArray{ComplexF64, 1, Vector{ComplexF64}, Vector{Comrade.IntegrationTime{Int64, Float64}}, Vector{Comrade.FrequencyChannel{Float64, Int64}}, Vector{Symbol}}:
     1.0194149698644615 + 0.0im
    0.39629436307874133 + 0.9393082516102171im
     0.9906655503540619 + 0.0im
    -0.6099411155557873 - 0.8501430360271178im
     -0.533790460397759 + 0.675014807190648im
     0.5744314087126735 + 0.9084567051574268im
     0.9939955870654882 + 0.0im
    -0.6479549117664718 - 0.8149968223876796im
    -0.6944785939703911 + 0.7452925492771973im
     0.7159733412065584 + 0.7404074703654017im
     1.0024697766701856 + 0.0im
    -0.6721864077282113 - 0.78799285755897im
    -0.6772708219093921 + 0.6579787513998386im
     0.8191616416198213 + 0.5843951040490671im
     0.9746185809728105 + 0.0im
    -0.7301721867953626 - 0.7691881068631136im
    -0.7280487186066033 + 0.6282634816551356im
     0.8628202537862865 + 0.3939963255973343im
      1.037946429041495 + 0.0im
    -0.6903553983283301 + 0.14323999137147403im
    -0.7704268866524315 + 0.4307196476202504im
     1.0062630560225398 + 0.0im
    -0.7656787749309445 - 0.6964303618309334im
    -0.4895106446665266 + 0.42518050445787003im
     0.9806228919004402 + 0.06512008471040007im
     0.9903601942177825 + 0.0im
    -0.7908072220335937 - 0.6741752924326284im
   -0.45193079857262436 + 0.3979604505492692im
     1.0062770616708794 - 0.12365454725390092im
      1.006032329513344 + 0.0im
    -0.8063772849357643 - 0.6472647669953858im
   -0.44255260784803035 + 0.4181448339782816im
     0.9640062778054269 - 0.3238608519510708im
     0.9873380632154797 + 0.0im
    -0.8173509233731473 - 0.6496806553957951im
   -0.46912973414350406 + 0.9218304863983706im
   -0.37378336610260215 + 0.40607605767951443im
     0.8939139617825325 - 0.5545394540968129im
     0.9768679274266445 + 0.0im
    -0.8082981379529414 - 0.6846949501859956im
    -0.3109093961977663 + 0.933587891743353im
    -0.3728450613961328 + 0.49571969890809586im
     0.7186633899800228 - 0.7211021449298789im
     1.0202687549312206 + 0.0im
    -0.8042222102998816 - 0.6417463211046543im
   -0.13718436398864498 + 0.9989001132755043im
    -0.3651703225396846 + 0.6617719856519522im
     0.5768041992530322 - 0.9205009044761894im
     0.9751508134146272 + 0.0im
    -0.7620790273780003 - 0.7391016425740542im
    0.06518491239377404 + 0.9980801309024897im
      1.039229736973846 - 0.08851721777719632im
    -0.2605929810285385 + 0.6368325004360891im
    0.32762965389059234 - 1.070655374238208im
     1.0201479053412732 + 0.0im
    -0.7636416148255128 - 0.6677046123961774im
    0.29292252982792566 + 0.9600184087279812im
     1.0179412211250112 + 0.08478360120219046im
   -0.14015238280889727 + 0.6621919279971794im
   0.021936506526076743 - 1.126662352924943im
    0.40199259444495566 - 0.9291607684375144im
     0.9433255525643279 + 0.0im
    -0.7895296705347511 - 0.7435037273263925im
     0.4715270628696453 + 0.8795797412216334im
     0.9911572637639009 + 0.18913388606802647im
 -0.0023276655893367864 + 0.6373967621738343im
   -0.22886768583331835 - 1.2512999397250626im
    0.17973073700348613 - 0.995906017043409im
      0.879021349055426 + 0.0im
    -0.7851295133309352 - 0.8720994064004871im
     0.6071767101457445 + 0.779010526235592im
     0.9757990335076087 + 0.30253106146049097im
    0.14595234895119882 + 0.631859949551034im
   -0.36288394725451106 - 0.8905164012565095im
   -0.08888580937295085 - 1.022586746665532im
     0.9980503125960074 + 0.0im
     0.7793783047168352 + 0.6187820393709307im
       0.94682088976885 + 0.3736743415996706im
    0.35905364568330095 + 0.5403473875126216im
   -0.33946349989702845 - 0.9569357588470626im
     1.0596129047574063 + 0.0im
    -0.5996729056799369 - 0.7819271630966602im
     0.9406800011335105 + 0.3643298695222682im
     0.9349102567790555 + 0.45605152163228624im
     0.6624536164912685 + 0.14699996975538704im
     1.0209539514695554 + 0.0im
    -0.5675331281223922 - 0.8431666416200333im
      0.982514887243673 + 0.16183801019896857im
     0.9004122848097953 + 0.4730429826935546im
     0.5132939398797455 - 0.2538654092078535im
    -0.6180370378447684 - 0.7971963354997831im
     1.0891907860772239 + 0.0im
     1.0160009106747476 - 0.11064857894894221im
     0.8840130140673961 + 0.5089930928386717im
     0.3801070741907796 - 0.47237063928027345im
    -0.7268220592463941 - 0.7058042514080207im
     1.1104132827271487 + 0.0im
    -0.4779673170817764 - 0.8022562871865192im
     0.9243458466040847 - 0.39161051737407093im
     0.8703477495749091 + 0.5273870597628215im
    0.17902828683788938 - 0.4796385052976941im
    -0.8159647698486128 - 0.5972167354604676im
      1.000981821838196 + 0.0im
    -0.4421076171447896 - 0.9370832266647634im
     0.8167456312709179 - 0.6118335193627289im
     0.8615214982119513 + 0.5405592565715754im
    0.02776972019977889 - 0.5504167008105152im
    -0.8492306092887052 - 0.5637847426321801im
      0.994855379732027 + 0.0im
   -0.40708118347903893 - 0.9637268463062646im
     0.6396010115821095 - 0.7778101262110956im
     0.8594060345659175 + 0.544400929237443im
   -0.09954561432331771 - 0.6872683386790904im
    -0.8712628054130007 - 0.52920304284218im
     0.9677890355874412 + 0.0im
   -0.33221909288547347 - 1.0048491352627822im
     0.4479432176558646 - 0.8858947786592051im
     0.8652655494208742 + 0.5325893875579094im
   -0.21342207176652087 - 0.6368290335185357im
    -0.8500374387484013 - 0.5452126842023175im
     0.9873163679428959 + 0.0im
   -0.26797999206723894 - 1.0180178289842703im
     0.3314441354529008 - 0.8659587748446591im
     0.8656278980732433 + 0.5504823990877179im
    -0.2862330125276448 - 0.565920193629766im
    -0.8419513368733634 - 0.5546131604961483im

This returns a SiteArray object which contains the gains as a flat vector with metadata about the sites, time, and frequency. To visualize the gains we can use the plotcaltable function which automatically plots the gains. Since the gains are complex we will first plot the phases.

julia
plotcaltable(angle.(intopt)) |> DisplayAs.PNG |> DisplayAs.Text

Due to the a priori calibration of the data, the gain phases are quite stable and just drift over time. Note that the one outlier around 2.5 UT is when ALMA leaves the array. As a result we shift the reference antenna to APEX on that scan causing the gain phases to jump.

We can also plot the gain amplitudes

julia
plotcaltable(abs.(intopt)) |> DisplayAs.PNG |> DisplayAs.Text

Here we find relatively stable gains for most stations. The exception is LMT which has a large offset after 2.5 UT. This is a known issue with the LMT in 2017 and is due to pointing issues. However, we can see the power of simultaneous imaging and instrument modeling as we are able to solve for the gain amplitudes and get a reasonable image.

Why we should Sample from the Posterior

One problem with the MAP estimate is that it does not provide uncertainties on the image. That is we are unable to statistically assess which components of the image are certain. Comrade is really a Bayesian imaging and calibration package for VLBI. Therefore, our goal is to sample from the posterior distribution of the image and instrument model. This is a very high-dimensional distribution with typically 1,000 - 100,000 parameters. To sample from this very high dimensional distribution, Comrade has an array of samplers that can be used. However, note that Comrade also satisfies the LogDensityProblems.jl interface. Therefore, you can use any package that supports LogDensityProblems.jl if you have your own fancy sampler.

For this example, we will use HMC, specifically the NUTS algorithm. For However, due to the need to sample a large number of gain parameters, constructing the posterior can take a few minutes. Therefore, for this tutorial, we will only do a quick preliminary run.

julia
using AdvancedHMC
chain = sample(rng, post, NUTS(0.8), 700; n_adapts = 500, initial_params = xopt)
PosteriorSamples
  Samples size: (700,)
  sampler used: AHMC
                                      Mean
┌───────────────────────────────────────────────────────────────────────────────
│ sky                                                                          ⋯
│ @NamedTuple{c::@NamedTuple{params::Matrix{Float64}, hyperparams::Float64}, σ ⋯
├───────────────────────────────────────────────────────────────────────────────
│ (c = (params = [-0.00257275 0.00721389 … 0.0308513 0.0116402; 0.0090799 0.00 ⋯
└───────────────────────────────────────────────────────────────────────────────
                                                               2 columns omitted
                                   Std. Dev.
┌───────────────────────────────────────────────────────────────────────────────
│ sky                                                                          ⋯
│ @NamedTuple{c::@NamedTuple{params::Matrix{Float64}, hyperparams::Float64}, σ ⋯
├───────────────────────────────────────────────────────────────────────────────
│ (c = (params = [0.591044 0.592222 … 0.585773 0.559903; 0.585206 0.637549 … 0 ⋯
└───────────────────────────────────────────────────────────────────────────────
                                                               2 columns omitted

Note

The above sampler will store the samples in memory, i.e. RAM. For large models this can lead to out-of-memory issues. To avoid this we recommend using the saveto = DiskStore() kwargs which periodically saves the samples to disk limiting memory useage. You can load the chain using load_samples(diskout) where diskout is the object returned from sample.

Now we prune the adaptation phase

julia
chain = chain[(begin + 500):end]
PosteriorSamples
  Samples size: (200,)
  sampler used: AHMC
                                      Mean
┌───────────────────────────────────────────────────────────────────────────────
│ sky                                                                          ⋯
│ @NamedTuple{c::@NamedTuple{params::Matrix{Float64}, hyperparams::Float64}, σ ⋯
├───────────────────────────────────────────────────────────────────────────────
│ (c = (params = [-0.0212391 0.00172794 … -0.00874753 0.0216845; -0.0426867 -0 ⋯
└───────────────────────────────────────────────────────────────────────────────
                                                               2 columns omitted
                                   Std. Dev.
┌───────────────────────────────────────────────────────────────────────────────
│ sky                                                                          ⋯
│ @NamedTuple{c::@NamedTuple{params::Matrix{Float64}, hyperparams::Float64}, σ ⋯
├───────────────────────────────────────────────────────────────────────────────
│ (c = (params = [0.555239 0.638337 … 0.556656 0.544669; 0.529676 0.692644 … 0 ⋯
└───────────────────────────────────────────────────────────────────────────────
                                                               2 columns omitted

Warning

This should be run for likely an order of magnitude more steps to properly estimate expectations of the posterior

Now that we have our posterior, we can put error bars on all of our plots above. Let's start by finding the mean and standard deviation of the gain phases

julia
mchain = Comrade.rmap(mean, chain);
schain = Comrade.rmap(std, chain);

Now we can use the measurements package to automatically plot everything with error bars. First we create a caltable the same way but making sure all of our variables have errors attached to them.

julia
using Measurements
gmeas = instrumentmodel(post, (; instrument = map((x, y) -> Measurements.measurement.(x, y), mchain.instrument, schain.instrument)))
ctable_am = caltable(abs.(gmeas))
ctable_ph = caltable(angle.(gmeas))
┌─────────┬───────────────────┬─────────┬──────────────┬───────────┬────────────
│      Ti │                Fr │      AA │           AP │        AZ │         J ⋯
│     Any │               Any │     Any │          Any │       Any │        An ⋯
├─────────┼───────────────────┼─────────┼──────────────┼───────────┼────────────
│ 0.92 hr │ 227.070705664 GHz │ 0.0±0.0 │      missing │   missing │    missin ⋯
│ 1.22 hr │ 227.070705664 GHz │ 0.0±0.0 │  -2.19±0.018 │   missing │    missin ⋯
│ 1.52 hr │ 227.070705664 GHz │ 0.0±0.0 │ -2.239±0.019 │   missing │    missin ⋯
│ 1.82 hr │ 227.070705664 GHz │ 0.0±0.0 │ -2.275±0.021 │   missing │    missin ⋯
│ 2.12 hr │ 227.070705664 GHz │ 0.0±0.0 │ -2.331±0.019 │   missing │    missin ⋯
│ 2.45 hr │ 227.070705664 GHz │ missing │      0.0±0.0 │   missing │    missin ⋯
│ 2.75 hr │ 227.070705664 GHz │ 0.0±0.0 │ -2.402±0.017 │   missing │    missin ⋯
│ 3.05 hr │ 227.070705664 GHz │ 0.0±0.0 │ -2.435±0.019 │   missing │    missin ⋯
│ 3.35 hr │ 227.070705664 GHz │ 0.0±0.0 │ -2.465±0.016 │   missing │    missin ⋯
│ 3.68 hr │ 227.070705664 GHz │ 0.0±0.0 │ -2.469±0.017 │ 0.92±0.18 │    missin ⋯
│ 3.98 hr │ 227.070705664 GHz │ 0.0±0.0 │  -2.44±0.018 │ 0.79±0.18 │    missin ⋯
│ 4.28 hr │ 227.070705664 GHz │ 0.0±0.0 │ -2.468±0.019 │ 0.62±0.18 │    missin ⋯
│ 4.58 hr │ 227.070705664 GHz │ 0.0±0.0 │ -2.371±0.022 │ 0.44±0.18 │ -1.07±0.1 ⋯
│ 4.92 hr │ 227.070705664 GHz │ 0.0±0.0 │ -2.425±0.019 │ 0.23±0.18 │ -0.95±0.1 ⋯
│ 5.18 hr │ 227.070705664 GHz │ 0.0±0.0 │ -2.386±0.017 │ 0.04±0.18 │ -0.86±0.1 ⋯
│       ⋮ │                 ⋮ │       ⋮ │            ⋮ │         ⋮ │           ⋱
└─────────┴───────────────────┴─────────┴──────────────┴───────────┴────────────
                                                   4 columns and 10 rows omitted

Now let's plot the phase curves

julia
plotcaltable(ctable_ph) |> DisplayAs.PNG |> DisplayAs.Text

and now the amplitude curves

julia
plotcaltable(ctable_am) |> DisplayAs.PNG |> DisplayAs.Text

Finally let's construct some representative image reconstructions.

julia
samples = skymodel.(Ref(post), chain[begin:5:end])
imgs = intensitymap.(samples, Ref(g))

mimg = mean(imgs)
simg = std(imgs)
fig = Figure(; size = (700, 700));
axs = [Axis(fig[i, j], xreversed = true, aspect = 1) for i in 1:2, j in 1:2]
image!(axs[1, 1], mimg, colormap = :afmhot); axs[1, 1].title = "Mean"
image!(axs[1, 2], simg ./ (max.(mimg, 1.0e-8)), colorrange = (0.0, 2.0), colormap = :afmhot);axs[1, 2].title = "Frac. Uncer."
image!(axs[2, 1], imgs[1], colormap = :afmhot);
image!(axs[2, 2], imgs[end], colormap = :afmhot);
hidedecorations!.(axs)
fig |> DisplayAs.PNG |> DisplayAs.Text

And viola, you have just finished making a preliminary image and instrument model reconstruction. In reality, you should run the sample step for many more MCMC steps to get a reliable estimate for the reconstructed image and instrument model parameters.


This page was generated using Literate.jl.