Comrade API
Contents
Index
Comrade.AbstractInterferometryDatum
Comrade.ArrayBaselineDatum
Comrade.ArrayConfiguration
Comrade.CalPrior
Comrade.CalPrior
Comrade.CalPrior
Comrade.CalTable
Comrade.ClosureConfig
Comrade.ClosurePhases
Comrade.Coherencies
Comrade.ComplexVisibilities
Comrade.DesignMatrix
Comrade.EHTArrayConfiguration
Comrade.EHTClosurePhaseDatum
Comrade.EHTCoherencyDatum
Comrade.EHTLogClosureAmplitudeDatum
Comrade.EHTObservation
Comrade.EHTVisibilityAmplitudeDatum
Comrade.EHTVisibilityDatum
Comrade.FixedSeg
Comrade.GainSchema
Comrade.IntegSeg
Comrade.IsCube
Comrade.IsFlat
Comrade.JonesCache
Comrade.JonesModel
Comrade.JonesPairs
Comrade.LogClosureAmplitudes
Comrade.MultiRadioLikelihood
Comrade.ObsSegmentation
Comrade.Posterior
Comrade.RIMEModel
Comrade.RadioLikelihood
Comrade.RandomReference
Comrade.SEFDReference
Comrade.Scan
Comrade.ScanSeg
Comrade.ScanTable
Comrade.SingleReference
Comrade.TrackSeg
Comrade.TransformCache
Comrade.TransformedPosterior
Comrade.VLBIModel
Comrade.VisibilityAmplitudes
VLBISkyModels.DFTAlg
VLBISkyModels.DFTAlg
VLBISkyModels.NFFTAlg
VLBISkyModels.NFFTAlg
Base.map
Comrade.arrayconfig
Comrade.baselines
Comrade.caltable
Comrade.caltable
Comrade.caltable
Comrade.corrupt
Comrade.dataproducts
Comrade.dirty_beam
Comrade.dirty_image
Comrade.extract_FRs
Comrade.extract_amp
Comrade.extract_cphase
Comrade.extract_lcamp
Comrade.extract_table
Comrade.extract_vis
Comrade.getdata
Comrade.getuv
Comrade.getuvtimefreq
Comrade.instrumentmodel
Comrade.jonesD
Comrade.jonesG
Comrade.jonesStokes
Comrade.jonesT
Comrade.jonescache
Comrade.likelihood
Comrade.prior_sample
Comrade.scantable
Comrade.simulate_observation
Comrade.skymodel
Comrade.station_tuple
Comrade.stations
Comrade.uvpositions
Comrade.vlbimodel
ComradeBase.amplitude
ComradeBase.amplitude
ComradeBase.closure_phase
HypercubeTransform.ascube
HypercubeTransform.asflat
ParameterHandling.flatten
PolarizedTypes.evpa
PolarizedTypes.linearpol
PolarizedTypes.mbreve
PolarizedTypes.m̆
StatsBase.sample
TransformVariables.inverse
TransformVariables.transform
VLBISkyModels.PoincareSphere2Map
Model Definitions
Calibration Models
Comrade.corrupt
— Functioncorrupt(vis, j1, j2)
Corrupts the model coherency matrices with the Jones matrices j1
for station 1 and j2
for station 2.
Comrade.CalTable
— Typestruct CalTable{T, G<:(AbstractVecOrMat)}
A Tabes of calibration quantities. The columns of the table are the telescope station codes. The rows are the calibration quantities at a specific time stamp. This user should not use this struct directly. Instead that should call caltable
.
Comrade.caltable
— Methodcaltable(g::JonesCache, jterms::AbstractVector)
Convert the JonesCache g
and recovered Jones/corruption elements jterms
into a CalTable
which satisfies the Tables.jl
interface.
Example
ct = caltable(gcache, gains)
+Comrade API · Comrade.jl Comrade API
Contents
Index
Comrade.AbstractInterferometryDatum
Comrade.ArrayBaselineDatum
Comrade.ArrayConfiguration
Comrade.CalPrior
Comrade.CalPrior
Comrade.CalPrior
Comrade.CalTable
Comrade.ClosureConfig
Comrade.ClosurePhases
Comrade.Coherencies
Comrade.ComplexVisibilities
Comrade.DesignMatrix
Comrade.EHTArrayConfiguration
Comrade.EHTClosurePhaseDatum
Comrade.EHTCoherencyDatum
Comrade.EHTLogClosureAmplitudeDatum
Comrade.EHTObservation
Comrade.EHTVisibilityAmplitudeDatum
Comrade.EHTVisibilityDatum
Comrade.FixedSeg
Comrade.GainSchema
Comrade.IntegSeg
Comrade.IsCube
Comrade.IsFlat
Comrade.JonesCache
Comrade.JonesModel
Comrade.JonesPairs
Comrade.LogClosureAmplitudes
Comrade.MultiRadioLikelihood
Comrade.ObsSegmentation
Comrade.Posterior
Comrade.RIMEModel
Comrade.RadioLikelihood
Comrade.RandomReference
Comrade.SEFDReference
Comrade.Scan
Comrade.ScanSeg
Comrade.ScanTable
Comrade.SingleReference
Comrade.TrackSeg
Comrade.TransformCache
Comrade.TransformedPosterior
Comrade.VLBIModel
Comrade.VisibilityAmplitudes
VLBISkyModels.DFTAlg
VLBISkyModels.DFTAlg
VLBISkyModels.NFFTAlg
VLBISkyModels.NFFTAlg
Base.map
Comrade.arrayconfig
Comrade.baselines
Comrade.caltable
Comrade.caltable
Comrade.caltable
Comrade.corrupt
Comrade.dataproducts
Comrade.dirty_beam
Comrade.dirty_image
Comrade.extract_FRs
Comrade.extract_amp
Comrade.extract_cphase
Comrade.extract_lcamp
Comrade.extract_table
Comrade.extract_vis
Comrade.getdata
Comrade.getuv
Comrade.getuvtimefreq
Comrade.instrumentmodel
Comrade.jonesD
Comrade.jonesG
Comrade.jonesStokes
Comrade.jonesT
Comrade.jonescache
Comrade.likelihood
Comrade.prior_sample
Comrade.scantable
Comrade.simulate_observation
Comrade.skymodel
Comrade.station_tuple
Comrade.stations
Comrade.uvpositions
Comrade.vlbimodel
ComradeBase.amplitude
ComradeBase.amplitude
ComradeBase.closure_phase
HypercubeTransform.ascube
HypercubeTransform.asflat
ParameterHandling.flatten
PolarizedTypes.evpa
PolarizedTypes.linearpol
PolarizedTypes.mbreve
PolarizedTypes.m̆
StatsBase.sample
TransformVariables.inverse
TransformVariables.transform
VLBISkyModels.PoincareSphere2Map
Model Definitions
Calibration Models
Comrade.corrupt
— Functioncorrupt(vis, j1, j2)
Corrupts the model coherency matrices with the Jones matrices j1
for station 1 and j2
for station 2.
sourceComrade.CalTable
— Typestruct CalTable{T, G<:(AbstractVecOrMat)}
A Tabes of calibration quantities. The columns of the table are the telescope station codes. The rows are the calibration quantities at a specific time stamp. This user should not use this struct directly. Instead that should call caltable
.
sourceComrade.caltable
— Methodcaltable(g::JonesCache, jterms::AbstractVector)
Convert the JonesCache g
and recovered Jones/corruption elements jterms
into a CalTable
which satisfies the Tables.jl
interface.
Example
ct = caltable(gcache, gains)
# Access a particular station (here ALMA)
ct[:AA]
ct.AA
# Access a the first row
-ct[1, :]
sourceComrade.caltable
— Methodcaltable(obs::EHTObservation, gains::AbstractVector)
Create a calibration table for the observations obs
with gains
. This returns a CalTable
object that satisfies the Tables.jl
interface. This table is very similar to the DataFrames
interface.
Example
ct = caltable(obs, gains)
+ct[1, :]
sourceComrade.caltable
— Methodcaltable(obs::EHTObservation, gains::AbstractVector)
Create a calibration table for the observations obs
with gains
. This returns a CalTable
object that satisfies the Tables.jl
interface. This table is very similar to the DataFrames
interface.
Example
ct = caltable(obs, gains)
# Access a particular station (here ALMA)
ct[:AA]
ct.AA
# Access a the first row
-ct[1, :]
sourceComrade.DesignMatrix
— Typestruct DesignMatrix{X, M<:AbstractArray{X, 2}, T, S} <: AbstractArray{X, 2}
Internal type that holds the gain design matrices for visibility corruption.
sourceComrade.JonesCache
— Typestruct JonesCache{D1, D2, S, Sc, R} <: Comrade.AbstractJonesCache
Holds the ancillary information for a the design matrix cache for Jones matrices. That is, it defines the cached map that moves from model visibilities to the corrupted voltages that are measured from the telescope.
Fields
m1
: Design matrix for the first station
m2
: Design matrix for the second station
seg
: Segmentation schemes for this cache
schema
: Gain Schema
references
: List of Reference stations
sourceComrade.TransformCache
— Typestruct TransformCache{M, B<:PolBasis} <: Comrade.AbstractJonesCache
Holds various transformations that move from the measured telescope basis to the chosen on sky reference basis.
Fields
T1
: Transform matrices for the first stations
T2
: Transform matrices for the second stations
refbasis
: Reference polarization basis
sourceComrade.JonesModel
— TypeJonesModel(jones::JonesPairs, refbasis = CirBasis())
-JonesModel(jones::JonesPairs, tcache::TransformCache)
Constructs the intrument corruption model using pairs of jones matrices jones
and a reference basis
sourceComrade.VLBIModel
— TypeVLBIModel(skymodel, instrumentmodel)
Constructs a VLBIModel
from a jones
pairs that describe the intrument model and the model
which describes the on-sky polarized visibilities. The third argument can either be the tcache
that converts from the model coherency basis to the instrumental basis, or just the refbasis
that will be used when constructing the model coherency matrices.
sourceComrade.CalPrior
— TypeCalPrior(dists, cache::JonesCache, reference=:none)
Creates a distribution for the gain priors for gain cache cache
. The dists
should be a NamedTuple of Distributions
, where each name corresponds to a telescope or station in the observation. The resulting type is a subtype of the Distributions.AbstractDistribution
so the usual Distributions
interface should work.
Example
For the 2017 observations of M87 a common CalPrior call is:
julia> gdist = CalPrior((AA = LogNormal(0.0, 0.1),
+ct[1, :]
sourceComrade.DesignMatrix
— Typestruct DesignMatrix{X, M<:AbstractArray{X, 2}, T, S} <: AbstractArray{X, 2}
Internal type that holds the gain design matrices for visibility corruption.
sourceComrade.JonesCache
— Typestruct JonesCache{D1, D2, S, Sc, R} <: Comrade.AbstractJonesCache
Holds the ancillary information for a the design matrix cache for Jones matrices. That is, it defines the cached map that moves from model visibilities to the corrupted voltages that are measured from the telescope.
Fields
m1
: Design matrix for the first station
m2
: Design matrix for the second station
seg
: Segmentation schemes for this cache
schema
: Gain Schema
references
: List of Reference stations
sourceComrade.TransformCache
— Typestruct TransformCache{M, B<:PolBasis} <: Comrade.AbstractJonesCache
Holds various transformations that move from the measured telescope basis to the chosen on sky reference basis.
Fields
T1
: Transform matrices for the first stations
T2
: Transform matrices for the second stations
refbasis
: Reference polarization basis
sourceComrade.JonesModel
— TypeJonesModel(jones::JonesPairs, refbasis = CirBasis())
+JonesModel(jones::JonesPairs, tcache::TransformCache)
Constructs the intrument corruption model using pairs of jones matrices jones
and a reference basis
sourceComrade.VLBIModel
— TypeVLBIModel(skymodel, instrumentmodel)
Constructs a VLBIModel
from a jones
pairs that describe the intrument model and the model
which describes the on-sky polarized visibilities. The third argument can either be the tcache
that converts from the model coherency basis to the instrumental basis, or just the refbasis
that will be used when constructing the model coherency matrices.
sourceComrade.CalPrior
— TypeCalPrior(dists, cache::JonesCache, reference=:none)
Creates a distribution for the gain priors for gain cache cache
. The dists
should be a NamedTuple of Distributions
, where each name corresponds to a telescope or station in the observation. The resulting type is a subtype of the Distributions.AbstractDistribution
so the usual Distributions
interface should work.
Example
For the 2017 observations of M87 a common CalPrior call is:
julia> gdist = CalPrior((AA = LogNormal(0.0, 0.1),
AP = LogNormal(0.0, 0.1),
JC = LogNormal(0.0, 0.1),
SM = LogNormal(0.0, 0.1),
@@ -24,8 +24,8 @@
), cache)
julia> x = rand(gdist)
-julia> logdensityof(gdist, x)
sourceCalPrior(dist0::NamedTuple, dist_transition::NamedTuple, jcache::SegmentedJonesCache)
Constructs a calibration prior in two steps. The first two arguments have to be a named tuple of distributions, where each name corresponds to a site. The first argument is gain prior for the first time stamp. The second argument is the segmented gain prior for each subsequent time stamp. For instance, if we have
dist0 = (AA = Normal(0.0, 1.0), )
-distt = (AA = Normal(0.0, 0.1), )
then the gain prior for first time stamp that AA obserserves will be Normal(0.0, 1.0)
. The next time stamp gain is the construted from
g2 = g1 + ϵ1
where ϵ1 ~ Normal(0.0, 0.1) = distt.AA
, and g1
is the gain from the first time stamp. In other words distt
is the uncorrelated transition probability when moving from timestamp i to timestamp i+1. For the typical pre-calibrated dataset the gain prior on distt
can be tighter than the prior on dist0
.
sourceComrade.CalPrior
— MethodCalPrior(dists, cache::JonesCache, reference=:none)
Creates a distribution for the gain priors for gain cache cache
. The dists
should be a NamedTuple of Distributions
, where each name corresponds to a telescope or station in the observation. The resulting type is a subtype of the Distributions.AbstractDistribution
so the usual Distributions
interface should work.
Example
For the 2017 observations of M87 a common CalPrior call is:
julia> gdist = CalPrior((AA = LogNormal(0.0, 0.1),
+julia> logdensityof(gdist, x)
sourceCalPrior(dist0::NamedTuple, dist_transition::NamedTuple, jcache::SegmentedJonesCache)
Constructs a calibration prior in two steps. The first two arguments have to be a named tuple of distributions, where each name corresponds to a site. The first argument is gain prior for the first time stamp. The second argument is the segmented gain prior for each subsequent time stamp. For instance, if we have
dist0 = (AA = Normal(0.0, 1.0), )
+distt = (AA = Normal(0.0, 0.1), )
then the gain prior for first time stamp that AA obserserves will be Normal(0.0, 1.0)
. The next time stamp gain is the construted from
g2 = g1 + ϵ1
where ϵ1 ~ Normal(0.0, 0.1) = distt.AA
, and g1
is the gain from the first time stamp. In other words distt
is the uncorrelated transition probability when moving from timestamp i to timestamp i+1. For the typical pre-calibrated dataset the gain prior on distt
can be tighter than the prior on dist0
.
sourceComrade.CalPrior
— MethodCalPrior(dists, cache::JonesCache, reference=:none)
Creates a distribution for the gain priors for gain cache cache
. The dists
should be a NamedTuple of Distributions
, where each name corresponds to a telescope or station in the observation. The resulting type is a subtype of the Distributions.AbstractDistribution
so the usual Distributions
interface should work.
Example
For the 2017 observations of M87 a common CalPrior call is:
julia> gdist = CalPrior((AA = LogNormal(0.0, 0.1),
AP = LogNormal(0.0, 0.1),
JC = LogNormal(0.0, 0.1),
SM = LogNormal(0.0, 0.1),
@@ -35,32 +35,32 @@
), cache)
julia> x = rand(gdist)
-julia> logdensityof(gdist, x)
sourceComrade.CalPrior
— MethodCalPrior(dist0::NamedTuple, dist_transition::NamedTuple, jcache::SegmentedJonesCache)
Constructs a calibration prior in two steps. The first two arguments have to be a named tuple of distributions, where each name corresponds to a site. The first argument is gain prior for the first time stamp. The second argument is the segmented gain prior for each subsequent time stamp. For instance, if we have
dist0 = (AA = Normal(0.0, 1.0), )
-distt = (AA = Normal(0.0, 0.1), )
then the gain prior for first time stamp that AA obserserves will be Normal(0.0, 1.0)
. The next time stamp gain is the construted from
g2 = g1 + ϵ1
where ϵ1 ~ Normal(0.0, 0.1) = distt.AA
, and g1
is the gain from the first time stamp. In other words distt
is the uncorrelated transition probability when moving from timestamp i to timestamp i+1. For the typical pre-calibrated dataset the gain prior on distt
can be tighter than the prior on dist0
.
sourceComrade.RIMEModel
— Typeabstract type RIMEModel <: ComradeBase.AbstractModel
Abstract type that encompasses all RIME style corruptions.
sourceComrade.ObsSegmentation
— Typeabstract type ObsSegmentation
The data segmentation scheme to use. This is important for constructing a JonesCache
sourceComrade.IntegSeg
— Typestruct IntegSeg{S} <: Comrade.ObsSegmentation
Data segmentation such that the quantity is constant over a correlation integration.
sourceComrade.ScanSeg
— Typestruct ScanSeg{S} <: Comrade.ObsSegmentation
Data segmentation such that the quantity is constant over a scan
.
Warning
Currently we do not explicity track the telescope scans. This will be fixed in a future version. Right now ScanSeg
and TrackSeg
are the same
sourceComrade.TrackSeg
— Typestruct TrackSeg <: Comrade.ObsSegmentation
Data segmentation such that the quantity is constant over a track
, i.e., the observation "night".
sourceComrade.FixedSeg
— Typestruct FixedSeg{T} <: Comrade.ObsSegmentation
Enforces that the station calibraton value will have a fixed value
. This is most commonly used when enforcing a reference station for gain phases.
sourceComrade.jonescache
— Methodjonescache(obs::EHTObservation, segmentation::ObsSegmentation)
+julia> logdensityof(gdist, x)
sourceComrade.CalPrior
— MethodCalPrior(dist0::NamedTuple, dist_transition::NamedTuple, jcache::SegmentedJonesCache)
Constructs a calibration prior in two steps. The first two arguments have to be a named tuple of distributions, where each name corresponds to a site. The first argument is gain prior for the first time stamp. The second argument is the segmented gain prior for each subsequent time stamp. For instance, if we have
dist0 = (AA = Normal(0.0, 1.0), )
+distt = (AA = Normal(0.0, 0.1), )
then the gain prior for first time stamp that AA obserserves will be Normal(0.0, 1.0)
. The next time stamp gain is the construted from
g2 = g1 + ϵ1
where ϵ1 ~ Normal(0.0, 0.1) = distt.AA
, and g1
is the gain from the first time stamp. In other words distt
is the uncorrelated transition probability when moving from timestamp i to timestamp i+1. For the typical pre-calibrated dataset the gain prior on distt
can be tighter than the prior on dist0
.
sourceComrade.RIMEModel
— Typeabstract type RIMEModel <: ComradeBase.AbstractModel
Abstract type that encompasses all RIME style corruptions.
sourceComrade.ObsSegmentation
— Typeabstract type ObsSegmentation
The data segmentation scheme to use. This is important for constructing a JonesCache
sourceComrade.IntegSeg
— Typestruct IntegSeg{S} <: Comrade.ObsSegmentation
Data segmentation such that the quantity is constant over a correlation integration.
sourceComrade.ScanSeg
— Typestruct ScanSeg{S} <: Comrade.ObsSegmentation
Data segmentation such that the quantity is constant over a scan
.
Warning
Currently we do not explicity track the telescope scans. This will be fixed in a future version. Right now ScanSeg
and TrackSeg
are the same
sourceComrade.TrackSeg
— Typestruct TrackSeg <: Comrade.ObsSegmentation
Data segmentation such that the quantity is constant over a track
, i.e., the observation "night".
sourceComrade.FixedSeg
— Typestruct FixedSeg{T} <: Comrade.ObsSegmentation
Enforces that the station calibraton value will have a fixed value
. This is most commonly used when enforcing a reference station for gain phases.
sourceComrade.jonescache
— Methodjonescache(obs::EHTObservation, segmentation::ObsSegmentation)
jonescache(obs::EHTObservatoin, segmentation::NamedTuple)
Constructs a JonesCache
from a given observation obs
using the segmentation scheme segmentation
. If segmentation
is a named tuple it is assumed that each symbol in the named tuple corresponds to a segmentation for thes sites in obs
.
Example
# coh is a EHTObservation
julia> jonescache(coh, ScanSeg())
julia> segs = (AA = ScanSeg(), AP = TrachSeg(), AZ=FixedSegSeg())
-julia> jonescache(coh, segs)
sourceComrade.SingleReference
— TypeSingleReference(site::Symbol, val::Number)
Use a single site as a reference. The station gain will be set equal to val
.
sourceComrade.RandomReference
— TypeRandomReference(val::Number)
For each timestamp select a random reference station whose station gain will be set to val
.
Notes
This is useful when there isn't a single site available for all scans and you want to split up the choice of reference site. We recommend only using this option for Stokes I fitting.
sourceComrade.SEFDReference
— TypeSiteOrderReference(val::Number, sefd_index = 1)
Selects the reference site based on the SEFD of each telescope, where the smallest SEFD is preferentially selected. The reference gain is set to val
and the user can select to use the n
lowest SEFD site by passing sefd_index = n
.
Notes
This is done on a per-scan basis so if a site is missing from a scan the next highest SEFD site will be used.
sourceComrade.jonesStokes
— FunctionjonesStokes(g1::AbstractArray, gcache::AbstractJonesCache)
-jonesStokes(f, g1::AbstractArray, gcache::AbstractJonesCache)
Construct the Jones Pairs for the stokes I image only. That is, we only need to pass a single vector corresponding to the gain for the stokes I visibility. This is for when you only want to image Stokes I. The first argument is optional and denotes a function that is applied to every element of jones cache. For instance if g1
and g2
are the log-gains then f=exp
will convert them into the gains.
Warning
In the future this functionality may be removed when stokes I fitting is replaced with the more correct trace(coherency)
, i.e. RR+LL for a circular basis.
sourceComrade.jonesG
— FunctionjonesG(g1::AbstractVector, g2::AbstractVector, jcache::AbstractJonesCache)
+julia> jonescache(coh, segs)
sourceComrade.SingleReference
— TypeSingleReference(site::Symbol, val::Number)
Use a single site as a reference. The station gain will be set equal to val
.
sourceComrade.RandomReference
— TypeRandomReference(val::Number)
For each timestamp select a random reference station whose station gain will be set to val
.
Notes
This is useful when there isn't a single site available for all scans and you want to split up the choice of reference site. We recommend only using this option for Stokes I fitting.
sourceComrade.SEFDReference
— TypeSiteOrderReference(val::Number, sefd_index = 1)
Selects the reference site based on the SEFD of each telescope, where the smallest SEFD is preferentially selected. The reference gain is set to val
and the user can select to use the n
lowest SEFD site by passing sefd_index = n
.
Notes
This is done on a per-scan basis so if a site is missing from a scan the next highest SEFD site will be used.
sourceComrade.jonesStokes
— FunctionjonesStokes(g1::AbstractArray, gcache::AbstractJonesCache)
+jonesStokes(f, g1::AbstractArray, gcache::AbstractJonesCache)
Construct the Jones Pairs for the stokes I image only. That is, we only need to pass a single vector corresponding to the gain for the stokes I visibility. This is for when you only want to image Stokes I. The first argument is optional and denotes a function that is applied to every element of jones cache. For instance if g1
and g2
are the log-gains then f=exp
will convert them into the gains.
Warning
In the future this functionality may be removed when stokes I fitting is replaced with the more correct trace(coherency)
, i.e. RR+LL for a circular basis.
sourceComrade.jonesG
— FunctionjonesG(g1::AbstractVector, g2::AbstractVector, jcache::AbstractJonesCache)
jonesG(f, g1::AbstractVector, g2::AbstractVector, jcache::AbstractJonesCache)
Constructs the pairs Jones G
matrices for each pair of stations. The g1
are the gains for the first polarization basis and g2
are the gains for the other polarization. The first argument is optional and denotes a function that is applied to every element of jones cache. For instance if g1
and g2
are the log-gains then f=exp
will convert them into the gains.
The layout for each matrix is as follows:
g1 0
- 0 g2
sourceComrade.jonesD
— FunctionjonesD(d1::AbstractVector, d2::AbstractVector, jcache::AbstractJonesCache)
+ 0 g2
sourceComrade.jonesD
— FunctionjonesD(d1::AbstractVector, d2::AbstractVector, jcache::AbstractJonesCache)
jonesD(f, d1::AbstractVector, d2::AbstractVector, jcache::AbstractJonesCache)
Constructs the pairs Jones D
matrices for each pair of stations. The d1
are the d-termsfor the first polarization basis and d2
are the d-terms for the other polarization. The first argument is optional and denotes a function that is applied to every element of jones cache. For instance if d1
and d2
are the log-dterms then f=exp
will convert them into the dterms.
The layout for each matrix is as follows:
1 d1
- d2 1
sourceComrade.jonesT
— FunctionjonesT(tcache::TransformCache)
Returns a JonesPair
of matrices that transform from the model coherency matrices basis to the on-sky coherency basis, this includes the feed rotation and choice of polarization feeds.
sourceBase.map
— Methodmap(f, args::JonesPairs...) -> JonesPairs
Maps over a set of JonesPairs
applying the function f to each element. This returns a collected JonesPair. This us useful for more advanced operations on Jones matrices.
Examples
map(G, D, F) do g, d, f
+ d2 1
sourceComrade.jonesT
— FunctionjonesT(tcache::TransformCache)
Returns a JonesPair
of matrices that transform from the model coherency matrices basis to the on-sky coherency basis, this includes the feed rotation and choice of polarization feeds.
sourceBase.map
— Methodmap(f, args::JonesPairs...) -> JonesPairs
Maps over a set of JonesPairs
applying the function f to each element. This returns a collected JonesPair. This us useful for more advanced operations on Jones matrices.
Examples
map(G, D, F) do g, d, f
return f'*exp.(g)*d*f
-end
sourceVLBISkyModels.PoincareSphere2Map
— FunctionPoincareSphere2Map(I, p, X, grid)
-PoincareSphere2Map(I::IntensityMap, p, X)
Constructs an polarized intensity map model using the Poincare parameterization. The arguments are:
I
is a grid of fluxes for each pixel.p
is a grid of numbers between 0, 1 and the represent the total fractional polarizationX
is a grid, where each element is 3 numbers that represents the point on the Poincare sphere that is, X[1,1] is a NTuple{3} such that ||X[1,1]|| == 1
.grid
is the dimensional grid that gives the pixels locations of the intensity map.
Note If I
is an IntensityMap
then grid is not required since the same grid that was use for I
will be used to construct the polarized intensity map
Warning The return type for this function is a polarized image object, however what we return is not considered to be part of the stable API so it may change suddenly.
Comrade.caltable
— Functioncaltable(args...)
Creates a calibration table from a set of arguments. The specific arguments depend on what calibration you are applying.
sourceComrade.JonesPairs
— Typestruct JonesPairs{T, M1<:AbstractArray{T, 1}, M2<:AbstractArray{T, 1}}
Holds the pairs of Jones matrices for the first and second station of a baseline.
Fields
m1
: Vector of jones matrices for station 1
m2
: Vector of jones matrices for station 2
sourceComrade.GainSchema
— TypeGainSchema(sites, times)
Constructs a schema for the gains of an observation. The sites
and times
correspond to the specific site and time for each gain that will be modeled.
sourceModels
VLBISkyModels.DFTAlg
— MethodDFTAlg(ac::ArrayConfiguration)
Create an algorithm object using the direct Fourier transform object from the array configuration ac
. This will extract the uv positions from the observation to allow for a more efficient FT cache.
sourceVLBISkyModels.DFTAlg
— MethodDFTAlg(obs::EHTObservation)
Create an algorithm object using the direct Fourier transform object from the observation obs
. This will extract the uv positions from the observation to allow for a more efficient FT cache.
sourceVLBISkyModels.NFFTAlg
— MethodNFFTAlg(ac::ArrayConfiguration; kwargs...)
Create an algorithm object using the non-unform Fourier transform object from the array configuration ac
. This will extract the uv positions from the observation to allow for a more efficient FT cache.
The optional arguments are: padfac
specifies how much to pad the image by, and m
is an internal variable for NFFT.jl
.
sourceVLBISkyModels.NFFTAlg
— MethodNFFTAlg(obs::EHTObservation; kwargs...)
Create an algorithm object using the non-unform Fourier transform object from the observation obs
. This will extract the uv positions from the observation to allow for a more efficient FT cache.
The possible optional arguments are given in the NFFTAlg
struct.
sourcePolarized Models
PolarizedTypes.mbreve
— Functionmbreve(pimg, p)
+end
sourceVLBISkyModels.PoincareSphere2Map
— FunctionPoincareSphere2Map(I, p, X, grid)
+PoincareSphere2Map(I::IntensityMap, p, X)
Constructs an polarized intensity map model using the Poincare parameterization. The arguments are:
I
is a grid of fluxes for each pixel.p
is a grid of numbers between 0, 1 and the represent the total fractional polarizationX
is a grid, where each element is 3 numbers that represents the point on the Poincare sphere that is, X[1,1] is a NTuple{3} such that ||X[1,1]|| == 1
.grid
is the dimensional grid that gives the pixels locations of the intensity map.
Note If I
is an IntensityMap
then grid is not required since the same grid that was use for I
will be used to construct the polarized intensity map
Warning The return type for this function is a polarized image object, however what we return is not considered to be part of the stable API so it may change suddenly.
Comrade.caltable
— Functioncaltable(args...)
Creates a calibration table from a set of arguments. The specific arguments depend on what calibration you are applying.
sourceComrade.JonesPairs
— Typestruct JonesPairs{T, M1<:AbstractArray{T, 1}, M2<:AbstractArray{T, 1}}
Holds the pairs of Jones matrices for the first and second station of a baseline.
Fields
m1
: Vector of jones matrices for station 1
m2
: Vector of jones matrices for station 2
sourceComrade.GainSchema
— TypeGainSchema(sites, times)
Constructs a schema for the gains of an observation. The sites
and times
correspond to the specific site and time for each gain that will be modeled.
sourceModels
VLBISkyModels.DFTAlg
— MethodDFTAlg(ac::ArrayConfiguration)
Create an algorithm object using the direct Fourier transform object from the array configuration ac
. This will extract the uv positions from the observation to allow for a more efficient FT cache.
sourceVLBISkyModels.DFTAlg
— MethodDFTAlg(obs::EHTObservation)
Create an algorithm object using the direct Fourier transform object from the observation obs
. This will extract the uv positions from the observation to allow for a more efficient FT cache.
sourceVLBISkyModels.NFFTAlg
— MethodNFFTAlg(ac::ArrayConfiguration; kwargs...)
Create an algorithm object using the non-unform Fourier transform object from the array configuration ac
. This will extract the uv positions from the observation to allow for a more efficient FT cache.
The optional arguments are: padfac
specifies how much to pad the image by, and m
is an internal variable for NFFT.jl
.
sourceVLBISkyModels.NFFTAlg
— MethodNFFTAlg(obs::EHTObservation; kwargs...)
Create an algorithm object using the non-unform Fourier transform object from the observation obs
. This will extract the uv positions from the observation to allow for a more efficient FT cache.
The possible optional arguments are given in the NFFTAlg
struct.
sourcePolarized Models
PolarizedTypes.mbreve
— Functionmbreve(pimg, p)
Explicit m̆ function used for convenience.
PolarizedTypes.m̆
— Functionm̆(pimg::AbstractPolarizedModel, p)
mbreve(pimg::AbstractPolarizedModel, p)
Computes the fractional linear polarization in the visibility domain
m̆ = (Q + iU)/I
To create the symbol type m\breve
in the REPL or use the mbreve
function.
m̆(m)
Compute the fractional linear polarization of a stokes vector or coherency matrix
PolarizedTypes.evpa
— Functionevpa(pimg::AbstractPolarizedModel, p)
electric vector position angle or EVPA of the polarized model pimg
at u
and v
evpa(m)
Compute the evpa of a stokes vector or cohereny matrix.
PolarizedTypes.linearpol
— Functionlinearpol(s)
Computes linearpol
from a set of stokes parameters s
.
Data Types
Comrade.extract_table
— Functionextract_table(obs, dataproducts::VLBIDataProducts)
Extract an Comrade.EHTObservation
table of data products dataproducts
. To pass additional keyword for the data products you can pass them as keyword arguments to the data product type. For a list of potential data products see subtypes(Comrade.VLBIDataProducts)
.
Example
julia> dlcamp, dcphase = extract_table(obs, LogClosureAmplitudes(;snrcut=3.0), ClosurePhases(;snrcut=3.0, cut_trivial=true))
julia> dcoh = extract_table(obs, Coherencies())
-julia> dvis = extract_table(obs, VisibilityAmplitudes())
sourceComrade.ComplexVisibilities
— TypeComplexVisibilities(;kwargs...)
Type to specify to extract the complex visibilities table in the extract_table
function. Optional keywords are passed through extract_table
to specify additional option.
Special keywords for eht-imaging with Pyehtim.jl
Any keyword arguments are ignored for now. Use eht-imaging directly to modify the data.
sourceComrade.VisibilityAmplitudes
— TypeComplexVisibilities(;kwargs...)
Type to specify to extract the log closure amplitudes table in the extract_table
function. Optional keywords are passed through extract_table
to specify additional option.
Special keywords for eht-imaging with Pyehtim.jl
For a list of potential keyword arguments see eht-imaging
and add_amp
command for obsdata.
sourceComrade.ClosurePhases
— TypeClosuresPhases(;kwargs...)
Type to specify to extract the closure phase table in the extract_table
function. Optional keywords are passed through extract_table
to specify additional option.
Special keywords for eht-imaging with Pyehtim.jl
For a list of potential keyword arguments see eht-imaging
and add_cphase
command for obsdata. In addition note we have changed the following:
- count: How the closures are formed, the available options are "min-correct", "min", "max"
Warning
The count
keyword argument is treated specially in Comrade
. The default option is "min-correct" and should almost always be used. This option construct a minimal set of closure phases that is valid even when the array isn't fully connected. For testing and legacy reasons we ehtim
other count options are also included. However, the current ehtim
count="min" option is broken and does construct proper minimal sets of closure quantities if the array isn't fully connected.
sourceComrade.LogClosureAmplitudes
— TypeLogClosureAmplitudes(;kwargs...)
Type to specify to extract the log closure amplitudes table in the extract_table
function. Optional keywords are passed through extract_table
to specify additional option.
Special keywords for eht-imaging with Pyehtim.jl
For a list of potential keyword arguments see eht-imaging
and add_cphase
command for obsdata. In addition note we have changed the following:
- count: How the closures are formed, the available options are "min-correct", "min", "max"
Returns an EHTObservation with log-closure amp. datums
Warning
The count
keyword argument is treated specially in Comrade
. The default option is "min-correct" and should almost always be used. This option construct a minimal set of closure phases that is valid even when the array isn't fully connected. For testing and legacy reasons we ehtim
other count options are also included. However, the current ehtim
count="min" option is broken and does construct proper minimal sets of closure quantities if the array isn't fully connected.
sourceComrade.Coherencies
— TypeCoherencies(;kwargs...)
Type to specify to extract the coherency matrices table in the extract_table
function. Optional keywords are passed through extract_table
to specify additional option.
Special keywords for eht-imaging with Pyehtim.jl
Any keyword arguments are ignored for now. Use eht-imaging directly to modify the data.
sourceComradeBase.amplitude
— Methodamplitude(d::EHTVisibilityDatum)
Get the amplitude of a visibility datum
sourceComradeBase.amplitude
— Methodamplitude(d::EHTVisibilityAmplitudeDatum)
Get the amplitude of a amplitude datum
sourceComrade.baselines
— Functionbaselines(CP::EHTClosurePhaseDatum)
Returns the baselines used for a single closure phase datum
sourcebaselines(CP::EHTLogClosureAmplitudeDatum)
Returns the baselines used for a single closure phase datum
sourcebaselines(scan::Scan)
Return the baselines for each datum in a scan
sourceComrade.arrayconfig
— Functionarrayconfig(vis)
-
Extract the array configuration from a EHT observation.
sourceComradeBase.closure_phase
— Methodclosure_phase(D1::EHTVisibilityDatum,
+julia> dvis = extract_table(obs, VisibilityAmplitudes())
sourceComrade.ComplexVisibilities
— TypeComplexVisibilities(;kwargs...)
Type to specify to extract the complex visibilities table in the extract_table
function. Optional keywords are passed through extract_table
to specify additional option.
Special keywords for eht-imaging with Pyehtim.jl
Any keyword arguments are ignored for now. Use eht-imaging directly to modify the data.
sourceComrade.VisibilityAmplitudes
— TypeComplexVisibilities(;kwargs...)
Type to specify to extract the log closure amplitudes table in the extract_table
function. Optional keywords are passed through extract_table
to specify additional option.
Special keywords for eht-imaging with Pyehtim.jl
For a list of potential keyword arguments see eht-imaging
and add_amp
command for obsdata.
sourceComrade.ClosurePhases
— TypeClosuresPhases(;kwargs...)
Type to specify to extract the closure phase table in the extract_table
function. Optional keywords are passed through extract_table
to specify additional option.
Special keywords for eht-imaging with Pyehtim.jl
For a list of potential keyword arguments see eht-imaging
and add_cphase
command for obsdata. In addition note we have changed the following:
- count: How the closures are formed, the available options are "min-correct", "min", "max"
Warning
The count
keyword argument is treated specially in Comrade
. The default option is "min-correct" and should almost always be used. This option construct a minimal set of closure phases that is valid even when the array isn't fully connected. For testing and legacy reasons we ehtim
other count options are also included. However, the current ehtim
count="min" option is broken and does construct proper minimal sets of closure quantities if the array isn't fully connected.
sourceComrade.LogClosureAmplitudes
— TypeLogClosureAmplitudes(;kwargs...)
Type to specify to extract the log closure amplitudes table in the extract_table
function. Optional keywords are passed through extract_table
to specify additional option.
Special keywords for eht-imaging with Pyehtim.jl
For a list of potential keyword arguments see eht-imaging
and add_cphase
command for obsdata. In addition note we have changed the following:
- count: How the closures are formed, the available options are "min-correct", "min", "max"
Returns an EHTObservation with log-closure amp. datums
Warning
The count
keyword argument is treated specially in Comrade
. The default option is "min-correct" and should almost always be used. This option construct a minimal set of closure phases that is valid even when the array isn't fully connected. For testing and legacy reasons we ehtim
other count options are also included. However, the current ehtim
count="min" option is broken and does construct proper minimal sets of closure quantities if the array isn't fully connected.
sourceComrade.Coherencies
— TypeCoherencies(;kwargs...)
Type to specify to extract the coherency matrices table in the extract_table
function. Optional keywords are passed through extract_table
to specify additional option.
Special keywords for eht-imaging with Pyehtim.jl
Any keyword arguments are ignored for now. Use eht-imaging directly to modify the data.
sourceComradeBase.amplitude
— Methodamplitude(d::EHTVisibilityDatum)
Get the amplitude of a visibility datum
sourceComradeBase.amplitude
— Methodamplitude(d::EHTVisibilityAmplitudeDatum)
Get the amplitude of a amplitude datum
sourceComrade.baselines
— Functionbaselines(CP::EHTClosurePhaseDatum)
Returns the baselines used for a single closure phase datum
sourcebaselines(CP::EHTLogClosureAmplitudeDatum)
Returns the baselines used for a single closure phase datum
sourcebaselines(scan::Scan)
Return the baselines for each datum in a scan
sourceComrade.arrayconfig
— Functionarrayconfig(vis)
+
Extract the array configuration from a EHT observation.
sourceComradeBase.closure_phase
— Methodclosure_phase(D1::EHTVisibilityDatum,
D2::EHTVisibilityDatum,
D3::EHTVisibilityDatum
- )
Computes the closure phase of the three visibility datums.
Notes
We currently use the high SNR Gaussian error approximation for the closure phase. In the future we may use the moment matching from Monte Carlo sampling.
sourceComrade.getdata
— Functiongetdata(obs::EHTObservation, s::Symbol)
Pass-through function that gets the array of s
from the EHTObservation. For example say you want the times of all measurement then
getdata(obs, :time)
sourceComrade.getuv
— Functiongetuv
Get the u, v positions of the array.
sourceComrade.getuvtimefreq
— Functiongetuvtimefreq(ac)
-
Get the u, v, time, freq of the array as a tuple.
sourceComrade.scantable
— Functionscantable(obs::EHTObservation)
Reorganizes the observation into a table of scans, where scan are defined by unique timestamps. To access the data you can use scalar indexing
Example
st = scantable(obs)
+ )
Computes the closure phase of the three visibility datums.
Notes
We currently use the high SNR Gaussian error approximation for the closure phase. In the future we may use the moment matching from Monte Carlo sampling.
sourceComrade.getdata
— Functiongetdata(obs::EHTObservation, s::Symbol)
Pass-through function that gets the array of s
from the EHTObservation. For example say you want the times of all measurement then
getdata(obs, :time)
sourceComrade.getuv
— Functiongetuv
Get the u, v positions of the array.
sourceComrade.getuvtimefreq
— Functiongetuvtimefreq(ac)
+
Get the u, v, time, freq of the array as a tuple.
sourceComrade.scantable
— Functionscantable(obs::EHTObservation)
Reorganizes the observation into a table of scans, where scan are defined by unique timestamps. To access the data you can use scalar indexing
Example
st = scantable(obs)
# Grab the first scan
scan1 = st[1]
@@ -68,21 +68,21 @@
scan1[1]
# grab e.g. the baselines
-scan1[:baseline]
sourceComrade.stations
— Functionstations(d::EHTObservation)
Get all the stations in a observation. The result is a vector of symbols.
sourcestations(g::CalTable)
Return the stations in the calibration table
sourceComrade.uvpositions
— Functionuvpositions(datum::AbstractVisibilityDatum)
Get the uvp positions of an inferometric datum.
sourceComrade.ArrayConfiguration
— Typeabstract type ArrayConfiguration
This defined the abstract type for an array configuration. Namely, baseline times, SEFD's, bandwidth, observation frequencies, etc.
sourceComrade.ClosureConfig
— Typestruct ClosureConfig{A, D} <: Comrade.ArrayConfiguration
Array config file for closure quantities. This stores the design matrix designmat
that transforms from visibilties to closure products.
Fields
ac
: Array configuration for visibilities
designmat
: Closure design matrix
sourceComrade.AbstractInterferometryDatum
— Typeabstract type AbstractInterferometryDatum{T}
An abstract type for all VLBI interfermetry data types. See Comrade.EHTVisibilityDatum for an example.
sourceComrade.ArrayBaselineDatum
— Typestruct ArrayBaselineDatum{T, E, V}
A single datum of an ArrayConfiguration
sourceComrade.EHTObservation
— Typestruct EHTObservation{F, T<:Comrade.AbstractInterferometryDatum{F}, S<:(StructArrays.StructArray{T<:Comrade.AbstractInterferometryDatum{F}}), A, N} <: Comrade.Observation{F}
The main data product type in Comrade
this stores the data
which can be a StructArray of any AbstractInterferometryDatum
type.
Fields
data
: StructArray of data productts
config
: Array config holds ancillary information about array
mjd
: modified julia date of the observation
ra
: RA of the observation in J2000 (deg)
dec
: DEC of the observation in J2000 (deg)
bandwidth
: bandwidth of the observation (Hz)
source
: Common source name
timetype
: Time zone used.
sourceComrade.EHTArrayConfiguration
— Typestruct EHTArrayConfiguration{F, T, S, D<:AbstractArray} <: Comrade.ArrayConfiguration
Stores all the non-visibility data products for an EHT array. This is useful when evaluating model visibilities.
Fields
bandwidth
: Observing bandwith (Hz)
tarr
: Telescope array file
scans
: Scan times
data
: A struct array of ArrayBaselineDatum
holding time, freq, u, v, baselines.
sourceComrade.EHTCoherencyDatum
— Typestruct EHTCoherencyDatum{S, B1, B2, M<:(StaticArraysCore.SArray{Tuple{2, 2}, Complex{S}, 2}), E<:(StaticArraysCore.SArray{Tuple{2, 2}, S, 2})} <: Comrade.AbstractInterferometryDatum{S}
A Datum for a single coherency matrix
Fields
measurement
: coherency matrix, with entries in Jy
error
: visibility uncertainty matrix, with entries in Jy
U
: x-direction baseline length, in λ
V
: y-direction baseline length, in λ
T
: Timestamp, in hours
F
: Frequency, in Hz
baseline
: station baseline codes
polbasis
: polarization basis for each station
sourceComrade.EHTClosurePhaseDatum
— Typestruct EHTClosurePhaseDatum{S<:Number} <: Comrade.ClosureProducts{S<:Number}
A Datum for a single closure phase.
Fields
measurement
: closure phase (rad)
error
: error of the closure phase assuming the high-snr limit
U1
: u (λ) of first station
V1
: v (λ) of first station
U2
: u (λ) of second station
V2
: v (λ) of second station
U3
: u (λ) of third station
V3
: v (λ) of third station
T
: Measured time of closure phase in hours
F
: Measured frequency of closure phase in Hz
triangle
: station baselines used
sourceComrade.EHTLogClosureAmplitudeDatum
— Typestruct EHTLogClosureAmplitudeDatum{S<:Number} <: Comrade.ClosureProducts{S<:Number}
A Datum for a single log closure amplitude.
measurement
: log-closure amplitude
error
: log-closure amplitude error in the high-snr limit
U1
: u (λ) of first station
V1
: v (λ) of first station
U2
: u (λ) of second station
V2
: v (λ) of second station
U3
: u (λ) of third station
V3
: v (λ) of third station
U4
: u (λ) of fourth station
V4
: v (λ) of fourth station
T
: Measured time of closure phase in hours
F
: Measured frequency of closure phase in Hz
quadrangle
: station codes for the quadrangle
sourceComrade.EHTVisibilityDatum
— Typestruct EHTVisibilityDatum{S<:Number} <: Comrade.AbstractVisibilityDatum{S<:Number}
A struct holding the information for a single measured visibility.
measurement
: real component of the visibility (Jy)
error
: error of the visibility (Jy)
U
: u position of the data point in λ
V
: v position of the data point in λ
T
: time of the data point in (Hr)
F
: frequency of the data point (Hz)
baseline
: station baseline codes
sourceComrade.EHTVisibilityAmplitudeDatum
— Typestruct EHTVisibilityAmplitudeDatum{S<:Number} <: Comrade.AbstractVisibilityDatum{S<:Number}
A struct holding the information for a single measured visibility amplitude.
FIELDS
measurement
: amplitude (Jy)
error
: error of the visibility amplitude (Jy)
U
: u position of the data point in λ
V
: v position of the data point in λ
T
: time of the data point in (Hr)
F
: frequency of the data point (Hz)
baseline
: station baseline codes
sourceComrade.Scan
— Typestruct Scan{T, I, S}
Composite type that holds information for a single scan of the telescope.
Fields
time
: Scan time
index
: Scan indices which are (scan index, data start index, data end index)
scan
: Scan data usually a StructArray of a <:AbstractVisibilityDatum
sourceComrade.ScanTable
— Typestruct ScanTable{O<:Union{Comrade.ArrayConfiguration, Comrade.Observation}, T, S}
Wraps EHTObservation in a table that separates the observation into scans. This implements the table interface. You can access scans by directly indexing into the table. This will create a view into the table not copying the data.
Example
julia> st = scantable(obs)
+scan1[:baseline]
sourceComrade.stations
— Functionstations(d::EHTObservation)
Get all the stations in a observation. The result is a vector of symbols.
sourcestations(g::CalTable)
Return the stations in the calibration table
sourceComrade.uvpositions
— Functionuvpositions(datum::AbstractVisibilityDatum)
Get the uvp positions of an inferometric datum.
sourceComrade.ArrayConfiguration
— Typeabstract type ArrayConfiguration
This defined the abstract type for an array configuration. Namely, baseline times, SEFD's, bandwidth, observation frequencies, etc.
sourceComrade.ClosureConfig
— Typestruct ClosureConfig{A, D} <: Comrade.ArrayConfiguration
Array config file for closure quantities. This stores the design matrix designmat
that transforms from visibilties to closure products.
Fields
ac
: Array configuration for visibilities
designmat
: Closure design matrix
sourceComrade.AbstractInterferometryDatum
— Typeabstract type AbstractInterferometryDatum{T}
An abstract type for all VLBI interfermetry data types. See Comrade.EHTVisibilityDatum for an example.
sourceComrade.ArrayBaselineDatum
— Typestruct ArrayBaselineDatum{T, E, V}
A single datum of an ArrayConfiguration
sourceComrade.EHTObservation
— Typestruct EHTObservation{F, T<:Comrade.AbstractInterferometryDatum{F}, S<:(StructArrays.StructArray{T<:Comrade.AbstractInterferometryDatum{F}}), A, N} <: Comrade.Observation{F}
The main data product type in Comrade
this stores the data
which can be a StructArray of any AbstractInterferometryDatum
type.
Fields
data
: StructArray of data productts
config
: Array config holds ancillary information about array
mjd
: modified julia date of the observation
ra
: RA of the observation in J2000 (deg)
dec
: DEC of the observation in J2000 (deg)
bandwidth
: bandwidth of the observation (Hz)
source
: Common source name
timetype
: Time zone used.
sourceComrade.EHTArrayConfiguration
— Typestruct EHTArrayConfiguration{F, T, S, D<:AbstractArray} <: Comrade.ArrayConfiguration
Stores all the non-visibility data products for an EHT array. This is useful when evaluating model visibilities.
Fields
bandwidth
: Observing bandwith (Hz)
tarr
: Telescope array file
scans
: Scan times
data
: A struct array of ArrayBaselineDatum
holding time, freq, u, v, baselines.
sourceComrade.EHTCoherencyDatum
— Typestruct EHTCoherencyDatum{S, B1, B2, M<:(StaticArraysCore.SArray{Tuple{2, 2}, Complex{S}, 2}), E<:(StaticArraysCore.SArray{Tuple{2, 2}, S, 2})} <: Comrade.AbstractInterferometryDatum{S}
A Datum for a single coherency matrix
Fields
measurement
: coherency matrix, with entries in Jy
error
: visibility uncertainty matrix, with entries in Jy
U
: x-direction baseline length, in λ
V
: y-direction baseline length, in λ
T
: Timestamp, in hours
F
: Frequency, in Hz
baseline
: station baseline codes
polbasis
: polarization basis for each station
sourceComrade.EHTClosurePhaseDatum
— Typestruct EHTClosurePhaseDatum{S<:Number} <: Comrade.ClosureProducts{S<:Number}
A Datum for a single closure phase.
Fields
measurement
: closure phase (rad)
error
: error of the closure phase assuming the high-snr limit
U1
: u (λ) of first station
V1
: v (λ) of first station
U2
: u (λ) of second station
V2
: v (λ) of second station
U3
: u (λ) of third station
V3
: v (λ) of third station
T
: Measured time of closure phase in hours
F
: Measured frequency of closure phase in Hz
triangle
: station baselines used
sourceComrade.EHTLogClosureAmplitudeDatum
— Typestruct EHTLogClosureAmplitudeDatum{S<:Number} <: Comrade.ClosureProducts{S<:Number}
A Datum for a single log closure amplitude.
measurement
: log-closure amplitude
error
: log-closure amplitude error in the high-snr limit
U1
: u (λ) of first station
V1
: v (λ) of first station
U2
: u (λ) of second station
V2
: v (λ) of second station
U3
: u (λ) of third station
V3
: v (λ) of third station
U4
: u (λ) of fourth station
V4
: v (λ) of fourth station
T
: Measured time of closure phase in hours
F
: Measured frequency of closure phase in Hz
quadrangle
: station codes for the quadrangle
sourceComrade.EHTVisibilityDatum
— Typestruct EHTVisibilityDatum{S<:Number} <: Comrade.AbstractVisibilityDatum{S<:Number}
A struct holding the information for a single measured visibility.
measurement
: real component of the visibility (Jy)
error
: error of the visibility (Jy)
U
: u position of the data point in λ
V
: v position of the data point in λ
T
: time of the data point in (Hr)
F
: frequency of the data point (Hz)
baseline
: station baseline codes
sourceComrade.EHTVisibilityAmplitudeDatum
— Typestruct EHTVisibilityAmplitudeDatum{S<:Number} <: Comrade.AbstractVisibilityDatum{S<:Number}
A struct holding the information for a single measured visibility amplitude.
FIELDS
measurement
: amplitude (Jy)
error
: error of the visibility amplitude (Jy)
U
: u position of the data point in λ
V
: v position of the data point in λ
T
: time of the data point in (Hr)
F
: frequency of the data point (Hz)
baseline
: station baseline codes
sourceComrade.Scan
— Typestruct Scan{T, I, S}
Composite type that holds information for a single scan of the telescope.
Fields
time
: Scan time
index
: Scan indices which are (scan index, data start index, data end index)
scan
: Scan data usually a StructArray of a <:AbstractVisibilityDatum
sourceComrade.ScanTable
— Typestruct ScanTable{O<:Union{Comrade.ArrayConfiguration, Comrade.Observation}, T, S}
Wraps EHTObservation in a table that separates the observation into scans. This implements the table interface. You can access scans by directly indexing into the table. This will create a view into the table not copying the data.
Example
julia> st = scantable(obs)
julia> st[begin] # grab first scan
-julia> st[end] # grab last scan
sourceeht-imaging interface (Internal)
Comrade.extract_amp
— Functionextract_amp(obs; kwargs...)
Extracts the visibility amplitudes from an obs
. This is an internal method for dispatch. Only use this if interfacing Comrade with a new data type.
sourceComrade.extract_cphase
— Functionextract_cphase(obs; kwargs...)
Extracts the closure phases from an obs
. This is an internal method for dispatch. Only use this if interfacing Comrade with a new data type.
sourceComrade.extract_lcamp
— Functionextract_lcamp(obs; kwargs...)
Extracts the log-closure amplitudes from an obs
. This is an internal method for dispatch. Only use this if interfacing Comrade with a new data type.
sourceComrade.extract_vis
— Functionextract_vis(obs; kwargs...)
Extracts the stokes I complex visibilities from an obs. This is an internal method for dispatch. Only use this if interfacing Comrade with a new data type.
sourceBayesian Tools
Posterior Constructions
HypercubeTransform.ascube
— Functionascube(post::Posterior)
Construct a flattened version of the posterior where the parameters are transformed to live in (0, 1), i.e. the unit hypercube.
This returns a TransformedPosterior
that obeys the DensityInterface
and can be evaluated in the usual manner, i.e. logdensityof
. Note that the transformed posterior automatically includes the terms log-jacobian terms of the transformation.
Example
julia> tpost = ascube(post)
+julia> st[end] # grab last scan
sourceeht-imaging interface (Internal)
Comrade.extract_amp
— Functionextract_amp(obs; kwargs...)
Extracts the visibility amplitudes from an obs
. This is an internal method for dispatch. Only use this if interfacing Comrade with a new data type.
sourceComrade.extract_cphase
— Functionextract_cphase(obs; kwargs...)
Extracts the closure phases from an obs
. This is an internal method for dispatch. Only use this if interfacing Comrade with a new data type.
sourceComrade.extract_lcamp
— Functionextract_lcamp(obs; kwargs...)
Extracts the log-closure amplitudes from an obs
. This is an internal method for dispatch. Only use this if interfacing Comrade with a new data type.
sourceComrade.extract_vis
— Functionextract_vis(obs; kwargs...)
Extracts the stokes I complex visibilities from an obs. This is an internal method for dispatch. Only use this if interfacing Comrade with a new data type.
sourceBayesian Tools
Posterior Constructions
HypercubeTransform.ascube
— Functionascube(post::Posterior)
Construct a flattened version of the posterior where the parameters are transformed to live in (0, 1), i.e. the unit hypercube.
This returns a TransformedPosterior
that obeys the DensityInterface
and can be evaluated in the usual manner, i.e. logdensityof
. Note that the transformed posterior automatically includes the terms log-jacobian terms of the transformation.
Example
julia> tpost = ascube(post)
julia> x0 = prior_sample(tpost)
-julia> logdensityof(tpost, x0)
Notes
This is the transform that should be used if using typical NestedSampling methods, i.e. ComradeNested
. For the transformation to unconstrained space see asflat
sourceHypercubeTransform.asflat
— Functionasflat(post::Posterior)
Construct a flattened version of the posterior where the parameters are transformed to live in (-∞, ∞).
This returns a TransformedPosterior
that obeys the DensityInterface
and can be evaluated in the usual manner, i.e. logdensityof
. Note that the transformed posterior automatically includes the terms log-jacobian terms of the transformation.
Example
julia> tpost = ascube(post)
+julia> logdensityof(tpost, x0)
Notes
This is the transform that should be used if using typical NestedSampling methods, i.e. ComradeNested
. For the transformation to unconstrained space see asflat
sourceHypercubeTransform.asflat
— Functionasflat(post::Posterior)
Construct a flattened version of the posterior where the parameters are transformed to live in (-∞, ∞).
This returns a TransformedPosterior
that obeys the DensityInterface
and can be evaluated in the usual manner, i.e. logdensityof
. Note that the transformed posterior automatically includes the terms log-jacobian terms of the transformation.
Example
julia> tpost = ascube(post)
julia> x0 = prior_sample(tpost)
-julia> logdensityof(tpost, x0)
Notes
This is the transform that should be used if using typical MCMC methods, i.e. ComradeAHMC
. For the transformation to the unit hypercube see ascube
sourceParameterHandling.flatten
— Functionflatten(post::Posterior)
Construct a flattened version of the posterior but do not transform to any space, i.e. use the support specified by the prior.
This returns a TransformedPosterior
that obeys the DensityInterface
and can be evaluated in the usual manner, i.e. logdensityof
. Note that the transformed posterior automatically includes the terms log-jacobian terms of the transformation.
Example
julia> tpost = flatten(post)
+julia> logdensityof(tpost, x0)
Notes
This is the transform that should be used if using typical MCMC methods, i.e. ComradeAHMC
. For the transformation to the unit hypercube see ascube
sourceParameterHandling.flatten
— Functionflatten(post::Posterior)
Construct a flattened version of the posterior but do not transform to any space, i.e. use the support specified by the prior.
This returns a TransformedPosterior
that obeys the DensityInterface
and can be evaluated in the usual manner, i.e. logdensityof
. Note that the transformed posterior automatically includes the terms log-jacobian terms of the transformation.
Example
julia> tpost = flatten(post)
julia> x0 = prior_sample(tpost)
-julia> logdensityof(tpost, x0)
Notes
This is the transform that should be used if using typical MCMC methods, i.e. ComradeAHMC
. For the transformation to the unit hypercube see ascube
sourceTransformVariables.inverse
— Functioninverse(posterior::TransformedPosterior, x)
Transforms the value y
from parameter space to the transformed space (e.g. unit hypercube if using ascube
).
For the inverse transform see transform
sourceComrade.prior_sample
— Functionprior_sample([rng::AbstractRandom], post::Posterior, args...)
Samples the prior distribution from the posterior. The args...
are forwarded to the Base.rand
method.
sourceprior_sample([rng::AbstractRandom], post::Posterior)
Returns a single sample from the prior distribution.
sourceComrade.likelihood
— Functionlikelihood(d::ConditionedLikelihood, μ)
Returns the likelihood of the model, with parameters μ. That is, we return the distribution of the data given the model parameters μ. This is an actual probability distribution.
sourceComrade.simulate_observation
— Functionsimulate_observation([rng::Random.AbstractRNG], post::Posterior, θ)
Create a simulated observation using the posterior and its data post
using the parameter values θ
. In Bayesian terminology this is a draw from the posterior predictive distribution.
sourceComrade.dataproducts
— Functiondataproducts(d::RadioLikelihood)
Returns the data products you are fitting as a tuple. The order of the tuple corresponds to the order of the dataproducts
argument in RadioLikelihood
.
sourcedataproducts(d::Posterior)
Returns the data products you are fitting as a tuple. The order of the tuple corresponds to the order of the dataproducts
argument in RadioLikelihood
.
sourceComrade.skymodel
— Functionskymodel(post::RadioLikelihood, θ)
Returns the sky model or image of a posterior using the parameter valuesθ
sourceskymodel(post::Posterior, θ)
Returns the sky model or image of a posterior using the parameter valuesθ
sourceComrade.instrumentmodel
— Functionskymodel(lklhd::RadioLikelihood, θ)
Returns the instrument model of a lklhderior using the parameter valuesθ
sourceskymodel(post::Posterior, θ)
Returns the instrument model of a posterior using the parameter valuesθ
sourceComrade.vlbimodel
— Functionvlbimodel(post::Posterior, θ)
Returns the instrument model and sky model as a VLBIModel
of a posterior using the parameter values θ
sourcevlbimodel(post::Posterior, θ)
Returns the instrument model and sky model as a VLBIModel
of a posterior using the parameter values θ
sourceStatsBase.sample
— Methodsample(post::Posterior, sampler::S, args...; init_params=nothing, kwargs...)
Sample a posterior post
using the sampler
. You can optionally pass the starting location of the sampler using init_params
, otherwise a random draw from the prior will be used.
sourceTransformVariables.transform
— Functiontransform(posterior::TransformedPosterior, x)
Transforms the value x
from the transformed space (e.g. unit hypercube if using ascube
) to parameter space which is usually encoded as a NamedTuple
.
For the inverse transform see inverse
sourceComrade.MultiRadioLikelihood
— TypeMultiRadioLikelihood(lklhd1, lklhd2, ...)
Combines multiple likelihoods into one object that is useful for fitting multiple days/frequencies.
julia> lklhd1 = RadioLikelihood(dcphase1, dlcamp1)
+julia> logdensityof(tpost, x0)
Notes
This is the transform that should be used if using typical MCMC methods, i.e. ComradeAHMC
. For the transformation to the unit hypercube see ascube
sourceTransformVariables.inverse
— Functioninverse(posterior::TransformedPosterior, x)
Transforms the value y
from parameter space to the transformed space (e.g. unit hypercube if using ascube
).
For the inverse transform see transform
sourceComrade.prior_sample
— Functionprior_sample([rng::AbstractRandom], post::Posterior, args...)
Samples the prior distribution from the posterior. The args...
are forwarded to the Base.rand
method.
sourceprior_sample([rng::AbstractRandom], post::Posterior)
Returns a single sample from the prior distribution.
sourceComrade.likelihood
— Functionlikelihood(d::ConditionedLikelihood, μ)
Returns the likelihood of the model, with parameters μ. That is, we return the distribution of the data given the model parameters μ. This is an actual probability distribution.
sourceComrade.simulate_observation
— Functionsimulate_observation([rng::Random.AbstractRNG], post::Posterior, θ)
Create a simulated observation using the posterior and its data post
using the parameter values θ
. In Bayesian terminology this is a draw from the posterior predictive distribution.
sourceComrade.dataproducts
— Functiondataproducts(d::RadioLikelihood)
Returns the data products you are fitting as a tuple. The order of the tuple corresponds to the order of the dataproducts
argument in RadioLikelihood
.
sourcedataproducts(d::Posterior)
Returns the data products you are fitting as a tuple. The order of the tuple corresponds to the order of the dataproducts
argument in RadioLikelihood
.
sourceComrade.skymodel
— Functionskymodel(post::RadioLikelihood, θ)
Returns the sky model or image of a posterior using the parameter valuesθ
sourceskymodel(post::Posterior, θ)
Returns the sky model or image of a posterior using the parameter valuesθ
sourceComrade.instrumentmodel
— Functionskymodel(lklhd::RadioLikelihood, θ)
Returns the instrument model of a lklhderior using the parameter valuesθ
sourceskymodel(post::Posterior, θ)
Returns the instrument model of a posterior using the parameter valuesθ
sourceComrade.vlbimodel
— Functionvlbimodel(post::Posterior, θ)
Returns the instrument model and sky model as a VLBIModel
of a posterior using the parameter values θ
sourcevlbimodel(post::Posterior, θ)
Returns the instrument model and sky model as a VLBIModel
of a posterior using the parameter values θ
sourceStatsBase.sample
— Methodsample(post::Posterior, sampler::S, args...; init_params=nothing, kwargs...)
Sample a posterior post
using the sampler
. You can optionally pass the starting location of the sampler using init_params
, otherwise a random draw from the prior will be used.
sourceTransformVariables.transform
— Functiontransform(posterior::TransformedPosterior, x)
Transforms the value x
from the transformed space (e.g. unit hypercube if using ascube
) to parameter space which is usually encoded as a NamedTuple
.
For the inverse transform see inverse
sourceComrade.MultiRadioLikelihood
— TypeMultiRadioLikelihood(lklhd1, lklhd2, ...)
Combines multiple likelihoods into one object that is useful for fitting multiple days/frequencies.
julia> lklhd1 = RadioLikelihood(dcphase1, dlcamp1)
julia> lklhd2 = RadioLikelihood(dcphase2, dlcamp2)
-julia> MultiRadioLikelihood(lklhd1, lklhd2)
sourceComrade.Posterior
— TypePosterior(lklhd, prior)
Creates a Posterior density that follows obeys DensityInterface. The lklhd
object is expected to be a VLB
object. For instance, these can be created using RadioLikelihood
. prior
Notes
Since this function obeys DensityInterface
you can evaluate it with
julia> ℓ = logdensityof(post)
-julia> ℓ(x)
or using the 2-argument version directly
julia> logdensityof(post, x)
where post::Posterior
.
To generate random draws from the prior see the prior_sample
function.
sourceComrade.TransformedPosterior
— Typestruct TransformedPosterior{P<:Posterior, T} <: Comrade.AbstractPosterior
A transformed version of a Posterior
object. This is an internal type that an end user shouldn't have to directly construct. To construct a transformed posterior see the asflat
, ascube
, and flatten
docstrings.
sourceComrade.RadioLikelihood
— TypeRadioLikelihood(skymodel, instumentmodel, obs, dataproducts::DataProducts...;
+julia> MultiRadioLikelihood(lklhd1, lklhd2)
sourceComrade.Posterior
— TypePosterior(lklhd, prior)
Creates a Posterior density that follows obeys DensityInterface. The lklhd
object is expected to be a VLB
object. For instance, these can be created using RadioLikelihood
. prior
Notes
Since this function obeys DensityInterface
you can evaluate it with
julia> ℓ = logdensityof(post)
+julia> ℓ(x)
or using the 2-argument version directly
julia> logdensityof(post, x)
where post::Posterior
.
To generate random draws from the prior see the prior_sample
function.
sourceComrade.TransformedPosterior
— Typestruct TransformedPosterior{P<:Posterior, T} <: Comrade.AbstractPosterior
A transformed version of a Posterior
object. This is an internal type that an end user shouldn't have to directly construct. To construct a transformed posterior see the asflat
, ascube
, and flatten
docstrings.
sourceComrade.RadioLikelihood
— TypeRadioLikelihood(skymodel, instumentmodel, dataproducts::EHTObservation...;
skymeta=nothing,
- instrumentmeta=nothing)
Creates a RadioLikelihood using the skymodel
its related metadata skymeta
and the instrumentmodel
and its metadata instumentmeta
. . The model
is a function that converts from parameters θ
to a Comrade AbstractModel which can be used to compute visibilities
and a set of metadata
that is used by model
to compute the model.
Warning
The model
itself must be a two argument function where the first argument is the set of model parameters and the second is a container that holds all the additional information needed to construct the model. An example of this is when the model needs some precomputed cache to define the model.
Example
-cache = create_cache(FFTAlg(), IntensityMap(zeros(128,128), μas2rad(100.0), μas2rad(100.0)))
+ instrumentmeta=nothing)
Creates a RadioLikelihood using the skymodel
its related metadata skymeta
and the instrumentmodel
and its metadata instumentmeta
. . The model
is a function that converts from parameters θ
to a Comrade AbstractModel which can be used to compute visibilities
and a set of metadata
that is used by model
to compute the model.
Warning
The model
itself must be a two argument function where the first argument is the set of model parameters and the second is a container that holds all the additional information needed to construct the model. An example of this is when the model needs some precomputed cache to define the model.
Example
dlcamp, dcphase = extract_table(obs, LogClosureAmplitude(), ClosurePhases())
+cache = create_cache(NFFTAlg(dlcamp), IntensityMap(zeros(128,128), μas2rad(100.0), μas2rad(100.0)))
function skymodel(θ, metadata)
(; r, a) = θ
@@ -102,9 +102,9 @@
a = Uniform(0.1, 5.0)
)
-RadioLikelihood(skymodel, instrumentmodel, obs, dataproducts::EHTObservation...;
+RadioLikelihood(skymodel, instrumentmodel, dataproducts::EHTObservation...;
skymeta=(;cache,),
- instrumentmeta=(;gcache))
sourceRadioLikelihood(skymodel, obs, dataproducts::EHTObservation...; skymeta=nothing)
Forms a radio likelihood from a set of data products using only a sky model. This intrinsically assumes that the instrument model is not required since it is perfect. This is useful when fitting closure quantities which are independent of the instrument.
If you want to form a likelihood from multiple arrays such as when fitting different wavelengths or days, you can combine them using MultiRadioLikelihood
Example
julia> RadioLikelihood(skymodel, obs, ClosurePhase(), LogClosureAmplitude())
sourceComrade.IsFlat
— Typestruct IsFlat
Specifies that the sampling algorithm usually expects a uncontrained transform
sourceComrade.IsCube
— Typestruct IsCube
Specifies that the sampling algorithm usually expects a hypercube transform
sourceMisc
Comrade.station_tuple
— Functionstation_tuple(stations, default; reference=nothing kwargs...)
+ instrumentmeta=(;gcache))
sourceRadioLikelihood(skymodel, dataproducts::EHTObservation...; skymeta=nothing)
Forms a radio likelihood from a set of data products using only a sky model. This intrinsically assumes that the instrument model is not required since it is perfect. This is useful when fitting closure quantities which are independent of the instrument.
If you want to form a likelihood from multiple arrays such as when fitting different wavelengths or days, you can combine them using MultiRadioLikelihood
Example
julia> RadioLikelihood(skymodel, dcphase, dlcamp)
sourceComrade.IsFlat
— Typestruct IsFlat
Specifies that the sampling algorithm usually expects a uncontrained transform
sourceComrade.IsCube
— Typestruct IsCube
Specifies that the sampling algorithm usually expects a hypercube transform
sourceMisc
Comrade.station_tuple
— Functionstation_tuple(stations, default; reference=nothing kwargs...)
station_tuple(obs::EHTObservation, default; reference=nothing, kwargs...)
Convienence function that will construct a NamedTuple
of objects whose names are the stations
in the observation obs
or explicitly in the argument stations
. The NamedTuple
will be filled with default
if no kwargs are defined otherwise each kwarg (key, value) pair denotes a station and value pair.
Optionally the user can specify a reference
station that will be dropped from the tuple. This is useful for selecting a reference station for gain phases
Examples
julia> stations = (:AA, :AP, :LM, :PV)
julia> station_tuple(stations, ScanSeg())
(AA = ScanSeg(), AP = ScanSeg(), LM = ScanSeg(), PV = ScanSeg())
@@ -113,4 +113,4 @@
julia> station_tuple(stations, ScanSeg(); AA = FixedSeg(1.0), PV = TrackSeg())
(AA = FixedSeg(1.0), AP = ScanSeg(), LM = ScanSeg(), PV = TrackSeg())
julia> station_tuple(stations, Normal(0.0, 0.1); reference=:AA, LM = Normal(0.0, 1.0))
-(AP = Normal(0.0, 0.1), LM = Normal(0.0, 1.0), PV = Normal(0.0, 0.1))
sourceComrade.dirty_image
— Functiondirty_image(fov::Real, npix::Int, obs::EHTObservation{T,<:EHTVisibilityDatum}) where T
Computes the dirty image of the complex visibilities assuming a field of view of fov
and number of pixels npix
using the complex visibilities found in the observation obs
.
The dirty image
is the inverse Fourier transform of the measured visibilties assuming every other visibility is zero.
sourceComrade.dirty_beam
— Functiondirty_beam(fov::Real, npix::Int, obs::EHTObservation{T,<:EHTVisibilityDatum}) where T
Computes the dirty beam of the complex visibilities assuming a field of view of fov
and number of pixels npix
using baseline coverage found in obs
.
The dirty beam
is the inverse Fourier transform of the (u,v) coverage assuming every visibility is unity and everywhere else is zero.
sourceInternal (Not Public API)
Comrade.extract_FRs
— Functionextract_FRs
Extracts the feed rotation Jones matrices (returned as a JonesPair
) from an EHT observation obs
.
Warning
eht-imaging can sometimes pre-rotate the coherency matrices. As a result the field rotation can sometimes be applied twice. To compensate for this we have added a ehtim_fr_convention
which will fix this.
sourceSettings
This document was generated with Documenter.jl version 0.27.25 on Wednesday 9 August 2023. Using Julia version 1.9.2.
+(AP = Normal(0.0, 0.1), LM = Normal(0.0, 1.0), PV = Normal(0.0, 0.1))
Comrade.dirty_image
— Functiondirty_image(fov::Real, npix::Int, obs::EHTObservation{T,<:EHTVisibilityDatum}) where T
Computes the dirty image of the complex visibilities assuming a field of view of fov
and number of pixels npix
using the complex visibilities found in the observation obs
.
The dirty image
is the inverse Fourier transform of the measured visibilties assuming every other visibility is zero.
Comrade.dirty_beam
— Functiondirty_beam(fov::Real, npix::Int, obs::EHTObservation{T,<:EHTVisibilityDatum}) where T
Computes the dirty beam of the complex visibilities assuming a field of view of fov
and number of pixels npix
using baseline coverage found in obs
.
The dirty beam
is the inverse Fourier transform of the (u,v) coverage assuming every visibility is unity and everywhere else is zero.
Internal (Not Public API)
Comrade.extract_FRs
— Functionextract_FRs
Extracts the feed rotation Jones matrices (returned as a JonesPair
) from an EHT observation obs
.
Warning
eht-imaging can sometimes pre-rotate the coherency matrices. As a result the field rotation can sometimes be applied twice. To compensate for this we have added a ehtim_fr_convention
which will fix this.