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

Manage new header version for Metis OBSW 2.2.0

parent 0c198914
No related branches found
No related tags found
No related merge requests found
...@@ -151,15 +151,33 @@ pro metis_l1_prep ...@@ -151,15 +151,33 @@ pro metis_l1_prep
; join the metadata extension header to the primary header removing useless keywords ; join the metadata extension header to the primary header removing useless keywords
i = where(strmid(primary_header, 0, 8) eq 'COMP_RAT') del_tags = list( $
j = where(strmid(metadata_extension_header, 0, 8) eq 'EXTNAME ') 'XTENSION', $
k = where(strmid(metadata_extension_header, 0, 8) eq 'TFORM1 ') 'BITPIX', $
'NAXIS', $
'NAXIS1', $
'NAXIS2', $
'PCOUNT', $
'GCOUNT', $
'TFIELDS', $
'TTYPE1', $
'TFORM1', $
'TTYPE2', $
'TFORM2', $
'EXTNAME', $
'CHECKSUM', $
'DATASUM', $
'END' $
)
primary_header = [ $ foreach item, metadata_extension_header do begin
primary_header[0 : i], $ tag = strmid(item, 0, 8)
metadata_extension_header[j + 1 : k - 1], $ tag = tag.trim()
primary_header[i + 1: *] $ if ~ isa(del_tags.where(tag)) then begin
] value = fxpar(metadata_extension_header, tag, comment = comment)
fxaddpar, primary_header, tag, value, comment, before = 'CHECKSUM'
endif
endforeach
; rebin the image if binning was applied during the acquisition and check for the data quality ; rebin the image if binning was applied during the acquisition and check for the data quality
; NOTE - this is done only for image data products ; NOTE - this is done only for image data products
...@@ -285,8 +303,8 @@ pro metis_l1_prep ...@@ -285,8 +303,8 @@ pro metis_l1_prep
fxaddpar, primary_header, 'BSCALE', 1, 'Ratio of physical to array value at 0 offset', before = 'DATAMIN' fxaddpar, primary_header, 'BSCALE', 1, 'Ratio of physical to array value at 0 offset', before = 'DATAMIN'
fxaddpar, primary_header, 'BZERO', 0, 'Physical value for the array value 0', before = 'DATAMIN' fxaddpar, primary_header, 'BZERO', 0, 'Physical value for the array value 0', before = 'DATAMIN'
fxaddpar, primary_header, 'BTYPE', metis_datatype[datatype], 'Science data object type', before = 'DATAMIN' fxaddpar, primary_header, 'BTYPE', metis_datatype[datatype], 'Science data object type', before = 'DATAMIN'
fxaddpar, primary_header, 'BUNIT', 'DN', 'Units of physical value, after application of BSCALE and BZERO', before = 'DATAMIN' fxaddpar, primary_header, 'BUNIT', 'DN', 'Units of physical value', before = 'DATAMIN'
fxaddpar, primary_header, 'BLANK', 0 fxaddpar, primary_header, 'BLANK', 0, 'Data value used to mark undefined pixels', after = 'BUNIT'
fxaddpar, primary_header, 'DATAMIN', min(data, /nan) fxaddpar, primary_header, 'DATAMIN', min(data, /nan)
fxaddpar, primary_header, 'DATAMAX', max(data, /nan) fxaddpar, primary_header, 'DATAMAX', max(data, /nan)
fxaddpar, primary_header, 'IDB_VERS', input.idb_version, '', before = 'HDR_VERS' fxaddpar, primary_header, 'IDB_VERS', input.idb_version, '', before = 'HDR_VERS'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment