RvSpectML/EchelleCCFs.jl

not all `alg` functors have implementations for all four versions of `measure_rv_from_ccf`

hematthi opened this issue · 1 comments

"""
`measure_rv_from_ccf(vels, ccf, [ccf_var]; alg )`
Return estimated RV based on the CCF using specified algorithm object.
Inputs:
* `vels`: Array of velocites where CCF was evaluated.
* `ccf`: Array of values of CCF
Optional Arguements:
* `alg`: Functor specifying how to measure the RV and it's uncertainty from the CCF. Options include:
MeasureRvFromCCFGaussian (default), MeasureRvFromCCFQuadratic, MeasureRvFromCCFCentroid, and MeasureRvFromMinCCF.
"""
function measure_rv_from_ccf end
function measure_rv_from_ccf(vels::A1, ccf::A2, ; alg::AlgT=MeasureRvFromCCFGaussian() ) where {
T1<:Real, A1<:AbstractArray{T1,1}, T2<:Real, A2<:AbstractArray{T2,1}, AlgT<:AbstractMeasureRvFromCCF }
return alg(vels,ccf)
end
function measure_rv_from_ccf(vels::A1, ccf::A2, ccf_var::A3 ; alg::AlgT=MeasureRvFromCCFGaussian() ) where {
T1<:Real, A1<:AbstractArray{T1,1}, T2<:Real, A2<:AbstractArray{T2,1}, T3<:Real, A3<:AbstractArray{T3,1}, AlgT<:AbstractMeasureRvFromCCF }
return alg(vels,ccf,ccf_var)
end
function measure_rv_from_ccf(vels::A1, ccf::A2, ccf_var::A3 ; alg::AlgT=MeasureRvFromCCFGaussian() ) where {
T1<:Real, A1<:AbstractArray{T1,1}, T2<:Real, A2<:AbstractArray{T2,1}, T3<:Real, A3<:AbstractArray{T3,2}, AlgT<:AbstractMeasureRvFromCCF }
return alg(vels,ccf,ccf_var)
end
function measure_rv_from_ccf(vels::A1, ccf::A2, ccf_var::A3, covar_base::A4 ; alg::AlgT=MeasureRvFromCCFGaussian() ) where {
T1<:Real, A1<:AbstractArray{T1,1}, T2<:Real, A2<:AbstractArray{T2,1}, T3<:Real, A3<:AbstractArray{T3,1}, T4<:Real, A4<:AbstractArray{T4,2}, AlgT<:AbstractMeasureRvFromCCF }
return alg(vels,ccf,ccf_var,covar_base)
end

MeasureRvFromCCFGaussian does not have version with covar_base argument
MeasureRvFromCCFQuadratic does not have versions with ccf_covar argument and covar_base argument
MeasureRvFromCCFCentroid only has version with ccf_var argument
MeasureRvFromMinCCF only has first version

eford commented

Since trying to use something that doesn't exist will give an error, I removed bug label.