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

Add patch to correct for missing SEQ_NUM keyword

parent 5c0777a9
Branches
Tags
No related merge requests found
...@@ -35,6 +35,19 @@ pro metis_l2_prep_vl_generic ...@@ -35,6 +35,19 @@ pro metis_l2_prep_vl_generic
data = mrdfits(input.file_name, 0, primary_header, /silent) data = mrdfits(input.file_name, 0, primary_header, /silent)
; patch to fix the lack of the keyword SEQ_NUM
pol_id = fxpar(primary_header, 'POL_ID', missing = 0)
if pol_id ge 1 and pol_id le 4 then begin
seq_num = fxpar(primary_header, 'SEQ_NUM', missing = 0)
if seq_num eq 0 then begin
obj_cnt = fxpar(primary_header, 'OBJ_CNT')
n_pol = fxpar(primary_header, 'N_POL', missing = 4)
seq_num = ((obj_cnt - 1)/n_pol + 1)
fxaddpar, primary_header, 'SEQ_NUM', seq_num, before = 'POL_ID'
endif
endif
; read the quality matrix ; read the quality matrix
quality_matrix = mrdfits(input.file_name, 'quality matrix', /silent) quality_matrix = mrdfits(input.file_name, 'quality matrix', /silent)
......
...@@ -55,6 +55,22 @@ pro metis_l2_prep_vl_polariz ...@@ -55,6 +55,22 @@ pro metis_l2_prep_vl_polariz
image = mrdfits(input.file_name[k], 0, primary_header, /silent) image = mrdfits(input.file_name[k], 0, primary_header, /silent)
; patch to fix the lack of the keyword SEQ_NUM
seq_num = fxpar(primary_header, 'SEQ_NUM', missing = 0)
if seq_num eq 0 then begin
obj_cnt = fxpar(primary_header, 'OBJ_CNT')
n_pol = fxpar(primary_header, 'N_POL', missing = 4)
seq_num = ((obj_cnt - 1)/n_pol + 1)
fxaddpar, primary_header, 'SEQ_NUM', seq_num, before = 'POL_ID'
endif
if k eq 0 then comment = fxpar(primary_header, 'COMMENT') else begin
sxdelpar, primary_header, 'COMMENT'
foreach line, comment do $
fxaddpar, primary_header, 'COMMENT', line
endelse
header = fits_hdr2struct(primary_header) header = fits_hdr2struct(primary_header)
; ==================================== ; ====================================
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment