Commit 7a4420be authored by Roberto Susino's avatar Roberto Susino
Browse files

Add patch to correct for missing SEQ_NUM keyword

parent 5c0777a9
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -35,6 +35,19 @@ pro metis_l2_prep_vl_generic

	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

	quality_matrix = mrdfits(input.file_name, 'quality matrix', /silent)
+16 −0
Original line number Diff line number Diff line
@@ -55,6 +55,22 @@ pro metis_l2_prep_vl_polariz

		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)

		; ====================================