diff --git a/metis_l1_prep.pro b/metis_l1_prep.pro index 32e26ec625164b726a542cae7e2974f83d8c8b03..88080509a7978b21c279df2272001353ab556506 100755 --- a/metis_l1_prep.pro +++ b/metis_l1_prep.pro @@ -331,6 +331,19 @@ pro metis_l1_prep empty_params = !null if datatype eq 0 or datatype eq 3 or datatype eq 5 then begin + + ; 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 ; NOTE - DACPOL parameters are not calibrated since a calibration curve does not exist in the IDB. Their calibration in physical units (e.g., voltages or angles) should be done later