Skip to content

Commit

Permalink
Fix chi2 bug when data is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
ptiede committed Nov 8, 2024
1 parent c75a2e2 commit d5781aa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/visualizations/data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,10 @@ end

function _chi2(res::EHTObservationTable)
return sum(datatable(res)) do d
return @. abs2(d.measurement/d.noise)
r2 = @. abs2(d.measurement/d.noise)
# Check if residual is NaN which means that the data is missing
isnan(r2) && return zero(r2)
return r2
end
end

Expand Down

0 comments on commit d5781aa

Please sign in to comment.