Skip to content
Snippets Groups Projects
Commit 7e46e744 authored by Roberto Susino's avatar Roberto Susino
Browse files

Update error codes for HK table interpolation

parent 2c8f4de7
Branches
Tags
No related merge requests found
function interpol_param, table, par_name, date, empty_params = empty_params
if not keyword_set(empty_params) then empty_params = !null
s = where(table.par_name eq par_name, n)
if n eq 0 then return, 0.0
if n eq 0 then begin
journal, 'Error 01: parameter not found in house-keeping table.'
journal
exit, status = 1
endif
if n eq 1 then begin
journal, 'Error 02: insufficient number of parameter values in house-keeping table.'
journal
exit, status = 2
endif
par_time = table.gen_time[s]
par_val = table.eng_val[s]
par_date = dblarr(n)
......@@ -15,10 +24,13 @@ function interpol_param, table, par_name, date, empty_params = empty_params
par_date = par_date[s]
jul_date = date_conv(date, 'JULIAN')
if jul_date ge min(par_date) and jul_date le max(par_date) then value = interpol(float(par_val), par_date, jul_date) else begin
; value = 0.0
journal, 'Error 01: parameter not found in house-keeping dump table.'
journal, 'Error 02: insufficient number of parameter values in house-keeping table.'
journal
exit, status = 1
endelse
if finite(value) then return, value else return, 0.0
if finite(value) then return, value else begin
journal, 'Error 03: interpolation of HK parameter ' + par_name.trim() + ' failed.'
journal
exit, status = 3
endif
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment