Commit 0f81149c authored by Roberto Susino's avatar Roberto Susino
Browse files

Fix value of TARGET keyword

parent b28d3839
Loading
Loading
Loading
Loading

compute_target.pro

0 → 100644
+19 −0
Original line number Diff line number Diff line
function compute_target, header
    p1 = fxpar(header, 'SC_YAW')
    p2 = fxpar(header, 'SC_PITCH')
    r = fxpar(header, 'RSUN_ARC')

    rho = sqrt(p1 ^ 2 + p2 ^ 2) / r
    psi = (atan(p2, p1) * !radeg + 270) mod 360

    if rho le 0.1 then target = 'On disc, disc centre'
    if rho gt 0.1 and rho lt 0.9 then target = 'On disc'
    if rho ge 0.9 then begin
        target = 'Limb'
        if psi le 1 or psi ge 359 then target += ', North Pole'
        if psi gt 1 and psi lt 179 then target += ', East'
        if psi ge 179 and psi le 181 then target += ', South Pole'
        if psi gt 181 and psi lt 359 then target += ', West'
    endif
    return, target
end
+3 −0
Original line number Diff line number Diff line
@@ -258,6 +258,9 @@ pro metis_l2_prep_uv
        fxaddpar, primary_header, element.name, element.value, element.comment, before = 'DATATYPE'

    history = [history, 'Update WCS and solar ephemeris:', '  SKD version = ' + kernel_version]
    ; update the target keyword

    fxaddpar, primary_header, 'TARGET', compute_target(primary_header)

    ; update the comment and history keywords

+3 −0
Original line number Diff line number Diff line
@@ -302,6 +302,9 @@ pro metis_l2_prep_vl_generic

    history = [history, 'Update WCS and solar ephemeris:', '  SKD version = ' + kernel_version]

    ; update the target keyword

    fxaddpar, primary_header, 'TARGET', compute_target(primary_header)
    ; update the comment and history keywords

    fxaddpar, primary_header, 'COMMENT', 'Uncertainty matrix in the FITS extension is preliminary.'
+3 −0
Original line number Diff line number Diff line
@@ -487,6 +487,9 @@ pro metis_l2_prep_vl_polariz
    foreach element, ephemeris do $
        fxaddpar, primary_header, element.name, element.value, element.comment, before = 'DATATYPE'

    ; update the target keyword

    fxaddpar, primary_header, 'TARGET', compute_target(primary_header)
    ; update the comment and history keywords

    fxaddpar, primary_header, 'COMMENT', 'Uncertainty matrix in the FITS extension is preliminary.'