function plat_av(obs::Vector{uwreal},plat::Vector{Int64},W::Matrix{Float64},wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}},Nothing}=nothing)
println(logfile,"\t\tFit routine in [$(xdata[1]),...,$(xdata[end])]")
println(logfile,"\t\tparameters :",par...)
println(logfile,"\t\tchi2: ",chi2)
println(logfile,"\t\tchiexp: ",chiexp)
println(logfile,"\t\tpvalue: ",pval)
end
return(par=par,chi2=chi2,chiexp=chiexp,pval=pval)
end
#= function fit_routine(model::Vector{Function}, xdata::Vector{Array{Float64, N}} where N, ydata::Vector{Array{uwreal, N}} where N, param::Int64; wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}}, Nothing}=nothing,
correlated_fit::Bool=false)
if !(length(model) == length(xdata) == length(ydata))