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

Fix some header keywords (CHECKSUM and DATASUM)

parent 7a350071
No related branches found
No related tags found
No related merge requests found
pro fix_fits_header, filename
fits_info, filename, n_ext = n_ext, /silent
for ext = 0, n_ext do begin
data = readfits(filename, header, exten_no = ext, /silent)
for k = 0, n_elements(header) - 1 do begin
while header[k].matches('\/ +') do begin
header[k] = header[k].replace('/ ', '/ ')
endwhile
endfor
fits_add_checksum, header, data
modfits, filename, 0, header, exten_no = ext
endfor
end
\ No newline at end of file
pro metis_l1_prep pro metis_l1_prep
; keyword defining if the detector reference frame must be used for the output ; keyword defining if the detector reference frame must be used for the output
ref_detector = 1 ref_detector = 1
...@@ -94,7 +93,7 @@ pro metis_l1_prep ...@@ -94,7 +93,7 @@ pro metis_l1_prep
obt_beg = fxpar(primary_header, 'OBT_BEG') obt_beg = fxpar(primary_header, 'OBT_BEG')
obt_end = fxpar(primary_header, 'OBT_END') obt_end = fxpar(primary_header, 'OBT_END')
obt_avg = (obt_beg + obt_end)/2.0D obt_avg = (obt_beg + obt_end) / 2.0d
date_beg = solo_obt2utc(obt_beg) date_beg = solo_obt2utc(obt_beg)
date_end = solo_obt2utc(obt_end) date_end = solo_obt2utc(obt_end)
...@@ -282,7 +281,7 @@ pro metis_l1_prep ...@@ -282,7 +281,7 @@ pro metis_l1_prep
if datatype le 2 then begin if datatype le 2 then begin
nsumexp = ndit * ndit1 * ndit2 nsumexp = ndit * ndit1 * ndit2
xposure = dit/1000.D0 * nsumexp xposure = dit / 1000.d0 * nsumexp
data = long(data) * nsumexp data = long(data) * nsumexp
if ~isa(comment) then comment = !null if ~isa(comment) then comment = !null
...@@ -293,7 +292,7 @@ pro metis_l1_prep ...@@ -293,7 +292,7 @@ pro metis_l1_prep
journal, ' nsumexp = ' + string(nsumexp, format = '(I0)') journal, ' nsumexp = ' + string(nsumexp, format = '(I0)')
endif else begin endif else begin
nsumexp = 1 nsumexp = 1
xposure = dit/1000.D0 xposure = dit / 1000.d0
endelse endelse
; adjust the primary header (it is almost the same for all data product types) ; adjust the primary header (it is almost the same for all data product types)
...@@ -360,7 +359,6 @@ pro metis_l1_prep ...@@ -360,7 +359,6 @@ pro metis_l1_prep
empty_params = !null empty_params = !null
if datatype eq 0 or datatype eq 3 or datatype eq 5 then begin if datatype eq 0 or datatype eq 3 or datatype eq 5 then begin
; patch to fix the lack of the keyword SEQ_NUM ; patch to fix the lack of the keyword SEQ_NUM
pol_id = fxpar(primary_header, 'POL_ID', missing = 0) pol_id = fxpar(primary_header, 'POL_ID', missing = 0)
...@@ -561,6 +559,10 @@ pro metis_l1_prep ...@@ -561,6 +559,10 @@ pro metis_l1_prep
journal, 'HK binary-table extension correctly added.' journal, 'HK binary-table extension correctly added.'
; fix some header keywords
fix_fits_header, out_file_name
; unload the spice kernels ; unload the spice kernels
load_spice_kernels, kernel_list = kernel_list, /unload load_spice_kernels, kernel_list = kernel_list, /unload
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment