Skip to content

line_list argument not used in function #46

@hematthi

Description

@hematthi

function make_λ_list_for_bad_columns(line_list::DataFrame, harps_data::DT ) where {
T1<:Real, A1<:AbstractArray{T1}, T2<:Real, A2<:AbstractArray{T2}, T3<:Real, A3<:AbstractArray{T3},
IT<:HARPS.AnyHARPS, ST<:Spectra2DBasic{T1,T2,T3,A1,A2,A3,IT}, DT<:AbstractArray{ST,1} }
order_list = 1:size(first(harps_data).λ,2)
df_bad_col_λs = DataFrame(:order=>Int[], :lambda_lo=>Float64[], :lambda_hi=>Float64[])
for order in order_list
λ_extrema = NaNMath.extrema(first(harps_data).λ[:,order])
if isnan(first(λ_extrema)) || isnan(last(λ_extrema)) continue end
for bcr in bad_col_ranges(HARPS2D(), order)
pixlo = first(bcr)
pixhi = pixlo + 1
if pixhi > size(first(harps_data).λ,1)
pixhi -= 1
pixlo -= 1
end
doppler_factors = map(obsid-> haskey(harps_data[obsid].metadata,:doppler_factor) ? harps_data[obsid].metadata[:doppler_factor] : 1 , 1:length(harps_data))
Δλ_pixel = (first(harps_data).λ[pixhi,order] - first(harps_data).λ[pixlo,order]) * doppler_factors[1]
(λ_lo, λ_hi) = mapreduce(obsid->extrema(harps_data[obsid].λ[bcr,order]) .* doppler_factors[obsid],
(a,b) -> (min(a[1],b[1]), max(a[2],b[2])), 1:length(harps_data) )
λ_lo -= Δλ_pixel/2
λ_hi += Δλ_pixel/2
push!(df_bad_col_λs, Dict(:order=>order, :lambda_lo=>λ_lo, :lambda_hi=>λ_hi) )
end
end
return df_bad_col_λs
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions