; docformat = 'rst' ; ; NAME: ; getTelescopeCode ; PURPOSE: ; Return the IAU code ID from getTelescopeID identifyer. ; ;+ ; :Description: ; Return the IAU code ID from getTelescopeID identifyer. ; ; :Categories: ; FITS, Telescope ; ; :Returns: The IAU code identifyer for the telescope ; ; :Params: ; head: in, required, type=string ; A FITS header from the telescope ; ; :Uses: ; getTelescopeID() ; ; :Author: ; B.Carry (OCA) ; ; :Examples: ; Get the IAU code from a FITS file ; IDL> head = headfits( 'file.fits' ) ; IDL> print, getTelescopeCode( head ) ; ; :History: ; Change History:: ; Written in March 2016, B. Carry (OCA) ; 2016 Aug. - B. Carry (OCA) - ESO split into LSO and VLT ; 2023 Dec.: B.Carry (OCA) - Added LBTO ;- function getTelescopeCode, head ;--I-- Initialization ----------------------------------------------------------------- COMPILE_OPT hidden, idl2 ;--II-- Input Syntax Verification ----------------------------------------------------- if N_PARAMS() ne 1 then begin message, /IOERROR, 'Syntax : ID = getTelescopeCode(head)' return, -1 endif ;--III-- Header Parsing --------------------------------------------------------------- telName = getTelescopeId(head) telName = strtrim(telName,2) ;--IV-- Telescope Name Analysis ------------------------------------------------------- case telName of 'ESO-VLT': code='309' 'ESO-LSO': code='809' 'KeckII' : code='568' 'Gem-N' : code='568' 'OHP-120': code='511' 'ALMA' : code='210' 'CFHT' : code='568' 'LBTO' : code='G83' else: begin message, 'Observatory ID not available: '+telName return, -1 end end ;--V-- Return Telescope Code ---------------------------------------------------------- return, code end