; docformat = 'rst' ; ; NAME: ; getCameraCoords ; PURPOSE: ; Retrieve sky coordinates afrom FITS header ; ;+ ; :Description: ; Retrieve sky coordinates afrom FITS header ; ; :Categories: ; FITS, Camera ; ; :Returns: A structure with sky coordinates. Fields are:: ; If fails, return codes are:: ; ; :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) ; ; :Keywords: ; empty: in, optional, type=boolean, default=0 ; If set, return an empty structure ; ; :Uses: ; sxpar, lxpar, getTelescopeID, getCameraID ; ; :Author: ; B.Carry (OCA) ; ; :History: ; Change History:: ; Written in July 2017, B. Carry (OCA) ; 2023 Dec.: B.Carry (OCA) - Added LBTO ;- function getCameraCoords, head, tel, cam, empty=empty COMPILE_OPT hidden, idl2 ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- I -- Initialization And Input Verification -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--I.1-- Syntax Verification -----------------------------------------------------------------; if n_params() lt 1 then begin message, 'Syntax : filter = getCameraCoords(head, [tel, cam])' return, -1 endif ;--I.2-- Coordinates Structure ---------------------------------------------------------------; coords = {ra:0., dec:0., alt:0., az:0., airmass:0. } if keyword_set(empty) then return, coords ;--I.3-- 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 Extract Coordinates -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; case tel of ;--II.1-- ESO-VLT Telescopes --------------------------------------------------------------; 'ESO-VLT': begin coords.RA = sxPar(head, 'RA') coords.Dec = sxPar(head, 'DEC') coords.Alt = sxPar(head, 'EL') coords.Az = sxPar(head, 'AZ') coords.airmass= sxPar(head, 'AIRMASS') end ;--II.2-- ESO-LSO Telescopes --------------------------------------------------------------; 'ESO-LSO': begin coords.RA = sxPar(head, 'RA') coords.Dec = sxPar(head, 'DEC') coords.Alt = sxPar(head, 'EL') coords.Az = sxPar(head, 'AZ') coords.airmass= sxPar(head, 'AIRMASS') end ;--II.3-- Keck Observatory ----------------------------------------------------------------; 'KeckII': begin coords.RA = sxPar(head, 'RA') coords.Dec = sxPar(head, 'DEC') coords.Alt = sxPar(head, 'EL') coords.Az = sxPar(head, 'AZ') coords.airmass= sxPar(head, 'AIRMASS') end ;--II.4-- Gemini Observatory --------------------------------------------------------------; 'Gem-S': begin coords.RA = sxPar(head, 'RA') coords.Dec = sxPar(head, 'DEC') coords.Alt = sxPar(head, 'EL') coords.Az = sxPar(head, 'AZ') coords.airmass= sxPar(head, 'AIRMASS') end 'Gem-N': begin coords.RA = sxPar(head, 'RA') coords.Dec = sxPar(head, 'DEC') coords.Alt = sxPar(head, 'EL') coords.Az = sxPar(head, 'AZ') coords.airmass= sxPar(head, 'AIRMASS') end ;--II.5-- LBT Observatory -----------------------------------------------------------------; 'LBTO': begin coords.RA = sxPar(head, 'RA_AC') coords.Dec = sxPar(head, 'DEC_AC') coords.Alt = sxPar(head, 'EL')/3600 coords.Az = sxPar(head, 'AZ')/3600 coords.airmass= 1/cos( coords.Alt / !RADEG ) end ;--II.x-- Unknown -------------------------------------------------------------------------; else: begin message, 'getCameraCoords: Telescope not known' return, -3 end endcase ;--III.X-- Return Filter Structure -----------------------------------------------------------; return, coords end