API/Reference


LuckyImaging.lucky_imageFunction
lucky_image(cube; dims, q, metric=:max, register=:dft, kwargs...)

Perform classic lucky imaging for a cube of data along dimension dims. The selection fraction is set by the quantile q, where q=0.9 corresponds to a 10% selectrion fraction. The following options are available for modifying the metric used for selection as well as how the frames are registered.

Metrics

The following metrics, set with the keyword argument metric are available

  • :max - the maximum value
  • :mean - the mean value
  • :min - the minimum value (useful for coronagraphic images)
  • other - pass a function with the signature f(::AbstractMatrix) which returns a scalar value

Registration

The following options for registering the selected frames are available, set with the register keyword argument. Extra options can be provided to kwargs...

  • :dft - use SubpixelRegistration.jl to register the frames using their phase offsets. The reference frame will be the one with the highest metric, and keyword arguments like upsample_factor can be passed directly.
  • :max - register to maximum value
  • :com - register to center of mass
  • :invcom - register to center of inverse mass (useful for coronagraphic images)
  • nothing - cube is already co-registered

Keyword arguments

  • dims - the dimension along which to perform lucky imaging (required)
  • q - the selection quantile (required)
  • metric - the metric used for selection. Default is :max
  • register - the method used for registration. Default is :dft
  • window - if provided, will measure the metric and frame offsets inside a centered window with window side length.
  • kwargs... - additional keyword arguments will be passed to the register method (e.g., upsample_factor)

Examples

julia> cube = # load data ...

julia> res = lucky_image(cube; dims=3, q=0.9, upsample_factor=10)

See Also

lucky_image!

source
LuckyImaging.testcubeFunction

testcube()

Return the filepath of the test cube artifact. This needs to be loaded, using FITSIO.jl, for example. This data is a sequence of frames captured on the VAMPIRES instrument on Subaru/SCExAO.[2]

Examples

julia> using FITSIO

julia> cube = read(FITS(testcube())[1])
source