Loading metis_l2_prep_uv.pro +20 −5 Original line number Diff line number Diff line Loading @@ -304,10 +304,20 @@ pro metis_l2_prep_uv for k = 0, n_elements(history) - 1 do fxaddpar, primary_header, 'HISTORY', history[k] fxaddpar, primary_header, 'HISTORY', 'L2 FITS file created on ' + date ; write the fits file ; calculate the mask for masking fits_add_checksum, primary_header, float(data) mwrfits, float(data), out_file_name, primary_header, /no_comment, /create, /silent mask = metis_mask(primary_header) if header.datatype ne 1 then mask = mask * 0 + 1 ; mask the data, update the datamin and datamax keywords, and write the fits file data = float(data) data[mask] = 0. fxaddpar, primary_header, 'DATAMIN', min(data, /nan) fxaddpar, primary_header, 'DATAMAX', max(data, /nan) fits_add_checksum, primary_header, data mwrfits, data, out_file_name, primary_header, /no_comment, /create, /silent journal, 'Fits file created:' journal, ' file name = ' + file_basename(out_file_name) Loading Loading @@ -336,8 +346,13 @@ pro metis_l2_prep_uv ; add the extension to the fits file fits_add_checksum, extension_header, float(quality_matrix) mwrfits, float(quality_matrix), out_file_name, extension_header, /no_comment, /silent quality_matrix = float(quality_matrix) quality_matrix[mask] = 0. * mask fxaddpar, extension_header, 'DATAMIN', min(quality_matrix, /nan) fxaddpar, extension_header, 'DATAMAX', max(quality_matrix, /nan) fits_add_checksum, extension_header, quality_matrix mwrfits, quality_matrix, out_file_name, extension_header, /no_comment, /silent journal, 'Quality-matrix extension correctly added.' Loading metis_l2_prep_vl_generic.pro +20 −5 Original line number Diff line number Diff line Loading @@ -382,10 +382,20 @@ pro metis_l2_prep_vl_generic for k = 0, n_elements(history) - 1 do fxaddpar, primary_header, 'HISTORY', history[k] fxaddpar, primary_header, 'HISTORY', 'L2 FITS file created on ' + date ; write the fits file ; calculate the mask for masking fits_add_checksum, primary_header, float(data) mwrfits, float(data), out_file_name, primary_header, /no_comment, /create, /silent mask = metis_mask(primary_header) if header.datatype ne 0 then mask = mask * 0 + 1 ; mask the data, update the datamin and datamax keywords, and write the fits file data = float(data) data[mask] = 0. fxaddpar, primary_header, 'DATAMIN', min(data, /nan) fxaddpar, primary_header, 'DATAMAX', max(data, /nan) fits_add_checksum, primary_header, data mwrfits, data, out_file_name, primary_header, /no_comment, /create, /silent journal, 'Fits file created:' journal, ' file name = ' + file_basename(out_file_name) Loading Loading @@ -414,8 +424,13 @@ pro metis_l2_prep_vl_generic ; add the extension to the fits file fits_add_checksum, extension_header, float(quality_matrix) mwrfits, float(quality_matrix), out_file_name, extension_header, /no_comment, /silent quality_matrix = float(quality_matrix) quality_matrix[mask] = 0. fxaddpar, extension_header, 'DATAMIN', min(quality_matrix, /nan) fxaddpar, extension_header, 'DATAMAX', max(quality_matrix, /nan) fits_add_checksum, extension_header, quality_matrix mwrfits, quality_matrix, out_file_name, extension_header, /no_comment, /silent journal, 'Quality-matrix extension correctly added.' Loading metis_l2_prep_vl_polariz.pro +40 −0 Original line number Diff line number Diff line Loading @@ -529,6 +529,13 @@ pro metis_l2_prep_vl_polariz out_file_name = strarr(4) ; calculate the mask for masking and apply to the quality matrix mask = metis_mask(primary_header) quality_matrix = float(quality_matrix) quality_matrix[mask] = 0. ; ========================================================================== ; polarized brightness ; ========================================================================== Loading @@ -540,6 +547,13 @@ pro metis_l2_prep_vl_polariz pb_error = metis_rectify(pb_error, 'VL') endif ; apply masking pb_image = float(pb_image) pb_error = float(pb_error / pb_image) pb_image[mask] = 0. pb_error[mask] = 0. ; name of the fits file file_name = 'solo_L2_metis-vl-pb_' + date_beg_string + '_V' + version + '.fits' Loading Loading @@ -634,6 +648,13 @@ pro metis_l2_prep_vl_polariz tb_error = metis_rectify(tb_error, 'VL') endif ; apply masking tb_image = float(tb_image) tb_error = float(tb_error / tb_image) tb_image[mask] = 0. tb_error[mask] = 0. ; name of the fits file file_name = 'solo_L2_metis-vl-tb_' + date_beg_string + '_V' + version + '.fits' Loading Loading @@ -728,6 +749,13 @@ pro metis_l2_prep_vl_polariz pol_angle_error = metis_rectify(pol_angle_error, 'VL') endif ; apply masking pol_angle = float(pol_angle) pol_angle_error = float(pol_angle_error / pol_angle) pol_angle[mask] = 0. pol_angle_error[mask] = 0. ; name of the fits file file_name = 'solo_L2_metis-vl-pol-angle_' + date_beg_string + '_V' + version + '.fits' Loading Loading @@ -824,6 +852,18 @@ pro metis_l2_prep_vl_polariz error = metis_rectify(i_error, 'VL') endif ; apply masking i = float(i) q = float(q) u = float(u) error = float(error) / i i[mask] = 0. q[mask] = 0. u[mask] = 0. error[mask] = 0. ; name of the fits file file_name = 'solo_L2_metis-vl-stokes_' + date_beg_string + '_V' + version + '.fits' Loading metis_mask.pro 0 → 100644 +33 −0 Original line number Diff line number Diff line function metis_mask, header compile_opt idl2 nbin = fxpar(header, 'nbin*') naxis = fxpar(header, 'naxis*') cdelt = fxpar(header, 'cdelt*') iopix = fxpar(header, 'iopix*') fspix = fxpar(header, 'fspix*') inn_fov = fxpar(header, 'inn_fov') out_fov = fxpar(header, 'out_fov') ; compute coordinates in degrees with origin in IO center x = ((findgen(naxis[0], start = 1) - iopix[0]) * cdelt[0] / 3600) # replicate(1, naxis[1]) y = replicate(1, naxis[0]) # ((findgen(naxis[1], start = 1) - iopix[1]) * cdelt[1] / 3600) r = sqrt(x ^ 2 + y ^ 2) ; define inner mask m_inn = r ge inn_fov ; compute coordinates in degrees with origin in FS center x = ((findgen(naxis[0], start = 1) - fspix[0]) * cdelt[0] / 3600) # replicate(1, naxis[1]) y = replicate(1, naxis[0]) # ((findgen(naxis[1], start = 1) - fspix[1]) * cdelt[1] / 3600) r = sqrt(x ^ 2 + y ^ 2) ; define outer mask m_out = r le out_fov return, where(m_inn * m_out eq 0) end Loading
metis_l2_prep_uv.pro +20 −5 Original line number Diff line number Diff line Loading @@ -304,10 +304,20 @@ pro metis_l2_prep_uv for k = 0, n_elements(history) - 1 do fxaddpar, primary_header, 'HISTORY', history[k] fxaddpar, primary_header, 'HISTORY', 'L2 FITS file created on ' + date ; write the fits file ; calculate the mask for masking fits_add_checksum, primary_header, float(data) mwrfits, float(data), out_file_name, primary_header, /no_comment, /create, /silent mask = metis_mask(primary_header) if header.datatype ne 1 then mask = mask * 0 + 1 ; mask the data, update the datamin and datamax keywords, and write the fits file data = float(data) data[mask] = 0. fxaddpar, primary_header, 'DATAMIN', min(data, /nan) fxaddpar, primary_header, 'DATAMAX', max(data, /nan) fits_add_checksum, primary_header, data mwrfits, data, out_file_name, primary_header, /no_comment, /create, /silent journal, 'Fits file created:' journal, ' file name = ' + file_basename(out_file_name) Loading Loading @@ -336,8 +346,13 @@ pro metis_l2_prep_uv ; add the extension to the fits file fits_add_checksum, extension_header, float(quality_matrix) mwrfits, float(quality_matrix), out_file_name, extension_header, /no_comment, /silent quality_matrix = float(quality_matrix) quality_matrix[mask] = 0. * mask fxaddpar, extension_header, 'DATAMIN', min(quality_matrix, /nan) fxaddpar, extension_header, 'DATAMAX', max(quality_matrix, /nan) fits_add_checksum, extension_header, quality_matrix mwrfits, quality_matrix, out_file_name, extension_header, /no_comment, /silent journal, 'Quality-matrix extension correctly added.' Loading
metis_l2_prep_vl_generic.pro +20 −5 Original line number Diff line number Diff line Loading @@ -382,10 +382,20 @@ pro metis_l2_prep_vl_generic for k = 0, n_elements(history) - 1 do fxaddpar, primary_header, 'HISTORY', history[k] fxaddpar, primary_header, 'HISTORY', 'L2 FITS file created on ' + date ; write the fits file ; calculate the mask for masking fits_add_checksum, primary_header, float(data) mwrfits, float(data), out_file_name, primary_header, /no_comment, /create, /silent mask = metis_mask(primary_header) if header.datatype ne 0 then mask = mask * 0 + 1 ; mask the data, update the datamin and datamax keywords, and write the fits file data = float(data) data[mask] = 0. fxaddpar, primary_header, 'DATAMIN', min(data, /nan) fxaddpar, primary_header, 'DATAMAX', max(data, /nan) fits_add_checksum, primary_header, data mwrfits, data, out_file_name, primary_header, /no_comment, /create, /silent journal, 'Fits file created:' journal, ' file name = ' + file_basename(out_file_name) Loading Loading @@ -414,8 +424,13 @@ pro metis_l2_prep_vl_generic ; add the extension to the fits file fits_add_checksum, extension_header, float(quality_matrix) mwrfits, float(quality_matrix), out_file_name, extension_header, /no_comment, /silent quality_matrix = float(quality_matrix) quality_matrix[mask] = 0. fxaddpar, extension_header, 'DATAMIN', min(quality_matrix, /nan) fxaddpar, extension_header, 'DATAMAX', max(quality_matrix, /nan) fits_add_checksum, extension_header, quality_matrix mwrfits, quality_matrix, out_file_name, extension_header, /no_comment, /silent journal, 'Quality-matrix extension correctly added.' Loading
metis_l2_prep_vl_polariz.pro +40 −0 Original line number Diff line number Diff line Loading @@ -529,6 +529,13 @@ pro metis_l2_prep_vl_polariz out_file_name = strarr(4) ; calculate the mask for masking and apply to the quality matrix mask = metis_mask(primary_header) quality_matrix = float(quality_matrix) quality_matrix[mask] = 0. ; ========================================================================== ; polarized brightness ; ========================================================================== Loading @@ -540,6 +547,13 @@ pro metis_l2_prep_vl_polariz pb_error = metis_rectify(pb_error, 'VL') endif ; apply masking pb_image = float(pb_image) pb_error = float(pb_error / pb_image) pb_image[mask] = 0. pb_error[mask] = 0. ; name of the fits file file_name = 'solo_L2_metis-vl-pb_' + date_beg_string + '_V' + version + '.fits' Loading Loading @@ -634,6 +648,13 @@ pro metis_l2_prep_vl_polariz tb_error = metis_rectify(tb_error, 'VL') endif ; apply masking tb_image = float(tb_image) tb_error = float(tb_error / tb_image) tb_image[mask] = 0. tb_error[mask] = 0. ; name of the fits file file_name = 'solo_L2_metis-vl-tb_' + date_beg_string + '_V' + version + '.fits' Loading Loading @@ -728,6 +749,13 @@ pro metis_l2_prep_vl_polariz pol_angle_error = metis_rectify(pol_angle_error, 'VL') endif ; apply masking pol_angle = float(pol_angle) pol_angle_error = float(pol_angle_error / pol_angle) pol_angle[mask] = 0. pol_angle_error[mask] = 0. ; name of the fits file file_name = 'solo_L2_metis-vl-pol-angle_' + date_beg_string + '_V' + version + '.fits' Loading Loading @@ -824,6 +852,18 @@ pro metis_l2_prep_vl_polariz error = metis_rectify(i_error, 'VL') endif ; apply masking i = float(i) q = float(q) u = float(u) error = float(error) / i i[mask] = 0. q[mask] = 0. u[mask] = 0. error[mask] = 0. ; name of the fits file file_name = 'solo_L2_metis-vl-stokes_' + date_beg_string + '_V' + version + '.fits' Loading
metis_mask.pro 0 → 100644 +33 −0 Original line number Diff line number Diff line function metis_mask, header compile_opt idl2 nbin = fxpar(header, 'nbin*') naxis = fxpar(header, 'naxis*') cdelt = fxpar(header, 'cdelt*') iopix = fxpar(header, 'iopix*') fspix = fxpar(header, 'fspix*') inn_fov = fxpar(header, 'inn_fov') out_fov = fxpar(header, 'out_fov') ; compute coordinates in degrees with origin in IO center x = ((findgen(naxis[0], start = 1) - iopix[0]) * cdelt[0] / 3600) # replicate(1, naxis[1]) y = replicate(1, naxis[0]) # ((findgen(naxis[1], start = 1) - iopix[1]) * cdelt[1] / 3600) r = sqrt(x ^ 2 + y ^ 2) ; define inner mask m_inn = r ge inn_fov ; compute coordinates in degrees with origin in FS center x = ((findgen(naxis[0], start = 1) - fspix[0]) * cdelt[0] / 3600) # replicate(1, naxis[1]) y = replicate(1, naxis[0]) # ((findgen(naxis[1], start = 1) - fspix[1]) * cdelt[1] / 3600) r = sqrt(x ^ 2 + y ^ 2) ; define outer mask m_out = r le out_fov return, where(m_inn * m_out eq 0) end