EHTImages.ncd_intensity_dimnamesConstant
ncd_intensity_dimnames::NamedTuple

A named tuple relating Symbols to actual strings for the dimension of the EHT Intensity Image NetCDF4 format. keys are :x, :y for x and y axis, :p for polarization, :f for frequency, :t for time.

source
EHTImages.ncd_intensity_vardimsConstant
ncd_intensity_vartypes::NamedTuple

A named tuple relating Symbols to types of the corresponding variables of the EHT Intensity Image NetCDF4 format.

source
EHTImages.ncd_intensity_varnamesConstant
ncd_intensity_varnames::NamedTuple

A named tuple relating Symbols to names of the corresponding variables of the EHT Intensity Image NetCDF4 format.

source
EHTImages.ncd_intensity_vartypesConstant
ncd_intensity_vartypes::NamedTuple

A named tuple relating Symbols to types of the corresponding variables of the EHT Intensity Image NetCDF4 format.

source
EHTImages.AbstractImageDataSetType
abstract type AbstractImageDataSet

The abstract type for image data sets handled in this module. AbstractImageDataSet works as an Abstract Array-ish. To make it, each image type needs to have four following methods. (see: Julia Documentation for "Interfaces")

Mandatory Methods that need to be defined

  • default_metadata: Return the default metadata for the image data set.
  • isdiskdata: Determines whether the data is disk-based or memory-based. Return IsDiskData() if data is disk-based, while return NotDiskData() if data is memory-based.
  • isopen: Check if data is accessible, return true for accessible data and false if data is not accessible. This is relevant if image is based on disk data.
  • iswritable: Check if data is accessible, return true for accessible data and false if data is not accessible. This is relevant if image is based on disk data.

Methods provided

  • size: returning a tuple containing the dimension of AbstractImageDataSet.data
  • getindex: scalar or vector indexing
  • setindex!: scalar or vector indexing assignment
  • firstindex: returning the first index, used in X[begin]
  • lastindex: returning the last index, used in X[end]
  • IndexStyle: returning the index style
source
EHTImages.AbstractIntensityImageType
abstract type AbstractIntensityImage <: AbstractImageDataSet

This defines a basic interface for intensity images. It is a subtype of AbstractImageDataSet.

Mandatory fields

  • data: 5 dimensional array for intensity [x, y, polarization, frequency, time]
  • p: 1 dimensional array for polarization codes in string (coordinate for polarization axis)
  • f: 1 dimensional array for frequency in Hz (coordinate for frequency axis)
  • t: 1 dimensional array for time in modified Julian dates (coordinate for time axis)
  • metadata: Dict-like object to stock metadata

Mandatory methods need to be defined.

See also documentations for AbstractImageDataSet.

source
EHTImages.DiskIntensityImageType
mutable struct DiskIntensityImage <: AbstractIntensityImage

A data type for five dimensional images of which data are all stored in disk using the NetCDF4 format. This format relies on NCDatasets to provide an easy access of data through many useful methods in the NCDatasets package. Note that this data type could be either mutable or immutable depending on the access mode to the NetCDF4 file.

  • filename::Any: name of the corresponding NetCDF4 file Default: nothing

  • group::Any: group name of the corresponding image data set Default: nothing

  • data::Any: five dimensional intensity disbrituion. Default: nothing

  • metadata::Any: metadata. Default: nothing

  • t::Any: polarization code, giving the parization axis (:p). Default: nothing

  • f::Any: central frequency in Hz, giving the frequency axis (:f). Default: nothing

  • p::Any: central modified Julian date, giving the time axis (:t). Default: nothing

  • dataset::Any: Default: nothing

source
EHTImages.IntensityImageType
struct IntensityImage <: AbstractIntensityImage

A data type for five dimensional images of which data are all stored in the memory. This format relies on EHTDimensionalData.DimArray to provide an easy access of data through many useful methods in EHTDimensionalData and its origin DimensionalData packages. Note that this data type is immutable.

  • dimstack::DimensionalData.DimStack: DimArray storing all of data, p, f, t and metadata.

  • data::Array{Float64, 5}: the five dimensional intensity disbrituion. Alias to dimstack.intensity.data.

  • metadata::OrderedCollections.OrderedDict{Symbol, Any}: metadata. Aliast to dimarray.metadata.

  • p::Vector{String}: the polarization code, giving the polarization axis (:p) of dimarray. Alias to dimarray.dims[3].val.data.

  • f::Vector{Float64}: the central frequency in Hz, giving the frequency axis (:f) of dimarray. Alias to dimarray.dims[4].val.data.

  • t::Vector{Float64}: the central modified Julian date, giving the time axis (:t) of dimarray. Alias to dimarray.dims[5].val.data.

source
EHTImages.IsDiskDataType
struct IsDiskData <: EHTImages.DataStorageType

Defines a trait that a states that data is disk based.

source
EHTImages.NotDiskDataType
struct NotDiskData <: EHTImages.DataStorageType

Defines a trait that a states that data is memory based.

source
Base.closeMethod
close(image::DiskIntensityImage)

Close the access to the associated NetCDF4 file. This function is an alias to close!(image).

source
Base.isopenMethod
isopen(_::AbstractImageDataSet) -> Bool

Check if data is accessible, return true for accessible data and false if data is not accessible. This is relevant if image is based on disk data.

source
Base.iswritableMethod
iswritable(_::AbstractImageDataSet) -> Bool

Check if data is accessible, return true for accessible data and false if data is not accessible. This is relevant if image is based on disk data.

source
ComradeBase.imagepixelsMethod
imagepixels(metadata) --> grid <: VLBISkyModels.AbstractDims
imagepixels(::AbstractIntensityImage) --> grid <: VLBISkyModels.AbstractDims

Create the grid instance for Comrade.

source
EHTImages.close!Method
close!(image::DiskIntensityImage)

Close the access to the associated NetCDF4 file.

source
EHTImages.copy_metadata!Method
copy_metadata!(image::AbstractIntensityImage, uvdataset::AbstractUVDataSet)

copy metadata from the given uvdataset.

source
EHTImages.default_metadataMethod
default_metadata(::Type{<:AbstractImageDataSet}) -> OrderedDict{Symbol, Any}
default_metadata(::AbstractImageDataSet) -> OrderedDict{Symbol, Any}

Return default metadata for the image data set.

source
EHTImages.diskintensityimageMethod
diskintensityimage(filename, nx, dx, angunit; keywords) -> DiskIntensityImage

Create a blank DiskIntensityImage object. Return DiskIntensityImage data loaded with :read mode.

Arguments

  • filename::AbstractString: NetCDF4 file where image data will be created.
  • nx::Integer: the number of pixels along with the horizontal axis. Must be positive.
  • dx::Real: the pixel size of the horizontal axis. Must be positive.
  • angunit::Union{Unitful.Quantity, Unitful.Units or String}=rad: the angular unit for dx and dy.

Keywords

  • ny::Real=nx: the number of pixels along with the vertical axis. Must be positive.
  • dy::Real=dx: the pixel size of the vertical axis. Must be positive.
  • ixref::Real=(nx + 1) / 2, iyref::Real=(ny + 1) / 2: index of the reference pixels along with the horizontal and vertical axises, respectively. Default values set to the center of the field of the view.
  • pol::Symbol=:single: number of polarizations. Availables are :single or :full (i.e. four) polarizations.
  • freq::Vector{Float64}=[1.0]: a vector for frequencies in the unit of Hz
  • mjd::Vector{Float64}=[0.0]: a vector for time in the unit of MJD.
  • metadata::AbstractDict=default_metadata(AbstractIntensityImage): other metadata. Note that the above keywords and arguments will overwrite the values of the conflicting keys in this metadata argument.
  • mode::Symbol=:create: The access mode to NCDataset. Available modes are :read, :append, :create. See help for EHTNCDBase.ncdmodes for details.
  • group::AbstractString=EHTImage.ncd_intensity_defaultgroup: The group of the image data in the input NetCDF4 file.
source
EHTImages.get_bconvMethod
get_bconv(image::AbstractIntensityImage;
    fluxunit::Union{Unitful.Quantity,Unitful.Units,String}=Jy,
    saunit::Union{Unitful.Quantity,Unitful.Units,String}="pixel")

get a conversion factor from Jy/pixel (used in AbstractIntensityImage.data) to an arbitrary unit for the intensity. fluxunit is for the unit of the flux density (e.g. Jy, mJy, μJy) or brightness temperture (e.g. K), while saunit is for the unit of the solid angle (pixel, beam, mas, μJy).

source
EHTImages.get_fovFunction
get_fov(::AbstractIntensityImage, angunit) --> Tuple
get_fov(metadata, angunit) --> Tuple

Returning the field of the view for the grids along with x and y axis in the given angular unit specified by angunit. The input could be a intensity image data set or its metadata.

Arguments

  • angunit::Union{Unitful.Quantity,Unitful.Units,String}=rad: Angular units of the output pixel grids.
source
EHTImages.get_uvgridFunction
get_uvgrid(image::AbstractIntensityImage, dofftshift=true)
get_uvgrid(metadata, dofftshift::Bool=true)

returning u and v grids corresponding to the image field of view and pixel size.

source
EHTImages.get_xygridFunction
get_xygrid(::AbstractIntensityImage, angunit) --> Tuple{StepRangeLen, StepRangeLen}
get_xygrid(metadata, angunit) --> Tuple{StepRangeLen, StepRangeLen}

Returning 1-dimensional StepRangeLen objects for the grids along with x and y axis in the given angular unit specified by angunit. The input could be a intensity image data set or its metadata.

Arguments

  • angunit::Union{Unitful.Quantity,Unitful.Units,String}=rad: Angular units of the output pixel grids.
source
EHTImages.intensityimageMethod
intensityimage(nx, dx, angunit; keywords) -> IntensityImage

Create and return a blank IntensityImage object.

Arguments

  • nx::Integer: the number of pixels along with the horizontal axis. Must be positive.
  • dx::Real: the pixel size of the horizontal axis. Must be positive.
  • angunit::Union{Unitful.Quantity, Unitful.Units or String}=rad: the angular unit for dx and dy.

Keywords

  • ny::Real=nx: the number of pixels along with the vertical axis. Must be positive.
  • dy::Real=dx: the pixel size of the vertical axis. Must be positive.
  • ixref::Real=(nx + 1) / 2, iyref::Real=(ny + 1) / 2: index of the reference pixels along with the horizontal and vertical axises, respectively. Default values set to the center of the field of the view.
  • p::Symbol=:single: number of parizations. Availables are :single or :full (i.e. four) parizations.
  • f::Vector{Float64}=[1.0]: a vector for fuencies in the unit of Hz
  • t::Vector{Float64}=[0.0]: a vector for time in the unit of t.
  • metadata::AbstractDict=default_metadata(AbstractIntensityImage): other metadata. Note that the above keywords and arguments will overwrite the values of the conflicting keys in this metadata argument.
source
EHTImages.intensitymap2dFunction
intensitymap2d(im::AbstractIntensityImage, pidx=1, fidx=1, tidx=1) --> VLBISkyModels.IntensityMap

create a two-dimensional Comrade.IntensityMap model.

** Arguments **

  • pidx, fidx, tidx::Integer: indices for polarizaiton, frequency and time, respectively.
source
EHTImages.intensitymap4dFunction
intensitymap4d(im::AbstractIntensityImage, pidx=1) --> VLBISkyModels.IntensityMap

create a four-dimensional Comrade.IntensityMap model.

** Arguments **

  • pidx::Integer: the polarization index.
source
EHTImages.isdiskdataMethod
isdiskdata(_::AbstractImageDataSet) -> EHTImages.IsDiskData

Determines whether the data is disk-based or memory-based. Return IsDiskData() if data is disk-based, while return NotDiskData() if data is memory-based.

source
EHTImages.loadMethod
load(image::NCImage) --> DDImage

Load image data from the input disk image to memory.

Arguments

  • image::NCImage: Input NCImage.
source
EHTImages.load_fitsFunction
load_fits(filename::AbstractString, hduid::Integer=1) -> IntensityImage
load_fits(fits::FITS, hduid::Integer=1) -> IntensityImage
load_fits(hdu::ImageHDU) -> IntensityImage

Load the input FITS image into IntensityImage (in-memory image data).

Arguments

  • filename::AbstractString: name of the input FITS file
  • hduid::Integer=1: ID of the HDU to be loaded. Default to the primary HDU.
  • hdu::ImageHDU: HDU to be loaded.
source
EHTImages.load_imageMethod
load_image(filename; [group, mode]) -> DiskIntensityImage

Load image data from the specified group in the given NetCDF4 file with the specified access mode.

Arguments

  • filename::AbstractString: The input NetCDF4 file.
  • group::AbstractString=EHTImage.ncd_intensity_defaultgroup The group of the image data in the input NetCDF4 file.
  • mode::Symbol=:read: The access mode to NCDataset. Available modes are :read, :append, :create. See help for EHTImage.ncdmodes for details.
source
EHTImages.open!Function
open!(image[, mode])

Load image data from NCDataset specified in the input image object with the given access mode. If image data are already opened, it will close it and reload data again.

Arguments

  • image::DiskIntensityImage: The input image object.
  • mode::Symbol=:read: The access mode to NCDataset. Available modes are :read, :append, :create. See help for EHTImage.ncdmodes for details.
source
EHTImages.save_fits!Function
save_fits[!](image::AbstractIntensityImage, filename::AbstractString, idx=(1, 1); fitstype::Symbol=:casa)

Saving the image into a FITS file in a specifed format.

Arguments

  • image::AbstractIntensityImage: the input image
  • filename::AbstractString: the name of the output FITS file
  • idx: the index of the saved image. Should be (frequency index, time index). Default to (1,1).

Keywords

  • fitstype::Symbol: the format type of the output FITS. Availables are :casa (CASA compatible).
source
EHTImages.save_netcdf!Method
save_netcdf!(image, filename; [mode, group])

Save image data to NetCDF4 format.

Arguments

  • image::AbstractIntensityImage Input image data
  • filename::AbstractString: NetCDF4 file where image data will be saved.
  • mode::Symbol=:create: The access mode to NCDataset. Available modes are :append and :create. See help for EHTNCDBase.ncdmodes for details.
  • group::AbstractString=EHTImage.ncd_intensity_defaultgroup: The group of the image data in the input NetCDF4 file.
source
EHTImages.save_netcdfMethod
save_netcdf(image, filename; [mode=:create, group="image"]) => DiskIntensityImage

Save image data to NetCDF4 format. Saved data will be loaded and returned with :read access mode.

Arguments

  • image::AbstractIntensityImage Input image data
  • filename::AbstractString: NetCDF4 file where image data will be saved.
  • mode::Symbol=:create: The access mode to NCDataset. Available modes are :read, :append, :create. See help for EHTNCDBase.ncdmodes for details.
  • group::AbstractString=EHTImage.ncd_intensity_defaultgroup: The group of the image data in the input NetCDF4 file.
source
EHTImages.stokesintensitymap2dFunction
stokesintensitymap2d(im::AbstractIntensityImage, fidx=1, tidx=1) --> VLBISkyModels.StokesIntensityMap

create a 2D Comrade.StokesIntensityMap model.

** Arguments **

  • fidx, tidx::Integer: indices for frequency and time, respectively.
source
PythonPlot.imshowMethod
imshow(::AbstractIntensityImage; kwargs..., imshowkwargs...)

Plot an image using PythonPlot. imshowkwargs are passed to PythonPlot.imshow. Returns a dictionary that contains all python objects generated in the plot.

Keyword Arguments

  • angunit: angular unit for the axes. If nothing, the unit in the image metadata is used. If a Unitful unit, it can be any angular unit.
  • fluxunit:
  • saunit: unit for the solid angle.
  • idx: index of the image to plot. (polarization, frequency, time)
  • cmap: colormap to use.
  • scale: scaling of the image. Can be :log, :gamma or :linear.
  • gamma: gamma value for the :gamma scaling.
  • dyrange: dynamic range for the :log scaling.
  • vmax: maximum value for the :linear and :gamma scaling.
  • vmin: minimum value for the :linear and :gamma scaling.
  • relative: if true, the vmin and vmax are relative to the maximum value.
  • axisoff: if true, turn off the axis.
  • axislabel: if true, plot the axis labels.
  • add_colorbar: if true, add a colorbar.
  • interpolation: interpolation method for the image.
source