Commit 750fe3b2 authored by Roberto Susino's avatar Roberto Susino
Browse files

Manage new bad-pixel maps including ref. rows

parent b1444aed
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -205,6 +205,13 @@ pro metis_l1_prep

		bad_pixel_map = readfits(cal_pack.path + channel.bad_pixel_map[0].file_name, /silent)

		; adjust the map based on the presence of the reference rows
		
		map_size = size(bad_pixel_map)
		ref_rows = fxpar(primary_header, 'REF_ROWS', missing = -1)
		if ref_rows ge 0 then first_row = ref_rows ? 2 : 0 else first_row = 0
		bad_pixel_map = bad_pixel_map[*, first_row : first_row + map_size[1] - 1]

		; rebin the bad-pixel map to the size of the image to be corrected

		bad_pixel_map = rebin(bad_pixel_map, naxis1, naxis2) * bin_fact^2