Commit 4b22d1cd authored by Éric Thiébaut's avatar Éric Thiébaut
Browse files

set_reference! can read FITS file and convert pairs of reals to points

parent 08c00bc6
......@@ -245,7 +245,19 @@ overwrites the set of reference positions of the wavefront sensor `wfs` with
the set of positions `ref` and return the resulting reference positions.
function set_reference! end
set_reference!(wfs::AbstractWavefrontSensor, ref::AbstractString) =
set_reference!(wfs, readfits(Array, ref)) # FIXME: be more specific
set_reference!(wfs::AbstractWavefrontSensor, ref::AbstractMatrix{<:Real}) = begin
n = length(wfs)
axes(ref) == (1:2, 1:n) || throw(DimensionMismatch("invalid reference dimensions"))
T = float(eltype(ref))
xref = Vector{Point{T}}(undef, n)
for i in 1:n
xref[i] = Point(ref[1,i], ref[2,i])
set_reference!(wfs, xref)
Tao.measurements(wfs) -> data
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment