Skip to content

Commit 36aef48

Browse files
committed
update for DRP 1.2; skip FITS with missing expmeter data, incl files with missing telluric data
1 parent 86daaf4 commit 36aef48

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

scripts/make_manifest_solar_1.1.jl

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ end
135135
=#
136136

137137
try
138-
mkpath(output_path)
138+
mkpath(input_path)
139139
global df_files = NEID.make_manifest(input_path) #joinpath(root_path,input_dir, subdir))
140140

141141
catch ex
@@ -160,6 +160,23 @@ df_files_calib = df_files |>
160160
df_files_calib[!,:airmass] = fill(NaN,size(df_files_calib,1))
161161
CSV.write(manifest_calib_filename, df_files_calib)
162162

163+
# Remove any files without exposure meter data
164+
#expmeter_cols = [:expmeter_mean, :expmeter_mean_blue, :expmeter_mean_green, :expmeter_mean_red, :expmeter_mean_winsor, :expmeter_rms, :expmeter_rms_blue, :expmeter_rms_green, :expmeter_rms_red, :expmeter_rms_winsor ]
165+
expmeter_mask = .!ismissing.(df_files.expmeter_mean)
166+
df_files = df_files[expmeter_mask,:]
167+
168+
# Deal with case of no telluric data
169+
df_files.telluric_zenith[isnothing.(df_files.telluric_zenith)] .= missing
170+
df_files.telluric_wvapor[isnothing.(df_files.telluric_wvapor)] .= missing
171+
if eltype(df_files.telluric_wvapor) == Union{Missing, Nothing} df_files.telluric_wvapor = fill(missing,size(df_files,1)) end
172+
if eltype(df_files.telluric_wvapor) == Union{Missing, Nothing, Float64}
173+
df_files.telluric_wvapor = convert.(Union{Missing, Float64}, df_files.telluric_wvapor)
174+
end
175+
if eltype(df_files.telluric_zenith) == Union{Missing, Nothing} df_files.telluric_zenith = fill(missing,size(df_files,1)) end
176+
if eltype(df_files.telluric_zenith) == Union{Missing, Nothing, Float64}
177+
df_files.telluric_zenith = convert.(Union{Missing, Float64}, df_files.telluric_zenith)
178+
end
179+
163180
try
164181
global df_files_obs = df_files |>
165182
@filter( _.target == "Sun" ) |>

0 commit comments

Comments
 (0)