Skip to content

Commit

Permalink
attempt to fix sdi contrast
Browse files Browse the repository at this point in the history
  • Loading branch information
scexao6 committed Feb 24, 2024
1 parent b28bc46 commit 7e7b21c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/metrics/contrast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ function throughput(alg, cube::AbstractArray{T,3}, angles, psf_model;
return output, (distance=radii, fake_comps=fake_comps_full, noise=noise)
end

_fix_range(radii, cube::AbstractArray{T,3}) where {T} = radii
_fix_range(radii, cube::AbstractArray{T}) where {T} = radii
_fix_range(radii, cube::AnnulusView) = filter(r -> cube.rmin r cube.rmax, radii)
function _fix_range(radii, cube::MultiAnnulusView)
rmin, rmax = extrema(cube.radii) .- cube.width / 2
Expand Down Expand Up @@ -334,7 +334,7 @@ function throughput(alg, cube::AbstractArray{T,4}, angles, psf_model, scales;

inject!(tmp_frame, psf_model; x, y, amp=mean(A .* flux_scale), fwhm)
for wl_idx in axes(tmp_cube, 3)
inject!(tmp_cube, psf_model, angles; x, y, amp=A * flux_scale[wl_idx], fwhm)
inject!(tmp_cube[:, :, wl_idx, :], psf_model, angles; x, y, amp=A * flux_scale[wl_idx], fwhm)
end

return CircularAperture(x, y, fwhm / 2)
Expand All @@ -343,7 +343,7 @@ function throughput(alg, cube::AbstractArray{T,4}, angles, psf_model, scales;
fake_comps_full .+= tmp_frame

# get reduced output after subtracting and collapsing
reduced = alg(tmp_cube, angles; kwargs...)
reduced = alg(tmp_cube, angles, scales; kwargs...)

injected_flux = photometry(apertures, tmp_frame).aperture_sum
recovered_flux = photometry(apertures, reduced .- reduced_empty).aperture_sum
Expand Down

0 comments on commit 7e7b21c

Please sign in to comment.