@@ -33,20 +33,22 @@ function extract_literature_polar_data(raw_data, path;
3333 end
3434
3535 # Find angle column based on angle_type
36+ contains_token (token, value) = occursin (token, lowercase (strip (string (value))))
3637 angle_idx = if angle_type == " side_slip"
3738 findfirst (
38- x -> occursin (" beta" , x) ||
39- occursin (" side_slip" , x), header)
39+ x -> contains_token (" beta" , x) ||
40+ contains_token (" side_slip" , x), header)
4041 else
4142 findfirst (
42- x -> occursin (" alpha" , x) || x == " aoa" , header)
43+ x -> contains_token (" alpha" , x) ||
44+ lowercase (strip (string (x))) == " aoa" , header)
4345 end
44- cl_idx = findfirst (x -> occursin (" cl" , x), header)
45- cd_idx = findfirst (x -> occursin (" cd" , x), header)
46- cs_idx = findfirst (x -> occursin (" cs" , x), header)
47- cmx_idx = findfirst (x -> occursin (" cmx" , x), header)
48- cmy_idx = findfirst (x -> occursin (" cmy" , x), header)
49- cmz_idx = findfirst (x -> occursin (" cmz" , x), header)
46+ cl_idx = findfirst (x -> contains_token (" cl" , x), header)
47+ cd_idx = findfirst (x -> contains_token (" cd" , x), header)
48+ cs_idx = findfirst (x -> contains_token (" cs" , x), header)
49+ cmx_idx = findfirst (x -> contains_token (" cmx" , x), header)
50+ cmy_idx = findfirst (x -> contains_token (" cmy" , x), header)
51+ cmz_idx = findfirst (x -> contains_token (" cmz" , x), header)
5052
5153 (isnothing (angle_idx) || isnothing (cl_idx) ||
5254 isnothing (cd_idx)) &&
0 commit comments