; docformat = 'rst' ; ; NAME: ; getCameraPixel ; PURPOSE: ; Retrieve the camera pixel scale from FITS header ; ;+ ; :Description: ; Retrieve the camera pixel scale from FITS header ; ; :Categories: ; FITS, Camera ; ; :Returns: A structure containing:: ; .size: The detector pixel size in microns ; .resol: The camera resolution in arcsec/pixel ; .focLen: The telescope focal length in meters ; ; :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) - Added Gem-N/NIRI ; 2015 Feb. - B.Carry (IMCCE) - Added SPHERE/IRDIS ; 2015 Nov. - B.Carry (OCA) - Added compile option idl2 ; 2016 Aug. - B.Carry (OCA) - Corrected arsec -> mas for SPHERE/IRDIS ; 2016 Aug. - B.Carry (OCA) - ESO split in VLT+LSO. EFOSC/NTT added ; 2017 May - B.Carry (OCA) - Added SPHERE/IFS ; 2017 June - B.Carry (OCA) - Corrected bug for IFS if PIXSCAL is missing from header ; 2017 Nov - B.Carry (OCA) - Added SPHERE/ZIMPOL @ ESO-VLT ; 2019 Jan - B.Carry (OCA) - Output is a structure ; 2022 Nov. - B.Carry (OCA) - Added CFHT/PUEO ; 2023 Jan. - B.Carry (OCA) - Added C2PU/QHY ; 2023 Feb. - B.Carry (OCA) - Added NIRSPEC & Hokupaa ; 2023 Dec.: B.Carry (OCA) - Added LBTO ; 2024 Mar.: B.Carry (OCA) - Added VLT/ERIS/NIX ;- function getCameraPixel, 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 = getCameraPixel(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) ;--I.3-- Output Structure -------------------------------------------------------------------- out={size:0., resol:0., focLen:0.} RADtoARC = (180./!PI)*3600. ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- 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-- ISAAC ------------------------------------------------------------------------ 'ISAAC': begin print, 'CHEKC DETECTOR OF ISAAC TO CHOOSE PIXEL SIZE' stop out.size = 27. ;-From https://www.eso.org/sci/facilities/paranal/decommissioned/isaac/inst/isaac_desc.html out.resol = lxpar(head,'HIERARCH ESO INS PIXSCALE') out.focLen = RADtoARC * out.size*(1e-6) / out.resol end ;--II.1.2-- NACO ------------------------------------------------------------------------- 'NACO': begin out.size = 27. ;-From https://www.eso.org/sci/facilities/paranal/instruments/naco/inst/conica.html out.resol = lxpar(head,'HIERARCH ESO INS PIXSCALE') if out.resol<0 then begin out.resol = abs(sxpar(head,'CDELT1'))*3600 endif out.focLen = RADtoARC * out.size*(1e-6) / out.resol end ;--II.1.3-- SPHERE/IRDIS ----------------------------------------------------------------- 'SPHERE/IRDIS': begin headPixel = sxpar(head,'PIXSCAL') if headPixel le 0 then out.resol = 0.012255 else out.resol = headPixel/1000. out.size = 27. out.focLen = RADtoARC * out.size*(1e-6) / out.resol end ;--II.1.4-- SPHERE/IFS ------------------------------------------------------------------- 'SPHERE/IFS': begin headPixel = sxpar(head,'PIXSCAL') if headPixel le 0 then out.resol = 0.00746 else out.resol = headPixel/1000. out.size = 27. out.focLen = RADtoARC * out.size*(1e-6) / out.resol end ;--II.1.5-- SPHERE/ZIMPOL ---------------------------------------------------------------- 'SPHERE/ZIMPOL': begin out.resol = 0.0036 out.size = 30. ;-From http://adsabs.harvard.edu/abs/2018A%26A...619A...9S out.focLen = RADtoARC * out.size*(1e-6) / out.resol end ;--II.1.6-- FORS2 ------------------------------------------------------------------------ 'FORS2': begin ; stop out.size = 15. ;-FORS2 manual P101 https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=2ahUKEwj_7Of1nfjkAhVHbBoKHcmxCV8QFjAAegQIAhAC&url=http%3A%2F%2Fwww.eso.org%2Fsci%2Ffacilities%2Fparanal%2Finstruments%2Ffors%2Fdoc%2FVLT-MAN-ESO-13100-1543_P01.pdf&usg=AOvVaw2MEG0b_UuaQsljY2IzoQpT out.resol = lxpar(head,'HIERARCH ESO INS PIXSCALE') out.focLen = RADtoARC * out.size*(1e-6) / out.resol end ;--II.1.7-- ERIS/NIX --------------------------------------------------------------------- 'ERIS/NIX': begin out.size = 18. case strTrim(lxpar(head, 'HIERARCH ESO INS2 NXCW NAME'),2) of '13mas-JHK': out.resol = 0.013 endcase out.focLen = lxpar(head,'HIERARCH ESO TEL FOCU LEN') end ;--II.1.x-- Unknown ---------------------------------------------------------------------- else: begin message, 'getCameraPixel: ESO Camera not known' return, -1 end endcase end ;--II.2-- ESO-LSO Telescopes --------------------------------------------------------------- 'ESO-LSO': begin case cam of ;--II.2.1-- EFOSC ------------------------------------------------------------------------- 'EFOSC': begin out.size = 15. ;-From https://www.eso.org/sci/facilities/lasilla/instruments/efosc/inst/Ccd40.html binning = lxpar(head,'HIERARCH ESO DET WIN1 BINX') case binning of '1': out.resol = 0.12 '2': out.resol = 0.24 '3': out.resol = 0.36 '4': out.resol = 0.48 else: endcase out.focLen = RADtoARC * out.size*(1e-6) / out.resol end ;--II.2.x-- Unknown ---------------------------------------------------------------------- else: begin message, 'getCameraPixel: ESO Camera not known' return, -1 end endcase end ;--II.3-- Keck Observatory ------------------------------------------------------------- 'KeckII': begin case cam of ;--II.3.1-- NIRC2 ------------------------------------------------------------------------ 'NIRC2': begin out.size = 27. ;-From https://www2.keck.hawaii.edu/inst/nirc2/ObserversManual.html out.resol = sxpar(head,'PIXSCALE', count=nbFound) if nbFound eq 0 or strCmp(out.resol,'null',4) then begin message, /INFO, 'Warning!!! Old Keck/NIRC2 header: no pixscale provided, taking 0.009942 by default' out.resol=0.009942 endif out.focLen = RADtoARC * out.size*(1e-6) / out.resol end ;--II.3.2-- NIRSPEC ---------------------------------------------------------------------- 'NIRSPEC': begin out.resol = sxpar(head,'SPATSCAL') end ;--II.3.x-- Unknown ---------------------------------------------------------------------- else: begin message, 'getCameraPixel: Keck Camera not known' return, -1 end endcase end ;--II.4-- Gemini Observatory ----------------------------------------------------------- 'Gem-N': begin case cam of ;--II.4.1-- NIRI ------------------------------------------------------------------------- 'NIRI': begin out.size = 27. ;-From https://www.gemini.edu/sciops/instruments/niri/imaging/detector-array focal = sxpar(head,'CAMERA') case strtrim(focal,2) of 'f32': out.resol=0.0219 'f14': out.resol=0.0499 'f6' : out.resol=0.1171 endcase out.focLen = RADtoARC * out.size*(1e-6) / out.resol end ;--II.4.2-- Hokupaa ---------------------------------------------------------------------- 'Hokupaa': begin out.resol = sxPar(head,'PIXSCALE') end ;--II.4.x-- Unknown ---------------------------------------------------------------------- else: begin message, 'getCameraPixel: Gemini Camera not known' return, -1 end endcase end ;--II.5-- ALMA --------------------------------------------------------------------------- 'ALMA': begin out.resol = abs( sxPar(head,'CDELT1') ) out.size = 0 out.focLen= 0 end ;--II.6-- CHFT --------------------------------------------------------------------------- 'CFHT': begin out.resol = 0.0348 out.size = sxPar(head,'PIXSIZE') out.focLen= 0 end ;--II.7-- C2PU -------------------------------------------------------------------------- 'C2PU-Om': begin out.resol = abs( sxPar(head,'PIXSCALX') ) out.size = sxPar(head,'PIXSIZEX') * sxPar(head,'BINX') out.focLen= sxPar(head,'FLENGTH') end ;--II.8-- LBTO -------------------------------------------------------------------------- 'LBTO': begin out.resol = 0.0193 out.size = 18.5 out.focLen = RADtoARC * out.size*(1e-6) / out.resol end ;--II.x-- Unknown ------------------------------------------------------------------------ else: begin message, 'getCameraPixel: Telescope not known' return, -1 end endcase ;----- Return Pixel Information ------------------------------------------------------- return, out end