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

Use single-precision floats instead of double

parent 3573428d
No related branches found
No related tags found
No related merge requests found
......@@ -164,21 +164,17 @@ pro metis_l2_prep_uv
history = [history, 'Update WCS and solar ephemeris:', ' SKD version = ' + kernel_version]
; add the history keyword
; update the comment and history keywords
fxaddpar, primary_header, 'COMMENT', 'Uncertainty matrix in the FITS extension is preliminary.'
for k = 0, n_elements(history) - 1 do $
fxaddpar, primary_header, 'HISTORY', history[k]
fxaddpar, primary_header, 'HISTORY', 'L2 FITS file created on ' + date
; add checksum and datasum to the fits header
fits_add_checksum, primary_header, data
; add keywords for file history
if not ref_detector then data = metis_rectify(data, 'UV')
fits_add_checksum, primary_header, data
mwrfits, data, out_file_name, primary_header, /no_comment, /create, /silent
mwrfits, float(data), out_file_name, primary_header, /no_comment, /create, /silent
journal, 'Fits file created:'
journal, ' file name = ' + file_basename(out_file_name)
......@@ -191,7 +187,7 @@ pro metis_l2_prep_uv
fxaddpar, extension_header, 'EXTNAME', 'Quality matrix', 'Extension name'
if not ref_detector then quality_matrix = metis_rectify(quality_matrix, 'UV')
fits_add_checksum, extension_header, quality_matrix
mwrfits, quality_matrix, out_file_name, extension_header, /no_comment, /silent
mwrfits, float(quality_matrix), out_file_name, extension_header, /no_comment, /silent
journal, 'Quality-matrix extension correctly added.'
......@@ -204,7 +200,7 @@ pro metis_l2_prep_uv
error_matrix = data * sqrt(error)
if not ref_detector then error_matrix = metis_rectify(error_matrix, 'UV')
fits_add_checksum, extension_header, error_matrix
mwrfits, error_matrix, out_file_name, extension_header, /no_comment, /silent
mwrfits, float(error_matrix), out_file_name, extension_header, /no_comment, /silent
journal, 'Error-matrix extension correctly added.'
......
......@@ -170,7 +170,9 @@ pro metis_l2_prep_vl_generic
history = [history, 'Update WCS and solar ephemeris:', ' SKD version = ' + kernel_version]
; add the history keyword
; update the comment and history keywords
fxaddpar, primary_header, 'COMMENT', 'Uncertainty matrix in the FITS extension is preliminary.'
for k = 0, n_elements(history) - 1 do $
fxaddpar, primary_header, 'HISTORY', history[k]
......@@ -180,7 +182,7 @@ pro metis_l2_prep_vl_generic
if not ref_detector then data = metis_rectify(data, 'VL')
fits_add_checksum, primary_header, data
mwrfits, data, out_file_name, primary_header, /no_comment, /create, /silent
mwrfits, float(data), out_file_name, primary_header, /no_comment, /create, /silent
journal, 'Fits file created:'
journal, ' file name = ' + file_basename(out_file_name)
......@@ -193,7 +195,7 @@ pro metis_l2_prep_vl_generic
fxaddpar, extension_header, 'EXTNAME', 'Quality matrix', 'Extension name'
if not ref_detector then quality_matrix = metis_rectify(quality_matrix, 'VL')
fits_add_checksum, extension_header, quality_matrix
mwrfits, quality_matrix, out_file_name, extension_header, /no_comment, /silent
mwrfits, float(quality_matrix), out_file_name, extension_header, /no_comment, /silent
journal, 'Quality-matrix extension correctly added.'
......@@ -206,7 +208,7 @@ pro metis_l2_prep_vl_generic
error_matrix = data * sqrt(error)
if not ref_detector then data = metis_rectify(error_matrix, 'VL')
fits_add_checksum, extension_header, intarr(header.naxis1, header.naxis2)
mwrfits, error_matrix, out_file_name, extension_header, /no_comment, /silent
mwrfits, float(error_matrix), out_file_name, extension_header, /no_comment, /silent
journal, 'Error-matrix extension correctly added.'
......
......@@ -301,6 +301,10 @@ pro metis_l2_prep_vl_polariz
ephemeris = solo_get_ephemeris(header, cal_pack)
foreach element, ephemeris do fxaddpar, primary_header, element.name, element.value, element.comment, before = 'DATATYPE'
; update the comment and history keywords
fxaddpar, primary_header, 'COMMENT', 'Uncertainty matrix in the FITS extension is preliminary.'
history = ['Update WCS and solar ephemeris:', ' SKD version = ' + kernel_version]
tb_history = [tb_history, history]
......@@ -351,15 +355,14 @@ pro metis_l2_prep_vl_polariz
; add the history keyword
for k = 0, n_elements(pb_history) - 1 do $
fxaddpar, primary_pb_header, 'HISTORY', pb_history[k]
for k = 0, n_elements(pb_history) - 1 do fxaddpar, primary_pb_header, 'HISTORY', pb_history[k]
fxaddpar, primary_pb_header, 'HISTORY', 'L2 FITS file created on ' + date
; add checksum and datasum to the fits header
if not ref_detector then pb_image = metis_rectify(pb_image, 'VL')
fits_add_checksum, primary_pb_header, pb_image
mwrfits, pb_image, out_file_name[0], primary_pb_header, /no_comment, /create, /silent
mwrfits, float(pb_image), out_file_name[0], primary_pb_header, /no_comment, /create, /silent
journal, 'Polarized-brightness FITS file created:'
journal, ' file name = ' + file_basename(out_file_name[0])
......@@ -372,7 +375,7 @@ pro metis_l2_prep_vl_polariz
fxaddpar, extension_header, 'EXTNAME', 'Quality matrix', 'Extension name'
if not ref_detector then quality_matrix = metis_rectify(quality_matrix, 'VL')
fits_add_checksum, extension_header, quality_matrix
mwrfits, quality_matrix, out_file_name[0], extension_header, /no_comment, /silent
mwrfits, float(quality_matrix), out_file_name[0], extension_header, /no_comment, /silent
journal, 'Quality-matrix extension correctly added.'
......@@ -385,7 +388,7 @@ pro metis_l2_prep_vl_polariz
error_matrix = intarr(header.naxis1, header.naxis2)
if not ref_detector then error_matrix = metis_rectify(error_matrix, 'VL')
fits_add_checksum, extension_header, error_matrix
mwrfits, error_matrix, out_file_name[0], extension_header, /no_comment, /silent
mwrfits, float(error_matrix), out_file_name[0], extension_header, /no_comment, /silent
journal, 'Error-matrix extension correctly added.'
......@@ -406,15 +409,14 @@ pro metis_l2_prep_vl_polariz
; add the history keyword
for k = 0, n_elements(tb_history) - 1 do $
fxaddpar, primary_tb_header, 'HISTORY', tb_history[k]
for k = 0, n_elements(tb_history) - 1 do fxaddpar, primary_tb_header, 'HISTORY', tb_history[k]
fxaddpar, primary_tb_header, 'HISTORY', 'L2 FITS file created on ' + date
; add checksum and datasum to the fits header
if not ref_detector then tb_image = metis_rectify(tb_image, 'VL')
fits_add_checksum, primary_tb_header, tb_image
mwrfits, tb_image, out_file_name[1], primary_tb_header, /no_comment, /create, /silent
mwrfits, float(tb_image), out_file_name[1], primary_tb_header, /no_comment, /create, /silent
journal, 'Total-brightness FITS file created:'
journal, ' file name = ' + file_basename(out_file_name[1])
......@@ -427,7 +429,7 @@ pro metis_l2_prep_vl_polariz
fxaddpar, extension_header, 'EXTNAME', 'Quality matrix', 'Extension name'
if not ref_detector then quality_matrix = metis_rectify(quality_matrix, 'VL')
fits_add_checksum, extension_header, quality_matrix
mwrfits, quality_matrix, out_file_name[1], extension_header, /no_comment, /silent
mwrfits, float(quality_matrix), out_file_name[1], extension_header, /no_comment, /silent
journal, 'Quality-matrix extension correctly added.'
......@@ -440,7 +442,7 @@ pro metis_l2_prep_vl_polariz
error_matrix = intarr(header.naxis1, header.naxis2)
if not ref_detector then error_matrix = metis_rectify(error_matrix, 'VL')
fits_add_checksum, extension_header, error_matrix
mwrfits, error_matrix, out_file_name[1], extension_header, /no_comment, /silent
mwrfits, float(error_matrix), out_file_name[1], extension_header, /no_comment, /silent
journal, 'Error-matrix extension correctly added.'
......@@ -461,15 +463,14 @@ pro metis_l2_prep_vl_polariz
; add the history keyword
for k = 0, n_elements(pb_history) - 1 do $
fxaddpar, primary_polangle_header, 'HISTORY', pb_history[k]
for k = 0, n_elements(pb_history) - 1 do fxaddpar, primary_polangle_header, 'HISTORY', pb_history[k]
fxaddpar, primary_polangle_header, 'HISTORY', 'L2 FITS file created on ' + date
; add checksum and datasum to the fits header
if not ref_detector then pol_angle = metis_rectify(pol_angle, 'VL')
fits_add_checksum, primary_polangle_header, pol_angle
mwrfits, pol_angle, out_file_name[2], primary_polangle_header, /no_comment, /create, /silent
mwrfits, float(pol_angle), out_file_name[2], primary_polangle_header, /no_comment, /create, /silent
journal, 'Polarization-angle FITS file created:'
journal, ' file name = ' + file_basename(out_file_name[2])
......@@ -482,7 +483,7 @@ pro metis_l2_prep_vl_polariz
fxaddpar, extension_header, 'EXTNAME', 'Quality matrix', 'Extension name'
if not ref_detector then quality_matrix = metis_rectify(quality_matrix, 'VL')
fits_add_checksum, extension_header, quality_matrix
mwrfits, quality_matrix, out_file_name[2], extension_header, /no_comment, /silent
mwrfits, float(quality_matrix), out_file_name[2], extension_header, /no_comment, /silent
journal, 'Quality-matrix extension correctly added.'
......@@ -495,7 +496,7 @@ pro metis_l2_prep_vl_polariz
error_matrix = intarr(header.naxis1, header.naxis2)
if not ref_detector then error_matrix = metis_rectify(error_matrix, 'VL')
fits_add_checksum, extension_header, error_matrix
mwrfits, error_matrix, out_file_name[2], extension_header, /no_comment, /silent
mwrfits, float(error_matrix), out_file_name[2], extension_header, /no_comment, /silent
journal, 'Error-matrix extension correctly added.'
......@@ -539,14 +540,13 @@ pro metis_l2_prep_vl_polariz
; add the history keyword
for k = 0, n_elements(tb_history) - 1 do $
fxaddpar, primary_stokes_header, 'HISTORY', tb_history[k]
for k = 0, n_elements(tb_history) - 1 do fxaddpar, primary_stokes_header, 'HISTORY', tb_history[k]
fxaddpar, primary_stokes_header, 'HISTORY', 'L2 FITS file created on ' + date
; add checksum and datasum to the fits header
if not ref_detector then i = metis_rectify(i, 'VL')
fits_add_checksum, primary_stokes_header, i
mwrfits, i, out_file_name[3], primary_stokes_header, /no_comment, /create, /silent
mwrfits, float(i), out_file_name[3], primary_stokes_header, /no_comment, /create, /silent
journal, 'Stokes parameters FITS file created:'
journal, ' file name = ' + file_basename(out_file_name[3])
......@@ -564,7 +564,7 @@ pro metis_l2_prep_vl_polariz
if not ref_detector then q = metis_rectify(q, 'VL')
fits_add_checksum, extension_header, q
mwrfits, q, out_file_name[3], extension_header, /no_comment, /silent
mwrfits, float(q), out_file_name[3], extension_header, /no_comment, /silent
journal, 'Q parameter extension correctly added.'
......@@ -581,7 +581,7 @@ pro metis_l2_prep_vl_polariz
if not ref_detector then u = metis_rectify(u, 'VL')
fits_add_checksum, extension_header, u
mwrfits, u, out_file_name[3], extension_header, /no_comment, /silent
mwrfits, float(u), out_file_name[3], extension_header, /no_comment, /silent
journal, 'U parameter extension correctly added.'
......@@ -594,7 +594,7 @@ pro metis_l2_prep_vl_polariz
if not ref_detector then quality_matrix = metis_rectify(quality_matrix, 'VL')
fits_add_checksum, extension_header, quality_matrix
mwrfits, quality_matrix, out_file_name[3], extension_header, /no_comment, /silent
mwrfits, float(quality_matrix), out_file_name[3], extension_header, /no_comment, /silent
journal, 'Quality-matrix extension correctly added.'
......@@ -608,7 +608,7 @@ pro metis_l2_prep_vl_polariz
if not ref_detector then error_matrix = metis_rectify(error_matrix, 'VL')
fits_add_checksum, extension_header, error_matrix
mwrfits, error_matrix, out_file_name[3], extension_header, /no_comment, /silent
mwrfits, float(error_matrix), out_file_name[3], extension_header, /no_comment, /silent
journal, 'Error-matrix extension correctly added.'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment