; docformat = 'rst' ; ; NAME: ; getCameraPA ; PURPOSE: ; Retrieve the camera pole angle from FITS header ; ;+ ; :Description: ; Retrieve the camera pole angle from FITS header ; ; :Categories: ; FITS ; ; :Returns: The camera pole angle in degrees ; ; :Params: ; head: in, required, type=string ; A FITS header from the telescope ; tel: in, optional, type=string ; The ID of the telescope (from getTelescopeID) ; cam: in, optional, type=string ; The ID of the camera (from getCameraID) ; ; :Uses: ; sxpar(), getTelescopeID(), getCameraID() ; ; :Author: ; B.Carry (OCA) ; ; :History: ; Change History:: ; Written in March 2014, B. Carry (IMCCE) ; 2014-Dec. - B.Carry (IMCCE) - Gem-N/NIRI Added ; 2015-Apr. - B.Carry (IMCCE) - ESO/SPHERE Added ; 2015 Nov. - B.Carry (OCA) - Added compile option idl2 ; 2016 Aug. - B.Carry (OCA) - ESO -> ESO-VLT (implemented) & ESO-LSO (not yet) ; 2017 May - B.Carry (OCA) - Added SPHERE/IFS @ ESO-VLT ; 2019 Jun - B.Carry (OCA) - Added NIRSPEC @ KeckII ; 2022 Nov - B.Carry (OCA) - Added PUEO @ CFHT ; 2023 Jan. - B.Carry (OCA) - Added C2PU/QHY ; 2023 Dec.: B.Carry (OCA) - Added LBTO ; 2024 Mar.: B.Carry (OCA) - Added VLT/ERIS/NIX ;- function getCameraPA, head, tel, cam COMPILE_OPT hidden, idl2 ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- I -- Initialization And Input Verification -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--I.1-- Input Syntax Verification ---------------------------------------------------- if N_PARAMS() lt 1 then begin message, /IOERROR, 'Syntax : ID = getCameraPA(HEAD, [telID, camID])' return, -1 endif ;--I.2-- Telescope and Camera ID ------------------------------------------------------ if not keyword_set(tel) then tel=getTelescopeID(head) if not keyword_set(cam) then cam=getCameraID(head) ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- II -- Header Parsing and Pole Angle Computation -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; case tel of ;--II.1-- ESO-VLT Telescopes --------------------------------------------------------------- 'ESO-VLT': begin case cam of ;--II.1.1-- NACO ------------------------------------------------------------------------- 'NACO': PA = lxpar( head, 'HIERARCH ESO ADA POSANG' ) ;--II.1.2-- ISAAC ------------------------------------------------------------------------ 'ISAAC': PA = lxpar( head, 'HIERARCH ESO ADA POSANG' ) ;--II.1.3-- SPHERE/IRDIS ----------------------------------------------------------------- 'SPHERE/IRDIS': begin mode = lxpar(head,'HIERARCH ESO INS4 COMB ROT') trueNorth = -1.75 ; +/- 0.08 - Maire et al. 2016 pupOffset = 135.99 ; +/- 0.11 - P100 Manual ifuOffset =-100.48 ; +/- 0.13 - P100 Manual ;--II.1.3/A-- Pupil Tracking mode if strcmp(strtrim(mode,2),'pupil',/fold) then begin PARANG1 = float(lxpar(head, 'HIERARCH ESO TEL PARANG START')) PARANG2 = float(lxpar(head, 'HIERARCH ESO TEL PARANG END')) PARANG = ( PARANG1 + PARANG2 ) /2. PA = PARANG + trueNorth + pupOffset ;--II.1.3/B-- Field Tracking mode endif else begin POSANG = lxpar(head, 'HIERARCH ESO INS4 DROT2 POSANG') PA = POSANG + trueNorth endelse end ;--II.1.4-- SPHERE/IRDIS ----------------------------------------------------------------- 'SPHERE/IFS': begin mode = lxpar(head,'HIERARCH ESO INS4 COMB ROT') trueNorth = -1.75 ; +/- 0.08 - Maire et al. 2016 pupOffset = 135.99 ; +/- 0.11 - P100 Manual ifuOffset =-100.48 ; +/- 0.13 - P100 Manual ;--II.1.4/A-- Pupil Tracking mode if strcmp(strtrim(mode,2),'pupil',/fold) then begin PARANG1 = float(lxpar(head, 'HIERARCH ESO TEL PARANG START')) PARANG2 = float(lxpar(head, 'HIERARCH ESO TEL PARANG END')) PARANG = ( PARANG1 + PARANG2 ) /2. PA = PARANG + trueNorth + pupOffset + ifuOffset ;--II.1.4/B-- Field Tracking mode endif else begin POSANG = lxpar(head, 'HIERARCH ESO INS4 DROT2 POSANG') PA = POSANG + trueNorth + ifuOffset endelse end ;--II.1.4-- SPHERE/ZIMPOL ---------------------------------------------------------------- 'SPHERE/ZIMPOL': begin PA=0 end ;--II.1.5-- FORS2 ------------------------------------------------------------------------ 'FORS2': PA = lxpar( head, 'HIERARCH ESO TEL PARANG START' ) ;--II.1.6-- ERIS/NIX --------------------------------------------------------------------- 'ERIS/NIX': begin PA = lxpar( head, 'HIERARCH ESO ADA POSANG' ) end ;--II.1.x-- Unknown ---------------------------------------------------------------------- else: begin message, 'getCameraPA: ESO Camera not known:'+ cam return, -1 end endcase end ;--II.2-- Keck Observatory ------------------------------------------------------------- 'KeckII': begin case cam of ;--II.2.1-- NIRC2 ------------------------------------------------------------------------ 'NIRC2': begin PARANG = sxpar(head, 'PARANG') ;-Parallactic Angle Astrometric ROTPOSN = sxpar(head, 'ROTPOSN') ;-Rotator User Position INSTANGL= sxpar(head, 'INSTANGL') ;-0.7 (from Keck Website) ;-http://www2.keck.hawaii.edu/inst/nirc2/nirc2_ao.html#pa ;-Rotator Mode if strcmp( sxpar(head, 'ROTMODE'), 'vertical angle ') then $ PA = PARANG + ROTPOSN - INSTANGL else $ PA = ROTPOSN - INSTANGL end ;--II.2.2-- NIRSPEC------------------------------------------------------------------------ 'NIRSPEC': begin PARANG = sxpar(head, 'PARANG') ;-Parallactic Angle Astrometric ROTPOSN = sxpar(head, 'ROTPOSN') ;-Rotator User Position INSTANGL= sxpar(head, 'INSTANGL') ;-0.7 (from Keck Website) ;-http://www2.keck.hawaii.edu/inst/nirc2/nirc2_ao.html#pa ;-Rotator Mode ;my guess - kinda offset if strcmp( sxpar(head, 'ROTMODE'), 'vertical angle ') then $ ;my guess - kinda offset PA = PARANG + ROTPOSN - INSTANGL else $ ;my guess - kinda offset PA = ROTPOSN - INSTANGL ;my guess - kinda offset PA += 94. if strcmp( sxpar(head, 'ROTMODE'), 'vertical angle ') then $ PA = PARANG - ROTPOSN else $ PA = PARANG - ROTPOSN ; PA += 94. ;-https://www2.keck.hawaii.edu/inst/nirspec/obs_procedures.html#ao-rotator end ;--II.2.x-- Unknown ---------------------------------------------------------------------- else: begin message, 'getCameraPA: Keck Camera not known' return, -1 end endcase end ;--II.3-- Gemini-North Observatory ----------------------------------------------------- 'Gem-N': begin case cam of ;--II.3.1-- NIRI ------------------------------------------------------------------------- 'NIRI': begin getRot, head, rot, CD PA = -rot end ;--II.3.2-- Hokupaa ---------------------------------------------------------------------- 'Hokupaa': begin ;https://www.gemini.edu/sciops/instruments/uhaos/uhaosIndex.html PA = sxPar(head,'PAX')- 90 ;tentative end ;--II.3.x-- Unknown ---------------------------------------------------------------------- else: begin message, 'getCameraPA: Gemini North Camera not known' return, -1 end endcase end ;--II.4-- LBTO ------------------------------------------------------------------------- 'LBTO': begin case cam of ;--II.4.1-- PISCES ----------------------------------------------------------------------- 'PISCES': begin PA = -sxPar(head,'POSANGLE') / !DTOR end ;--II.4.x-- Unknown ---------------------------------------------------------------------- else: begin message, 'getCameraPA: Gemini North Camera not known' return, -1 end endcase end ;--II.5-- Misc. ------------------------------------------------------------------------ 'OHP-120': PA=0. 'ALMA' : PA=0. 'CFHT' : PA=0. 'C2PU-Om': PA=0. ; Not true!!! ;--II.x-- Unknown ------------------------------------------------------------------------ else: begin message, 'getCameraPA: Telescope not known' return, -1 end endcase ;----- Return Pole Angle -------------------------------------------------------------- return, PA*!DTOR end