;-------------------------------------------; ;- Object, date and Parameters Information -; ;-------------------------------------------; project='' root='/data/keck/' ;-Serie parameter nbOBJ= 9 imStart= 03007 ;-Deconvolution Parameters hyperArr =[4] threshArr =[3] psfHyperArr=[2] pConv=0.001 ; project='6_Hebe' ; object='hebe' & date='2010-Aug-26' & filter='Kp' & psfHour='13:11' & nbDigit=5 & gain=4. ;-NIRC2-Aug2010 ;-Object, Night, Filter, Closest PSF (HH:MM), and Instrumental gain project='41_Daphne' object='daphne' & date='2013-07-07' & filter='Kp' & psfHour='10:15' & nbDigit=5 & gain=4. ;-Keck 2013Jul07 ;-Object, Night, Filter, Closest PSF (HH:MM), and Instrumental gain ; project='107_Camilla' ; object='camilla' & date='2003-Aug-15' & filter='Kp' & psfHour='06:51' & nbDigit=5 & gain=4. ;-Keck 2003Aug15 ; object='camilla' & date='2004-Sep-05' & filter='Ks' & psfHour='09:45' & nbDigit=5 & gain=10. ;-Sep04: C1 ; object='camilla' & date='2004-Sep-05' & filter='Ks' & psfHour='09:31' & nbDigit=5 & gain=10. ;-Sep04: C2 ; object='camilla' & date='2004-Sep-05' & filter='Ks' & psfHour='09:27' & nbDigit=5 & gain=10. ;-Sep04: C3 ; object='camilla' & date='2004-Sep-05' & filter='Ks' & psfHour='23:49' & nbDigit=5 & gain=10. ;-Sep04: C4-5 ; object='camilla' & date='2004-Sep-05' & filter='Ks' & psfHour='09:47' & nbDigit=5 & gain=10. ;-Sep04: C6 ; object='camilla' & date='2004-Sep-05' & filter='Ks' & psfHour='23:24' & nbDigit=5 & gain=10. ;-Sep04: C7 ; object='camilla' & date='2004-Sep-05' & filter='Ks' & psfHour='09:58' & nbDigit=5 & gain=10. ;-Sep04: C8 ; object='Camilla' & date='2011-Sep-29' & filter='H' & psfHour='05:52' & nbDigit=5 & gain=10. ;-Sep11 ; object='camilla' & date='2002-Mar-06' & filter='Kp' & psfHour='07:56' & nbDigit=5 & gain=4. ; object='camilla' & date='2009-Aug-16' & filter='FeII' & psfHour='11:41' & nbDigit=5 & gain=4. ; object='camilla' & date='2009-Jun-07' & filter='H' & psfHour='08:19' & nbDigit=5 & gain=4. ; object='camilla' & date='2002-Sep-28' & filter='Kp' & psfHour='06:00' & nbDigit=5 & gain=4. ; object='camilla' & date='2003-Jul-15' & filter='H' & psfHour='22:55' & nbDigit=5 & gain=10. ; object='camilla' & date='2004-Aug-31' & filter='H' & psfHour='09:43' & nbDigit=5 & gain=10. ;psf S13 ; object='camilla' & date='2004-Aug-31' & filter='Ks' & psfHour='09:39' & nbDigit=5 & gain=10. ;psf S13 ; object='camilla' & date='2004-Sep-15' & filter='H' & psfHour='04:28' & nbDigit=5 & gain=10. ; object='camilla' & date='2004-Sep-15' & filter='Ks' & psfHour='01:25' & nbDigit=5 & gain=10. ;-Sep11 ; object='camilla' & date='2004-Sep-15' & filter='Ks' & psfHour='04:04' & nbDigit=5 & gain=10. ;-Sep13 ; object='camilla' & date='2004-Sep-15' & filter='Ks' & psfHour='04:25' & nbDigit=5 & gain=10. ;-Sep14 ; object='camilla' & date='2004-Sep-15' & filter='Ks' & psfHour='04:45' & nbDigit=5 & gain=10. ;-Sep15 ; object='camilla' & date='2004-Sep-15' & filter='Ks' & psfHour='05:01' & nbDigit=5 & gain=10. ;-Sep16 ; object='camilla' & date='2004-Oct-07' & filter='Ks' & psfHour='00:55' & nbDigit=5 & gain=10. ;-Oct07 ; object='camilla' & date='2004-Oct-07' & filter='H' & psfHour='23:50' & nbDigit=5 & gain=10. ;-Oct07 ; object='camilla' & date='2004-Oct-07' & filter='Ks' & psfHour='23:46' & nbDigit=5 & gain=10. ;-Oct07 ; object='camilla' & date='2011-Nov-11' & filter='H' & psfHour='00:33' & nbDigit=5 & gain=10. ;-Nov11 ; object='camilla' & date='2015-May-29' & filter='Ks' & psfHour='05:46' & nbDigit=5 & gain=10. ;-SPHERE2015 ; object='camilla' & date='2006-Jan-01' & filter='Ks' & psfHour='13:03' & nbDigit=5 & gain=10. ;- ; object='camilla' & date='2010-Jun-28' & filter='FeII' & psfHour='14:24' & nbDigit=5 & gain=4. ;-Keck 2010Jun28 ; object='camilla' & date='2003-Jun-05' & filter='Ks' & psfHour='14:24' & nbDigit=5 & gain=4. ;-Keck 2003Jun05 frameSize=256 ; object='lagrangea' & date='2000-Jan-01' & filter='K' & psfHour='08:15' & nbDigit=3 & gain=4. ; object='lutetia' & date='2007-Jun-06' & filter='Ks' & psfHour='08:00' & nbDigit=3 & gain=4. ; object='lutetia' & date='2009-Jan-23' & filter='Kp' & psfHour='15:43' & nbDigit=3 & gain=4. ; object='lutetia' & date='2008-Oct-22' & filter='J' & psfHour='15:49' & nbDigit=3 & gain=4. ; object='lutetia' & date='2003-Jul-17' & filter='Ks' & psfHour='23:57' & nbDigit=3 & gain=4. ; object='lutetia' & date='2008-Dec-02' & filter='Kp' & psfHour='15:43' & nbDigit=4 & gain=4. ; object='daphne' & date='2008-Jun-02' & filter='H' & psfHour='00:24' & nbDigit=3 & gain=4. ; object='daphne' & date='2009-Sep-02' & filter='J' & psfHour='15:25' & nbDigit=3 & gain=4. ; object='ceres' & date='2007-Nov-11' & filter='Ks' & psfHour='03:06' & nbDigit=3 & gain=4. ; object='europa' & date='2003-Oct-12' & filter='Kp' & psfHour='09:04' & nbDigit=3 & gain=4. ; object='europa' & date='2005-Jan-20' & filter='Kp' & psfHour='12:11' & nbDigit=3 & gain=4. ; object='europa' & date='2005-Jan-20' & filter='H' & psfHour='14:23' & nbDigit=3 & gain=4. ; object='europa' & date='2007-May-28' & filter='Kp' & psfHour='12:46' & nbDigit=3 & gain=4. ; object='europa' & date='2007-May-28' & filter='H' & psfHour='12:46' & nbDigit=3 & gain=4. ; project='RAP' ; object='juno' & date='2001-Dec-26' & filter='Kp' & psfHour='11:53' & nbDigit=3 & gain=4. ; object='juno' & date='2001-Dec-26' & filter='H' & psfHour='12:06' & nbDigit=3 & gain=4. ; object='juno' & date='2001-Dec-26' & filter='J' & psfHour='12:16' & nbDigit=3 & gain=4. ; object='iris' & date='2002-Aug-05' & filter='J' & psfHour='15:00' & nbDigit=5 & gain=4. ; object='metis' & date='2003-Jun-05' & filter='Ks' & psfHour='07:54' & nbDigit=3 & gain=4. ; object='dahpne' & date='2003-Jun-05' & filter='Ks' & psfHour='07:54' & nbDigit=3 & gain=4. ; object='sylvia' & date='2003-Jun-05' & filter='Ks' & psfHour='07:54' & nbDigit=3 & gain=4. ; object='siegena' & date='2003-Jun-05' & filter='Ks' & psfHour='07:54' & nbDigit=3 & gain=4. ; object='victoria' & date='2003-Jun-11' & filter='Ks' & psfHour='07:54' & nbDigit=3 & gain=4. ; object='aspasia' & date='2006-Aug-16' & filter='Kp' & psfHour='13:51' & nbDigit=5 & gain=4. ; object='daphne' & date='2008-Jan-21' & filter='Kp' & psfHour='14:40' & nbDigit=5 & gain=4. ; object='daphne' & date='2008-Mar-28' & filter='J' & psfHour='00:00' & nbDigit=5 & gain=4. ; object='daphne' & date='2008-Apr-23' & filter='H' & psfHour='13:41' & nbDigit=5 & gain=4. ; object='daphne' & date='2008-May-11' & filter='H' & psfHour='01:00' & nbDigit=5 & gain=10.5 ; object='daphne' & date='2008-May-14' & filter='H' & psfHour='02:35' & nbDigit=5 & gain=10.5 ; object='daphne' & date='2008-May-27' & filter='H' & psfHour='03:00' & nbDigit=5 & gain=10.5 ; object='daphne' & date='2008-Jun-02' & filter='H' & psfHour='02:18' & nbDigit=5 & gain=10.5 ; object='victoria' & date='2010-May-27' & filter='Kp' & psfHour='15:43' & nbDigit=3 & gain=4. ; object='hebe' & date='2010-Dec-12' & filter='Ks' & psfHour='01:35' & nbDigit=5 & gain=10.5 ; object='flora' & date='2010-Dec-12' & filter='Ks' & psfHour='01:35' & nbDigit=5 & gain=10.5 ; object='juno' & date='2010-Dec-12' & filter='Ks' & psfHour='07:15' & nbDigit=5 & gain=10.5 ; object='psyche' & date='2010-Dec-12' & filter='Ks' & psfHour='03:25' & nbDigit=5 & gain=10.5 ; object='siegena' & date='2010-Dec-12' & filter='Ks' & psfHour='01:35' & nbDigit=5 & gain=10.5 ; object='vibilia' & date='2010-Dec-12' & filter='Ks' & psfHour='03:25' & nbDigit=5 & gain=10.5 ; object='iris' & date='2010-Dec-12' & filter='Ks' & psfHour='07:15' & nbDigit=5 & gain=10.5 ; object='winchester' & date='2010-Dec-12' & filter='Ks' & psfHour='07:15' & nbDigit=5 & gain=10.5 ; object='psyche' & date='2010-Dec-13' & filter='Ks' & psfHour='05:39' & nbDigit=5 & gain=10.5 ; object='hebe' & date='2010-Dec-13' & filter='Ks' & psfHour='02:27' & nbDigit=5 & gain=10.5 ; object='iris' & date='2010-Dec-13' & filter='Ks' & psfHour='05:39' & nbDigit=5 & gain=10.5 ; object='flora' & date='2010-Dec-13' & filter='Ks' & psfHour='01:09' & nbDigit=5 & gain=10.5 ; object='siegena' & date='2010-Dec-13' & filter='Ks' & psfHour='01:09' & nbDigit=5 & gain=10.5 ; object='vibilia' & date='2010-Dec-13' & filter='Ks' & psfHour='02:27' & nbDigit=5 & gain=10.5 ; object='lutetia' & date='2011-Jul-17' & filter='Ks' & psfHour='07:15' & nbDigit=5 & gain=10.5 ; object='lutetia' & date='2011-Jul-15' & filter='Kp' & psfHour='10:30' & nbDigit=5 & gain=4. ; object='lutetia' & date='2011-Jul-13' & filter='H' & psfHour='10:10' & nbDigit=5 & gain=4. ; object='lutetia' & date='2011-Aug-15' & filter='Ks' & psfHour='02:14' & nbDigit=5 & gain=10.5 ; object='2005YU55' & date='2011-Nov-09' & filter='Kp' & psfHour='08:14' & nbDigit=5 & gain=4. ; object='2005YU55' & date='2011-Nov-09' & filter='J' & psfHour='08:17' & nbDigit=5 & gain=4. ; object='ganymed' & date='2011-Oct-23' & filter='Kp' & psfHour='08:48' & nbDigit=5 & gain=4. ; object='ganymed' & date='2011-Nov-11' & filter='Ks' & psfHour='00:07' & nbDigit=5 & gain=10.5 ; object='ganymed' & date='2011-Nov-12' & filter='Ks' & psfHour='02:36' & nbDigit=5 & gain=10.5 ; object='ganymed' & date='2011-Nov-13' & filter='Kp' & psfHour='08:02' & nbDigit=5 & gain=4. ; object='eugenia' & date='2011-Nov-28' & filter='Ks' & psfHour='03:06' & nbDigit=5 & gain=10.5 ; object='victoria' & date='2011-Nov-28' & filter='H' & psfHour='07:29' & nbDigit=5 & gain=10.5 ; object='aspasia' & date='2011-Nov-28' & filter='H' & psfHour='08:15' & nbDigit=5 & gain=10.5 ; object='euphrosyne' & date='2011-Nov-28' & filter='Ks' & psfHour='03:57' & nbDigit=5 & gain=10.5 ; object='amphitrite' & date='2011-Nov-28' & filter='Ks' & psfHour='03:57' & nbDigit=5 & gain=10.5 ; object='patientia' & date='2011-Nov-28' & filter='Ks' & psfHour='04:46' & nbDigit=5 & gain=10.5 ; object='egeria' & date='2011-Nov-28' & filter='Ks' & psfHour='00:31' & nbDigit=5 & gain=10.5 ; object='irene' & date='2011-Nov-28' & filter='H' & psfHour='06:29' & nbDigit=5 & gain=10.5 ; object='cybele' & date='2011-Nov-28' & filter='H' & psfHour='09:00' & nbDigit=5 & gain=10.5 ; object='aegle' & date='2011-Nov-28' & filter='H' & psfHour='08:15' & nbDigit=5 & gain=10.5 ; object='nausikaa' & date='2011-Nov-28' & filter='Ks' & psfHour='00:31' & nbDigit=5 & gain=10.5 ;-Viewing parameters ; angleAZ=200 ; T3D, /RESET ;if project ne 'RAP' then project=object ;--------------------; ;- File Information -; ;--------------------; ;-Images Directories dirIM =root+project+'/'+date+'/data/reduced/'+object+'/' dirPSF=root+project+'/'+date+'/data/reduced/psf/' dirDEC=root+project+'/'+date+'/data/trial/' ; print, 'dirDEC: '+dirDEC ; stop if not file_test(dirDEC,/dir) then file_mkdir, dirDEC ;-Loading Mistral Parameters ; restore,filename=root+'mistral.dat' ; restore,filename='/observ/mistral.dat' restore,filename='/home/bcarry/Documents/softs/idl/external/MISTRAL/mistral.dat' Tmistral='myope' visu=0B ;-Mistral visual output (time consuming) ;-File Syntax prefOBJ=object+'.'+filter+'.' prefPSF='psf.'+filter sufRED ='-reduc' suFITS='.fits' sufCUBE='-cube' valConv = string(pConv,format='(E6.0)') ;-------------------------; ;- Point-Spread Function -; ;-------------------------; ; namePSF1 = 'psf.Kp.'+psfHour+'-sna.fits' ; namePSF2 = 'psf.Kp.'+psfHour+'.fits' namePSF1 = 'psf.'+filter+'.'+psfHour+'-sna.fits' namePSF2 = 'psf.'+filter+'.'+psfHour+'.fits' closePSF = readfits( dirPSF+namePSF1, /SILENT) closePDF=(closePSF > 0.) nightPSF = readfits( dirPSF+namePSF2, /SILENT) tempo = closePSF dimI = size(closePSF) closePSF = cropFrame( tempo, [dimI(1),dimI(2)]/2., [frameSize,frameSize] ) tempo = nightPSF dimI = size(nightPSF) nightPSF = fltarr(frameSize,frameSize,dimI(3)) for kI=0, dimI(3)-1 do $ nightPSF(*,*,kI) = cropFrame( tempo(*,*,kI), [dimI(1),dimI(2)]/2., [frameSize,frameSize] ) ;-Spectral Density Distribution (circular mean of spectral density) DSP=calc_spd(nightPSF) DSP=(DSP > 1.e-6) ;-PSF of Reference (closest in time) dim = size(closePSF) psfMean = closePSF ; total(closePSF, 3) / dim(3) ; psfMean = readfits( dirPSF+'psf.Kp.08:12-sna.fits',/silent) ;------------------------------------------------; ;- Deconvolution with Mistral (Copyright ONERA) -; ;------------------------------------------------; ;-Loop over Object for kOBJ=0, nbOBJ-1 do begin ;-Reading the image currentName = prefOBJ+string(imStart+kObj, format='(I0'+strtrim(string(nbDigit),2)+')') image = readfits( dirIM+currentName+sufRED+suFITS, hImage, /SILENT ) image *= gain tempo = image dimI = size(image) image = cropFrame( tempo, [dimI(1),dimI(2)]/2., [frameSize,frameSize] ) ;-Loop over hyper-parameter for kHyper=0, n_elements(hyperArr)-1 do $ ;-Loop over Threshold for kThres=0, n_elements(threshArr)-1 do $ ;-Loop over PSF hyper-parameter for kPsfHP=0, n_elements(psfHyperArr)-1 do begin imDeconv = mistral( image, psfMean, $ regobj=hyperArr(kHyper), $ threshold=threshArr(kThres), $ regpsf=psfHyperArr(kPsfHP), $ conv=pConv, $ /MYO, $ psdpsf=DSP ) ;-Normalization to unity maxDeconv = max(imDeconv) imDeconv /= maxDeconv ;-Updating Header sxaddpar, hImage, 'COMMENT','----Mistral Deconvolution----', 'HISTORY' sxaddpar, hImage, 'H_REG' , hyperArr(kHyper) , 'Deconvolution HYPERPARAMETRE', 'HISTORY' sxaddpar, hImage, 'SEUIL' , threshArr(kThres) , 'Deconvolution SEUIL', 'HISTORY' sxaddpar, hImage, 'PH_REG' , psfHyperArr(kPsfHP), 'Deconvolution PSF PARAMETRE', 'HISTORY' sxaddpar, hImage, 'CONV' , pConv , 'Deconvolution convergence', 'HISTORY' sxaddpar, hImage, 'DEC_NORM', maxDeconv, 'Maximum value before normalization', 'HISTORY' sxaddpar, hImage, 'PSF_TIME', psfHour , 'PSF Time', 'HISTORY' ;-User Information currentDate=systime(/UTC) currentTime=strmid(currentDate, 0,3)+'-'+ $ strmid(currentDate, 8,2)+ $ strmid(currentDate, 3,4)+ $ strmid(currentDate, 19,5)+'-'+ $ strmid(currentDate, 11,2)+'h' sxaddpar, hImage, 'HISTORY' , currentTime+' : Deconvolution by Benoit Carry, ESA' ;-Writing Result nameDEC=currentName+'-h' +strtrim(string(hyperArr(kHyper)),2)+$ 's' +strtrim(string(threshArr(kThres),format='(F4.1)'),2)+$ 'ph'+strtrim(string(psfHyperArr(kPsfHP),format='(F4.1)'),2)+$ 'c' +valConv+suFITS writefits, dirDEC+nameDEC, imDeconv, hImage endfor ;-End of loop over the Parameters endfor ;-End of Loop over the Objects end ;-Passage de ADU a electron ;gain=4. ;-NIRC2 @ Keck II ;gain=11. ;-NACO @ UT4/VLT