Skip to content

Commit 37d84e2

Browse files
committed
Remove duplicate code
1 parent a25e016 commit 37d84e2

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

ext/VortexStepMethodControlPlotsExt.jl

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -693,30 +693,6 @@ function VortexStepMethod.plot_polars(
693693
if !isempty(literature_path_list)
694694
for path in literature_path_list
695695
raw_data = readdlm(path, ',')
696-
table, header = if raw_data isa Tuple
697-
# readdlm(...; header=true) returns (data, header)
698-
raw_table, raw_header = raw_data
699-
raw_table, lowercase.(string.(vec(raw_header)))
700-
else
701-
# Header is in first row when a single matrix is returned
702-
raw_data[2:end, :], lowercase.(string.(raw_data[1, :]))
703-
end
704-
# Find column indices for alpha, CL, CD, CS (case-insensitive, allow common variants)
705-
alpha_idx = findfirst(x -> occursin("alpha", x) || x == "aoa", header)
706-
cl_idx = findfirst(x -> occursin("cl", x), header)
707-
cd_idx = findfirst(x -> occursin("cd", x), header)
708-
cs_idx = findfirst(x -> occursin("cs", x), header)
709-
(isnothing(alpha_idx) || isnothing(cl_idx) || isnothing(cd_idx)) &&
710-
throw(ArgumentError("Literature CSV must contain alpha/aoa, cl and cd columns: $path"))
711-
# Fallback: if CS not found, fill with zeros
712-
cs_col = cs_idx === nothing ? zeros(size(table, 1)) : table[:, cs_idx]
713-
# Push as [alpha, CL, CD, CS]
714-
push!(polar_data_list, [
715-
table[:, alpha_idx],
716-
table[:, cl_idx],
717-
table[:, cd_idx],
718-
cs_col
719-
])
720696
push!(polar_data_list, _extract_literature_polar_data(raw_data, path))
721697
end
722698
end

0 commit comments

Comments
 (0)