ARGUS array
Phase II preparation
- Cookbook/tips for creating the Phase II FLD file here.
-
- Page currently empty — need contribution
-
Reduction
There are 2 dedicated pipelines which produce much the same results: the ESO CPL pipeline (which can be run through the data organizer GUI gasgano or ESOrex on the command line), and girBLDRS (GIRAFFE BaseLine Data Reduction Software from the Geneva group) (which also works well, and is recommended for accurate wavelength calibration — although the documentation is less complete). Neither of these pipelines include sky subtraction or flux calibration routines, so these must be done manually (e.g. using IRAF).
The GIRAFFE pipeline carries out the usual steps which are described in the page:
[http://www.eso.org/observing/dfo/quality/GIRAFFE/pipeline/recipe_science.html]
Sky fibres are extracted. But the sky subtraction needs to be carried out by the user. It is not carried out automatically because you might want to combine all sky fibres in order to get a median sky and then subtract it from the other fibre; you might want to shift a bit the skylines in order to correct to spectrograph shifts; you may want to try out to scale a bit the sky spectrum before subtraction, etc.
Thus the pipeline delivers individual sky fibres corrected for the fibre-to-fibre response.
Below is a sample reduction script using the girBLDRS pipeline with post-processing steps done in IRAF. Additional scripts needed: make_sky.cl, make_cube.cl.
############################################
#basic reduction using girBLDRS
############################################
### BIAS ###
pipe biasMast RAW=../raw/GIRAF.2008-07-23T17_19_53.831.fits,../raw/GIRAF.2008-07-23T17_22_41.074.fits,../raw/GIRAF.2008-07-23T17_25_28.256.fits,../raw/GIRAF.2008-07-23T17_28_17.808.fits,../raw/GIRAF.2008-07-23T17_31_05.010.fits
### FF (localisation) ###
#L614 (L5) grating
pipe locMast RAW=../raw/GIRAF.2008-07-23T17_39_56.299.fits,../raw/GIRAF.2008-07-23T17_43_50.758.fits,../raw/GIRAF.2008-07-23T17_47_42.104.fits
### Wave cal ###
#L614 (L5) grating
pipe wcalMast RAW=../raw/GIRAF.2008-07-23T17_52_18.144.fits
### Science ###
#can't do CR rej because only 2 exps
#SPLIT saves a separate tfits file for each fibre - don't want that (what's tfits anyway?)
#SKYSS hangs on the "Box-filter for search for emission lines half size=3" stage with 100% CPU usage - switch off
#IMAGE creates a reconstructed image of the cube, but with what wavelength range? Can we set this? - useful for checking things have gone ok
pipe extract NAM=exp1 RAW=../raw/GIRAF.2008-07-23T04_32_47.923.fits IMAGE=image NFF=nff
pipe extract NAM=exp2 RAW=../raw/GIRAF.2008-07-23T04_56_13.964.fits IMAGE=image NFF=nff
### FLUX STD ###
pipe locMast RAW=../raw/GIRAF.2008-07-23T10_32_20.576.fits,../raw/GIRAF.2008-07-23T10_33_28.741.fits,../raw/GIRAF.2008-07-23T10_34_34.215.fits
pipe extract NAM=std RAW=../raw/GIRAF.2008-07-23T10_28_18.528.fits IMAGE=image NFF=nff
############################################
#post-processing steps - in IRAF
############################################
# 1. Sky subtraction:
# Extract sky fibres from each exp, sum and CR reject using imcomb (check all sky fibres before combination and subtraction)
cl < make_sky.cl #IRAF script for extracting out sky spectra from both input exposures, combining with CR reject and summing
#have to transpose original data (swap x and y) to get imarith to work
imtranspose NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin_tran
imarith NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin_tran - NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin_sky_comb NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin_skysub
imtranspose NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin_tran
imarith NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin_tran - NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin_sky_comb NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin_skysub
#convert nm to A (update relevant keywords)
#Have to include the WAT1_001 keyword or 'calibrate' doesn't work
#exp1
imgets("NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin_skysub",param="CRVAL1")
hedit ("NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin_skysub", "CRVAL1", real(imgets.value)*10, add+, addonly+, delete-, verify-, show+, update+)
imgets("NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin_skysub",param="CDELT1")
hedit ("NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin_skysub", "CDELT1", real(imgets.value)*10, add+, addonly+, delete-, verify-, show+, update+)
hedit ("NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin_skysub", "CD1_1", real(imgets.value)*10, add+, addonly+, delete-, verify-, show+, update+)
hedit ("NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin_skysub", "CTYPE1", "ANGSTROMS", add+, addonly+, delete-, verify-, show+, update+)
hedit ("NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin_skysub", "WAT1_001", "wtype=linear label=Wavelength units=Angstroms", add+, addonly+, delete-, verify-, show+, update+)
#exp 2
imgets("NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin_skysub",param="CRVAL1")
hedit ("NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin_skysub", "CRVAL1", real(imgets.value)*10, add+, addonly+, delete-, verify-, show+, update+)
imgets("NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin_skysub",param="CDELT1")
hedit ("NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin_skysub", "CDELT1", real(imgets.value)*10, add+, addonly+, delete-, verify-, show+, update+)
hedit ("NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin_skysub", "CD1_1", real(imgets.value)*10, add+, addonly+, delete-, verify-, show+, update+)
hedit ("NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin_skysub", "CTYPE1", "ANGSTROMS", add+, addonly+, delete-, verify-, show+, update+)
hedit ("NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin_skysub", "WAT1_001", "wtype=linear label=Wavelength units=Angstroms", add+, addonly+, delete-, verify-, show+, update+)
# 2. Flux calibration:
noao
onedspec
onedspec.dispaxis=2
imtranspose LTT1020ArgusL5stddbSub.oxtsp.rebinlin LTT1020ArgusL5stddbSub.oxtsp.rebinlin_tran
# Sum all fibres of STD obs
scombine("LTT1020ArgusL5stddbSub.oxtsp.rebinlin_tran", "LTT1020ArgusL5stddbSub.oxtsp.rebinlin_tran_sum", apertures="", group="all", combine="sum", reject="crrej", hsigma=3, rdnoise=4.3, gain=2.3)
imgets("LTT1020ArgusL5stddbSub.oxtsp.rebinlin_tran",param="EXPTIME")
hedit ("LTT1020ArgusL5stddbSub.oxtsp.rebinlin_tran_sum", "EXPTIME", real(imgets.value), add-, addonly-, delete-, verify-, show+, update+) #correct EXPTIME keyword
imgets("LTT1020ArgusL5stddbSub.oxtsp.rebinlin_tran_sum",param="CRVAL1")
hedit ("LTT1020ArgusL5stddbSub.oxtsp.rebinlin_tran_sum", "CRVAL1", real(imgets.value)*10, add-, addonly-, delete-, verify-, show+, update+) #convert nm to A
imgets("LTT1020ArgusL5stddbSub.oxtsp.rebinlin_tran_sum",param="CDELT1")
hedit ("LTT1020ArgusL5stddbSub.oxtsp.rebinlin_tran_sum", "CDELT1", real(imgets.value)*10, add-, addonly-, delete-, verify-, show+, update+) #convert nm to A
hedit ("LTT1020ArgusL5stddbSub.oxtsp.rebinlin_tran_sum", "CD1_1", real(imgets.value)*10, add-, addonly-, delete-, verify-, show+, update+) #convert nm to A
# Use IRAF STANDARD, SENSFUNC to create a sensitivity function
standard("LTT1020ArgusL5stddbSub.oxtsp.rebinlin_tran_sum","std_LTT1020ArgusL5",\
extinction="onedstds$ctioextinct.dat",caldir="onedstds$ctionewcal/",observatory="esovlt",star_name="L1020",\
inter+)
sensfunc(standard="std_LTT1020ArgusL5",sensitiv="sens_LTT1020ArgusL5",extinction="onedstds$ctioextinct.dat",\
observatory="esovlt",order=4,inter+)
# Apply sensitivity function to flux calibrate 2 science exps
calibrate("NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin_skysub","NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin_skysub_calib",\
extinct+,extinction="onedstds$ctioextinct.dat",observatory="esovlt",sensiti="sens_LTT1020ArgusL5.0001")
imarith NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin_skysub_calib * 1e15 NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin_skysub_calib
calibrate("NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin_skysub","NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin_skysub_calib",\
extinct+,extinction="onedstds$ctioextinct.dat",observatory="esovlt",sensiti="sens_LTT1020ArgusL5.0001")
imarith NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin_skysub_calib * 1e15 NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin_skysub_calib
# 3. Combine dithered exposures and CR reject
#first CR reject using LACosmic
lacos_im NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin_skysub_calib NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin_skysub_calib_la exp1_lacos.pl \
gain=1 readn=0 sigclip=0.5 sigfrac=0.5 objlim=0.7 niter=4 verb+
lacos_im NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin_skysub_calib NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin_skysub_calib_la exp2_lacos.pl \
gain=1 readn=0 sigclip=0.5 sigfrac=0.5 objlim=0.7 niter=4 verb+
#have to convert to cubes in order to align and shift
cl < make_cube.cl #IRAF script - convert indiv reduced (RSS) exps into cubes
# Now shift and combine with a BPM for getting rid of dead fibres (that's why we dithered spatially), no CR reject needed because already done
#create BPM so that the dead fibres are excluded when combining the exps
imarith NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin_skysub_calib_la_cube.fits / NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin_skysub_calib_la_cube.fits bpm_exp1.pl #divide by itself and hope 0/0=0
imarith NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin_skysub_calib_la_cube.fits / NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin_skysub_calib_la_cube.fits bpm_exp2.pl
#add bpm to header keywords
hedit images="NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin_skysub_calib_la_cube.fits" fields="BPM" \
value="bpm_exp1.pl" add+ addonly+ verify- show+ update+
hedit images="NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin_skysub_calib_la_cube.fits" fields="BPM" \
value="bpm_exp2.pl" add+ addonly+ verify- show+ update+
#do the combination (shift file specifying that exp2 needs to be shifted 1 pix to right)
imcomb("NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin_skysub_calib_la_cube.fits,NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin_skysub_calib_la_cube.fits", "NGC6357_IFU1ArgusL5_skysub_calib_la_cube_comb.fits", \
combine="average", offsets="shift.dat", masktype="badvalue", maskvalue=0)
#update and add keywords
real exptime_exp1, exptime_exp2, airmass_start_exp1, airmass_end_exp1, airmass_start_exp2, airmass_end_exp2, airmass_exp1, airmass_exp2
string grat, wlen, ra, dec
#convert crazy long ESO keywords to IRAF understandable lengths using hierarch28 program (google for this to find it if you don't have it)
!~/iraf/hierarch28 NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin.fits ESO_keyword_table.conv
!~/iraf/hierarch28 NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin.fits ESO_keyword_table.conv
imgets("NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin",param="EXPTIME")
exptime_exp1 = real(imgets.value)
imgets("NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin",param="EXPTIME")
exptime_exp2 = real(imgets.value)
imgets("NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin",param="AIRMAS_S")
airmass_start_exp1 = real(imgets.value)
imgets("NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin",param="AIRMAS_E")
airmass_end_exp1 = real(imgets.value)
imgets("NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin",param="AIRMAS_S")
airmass_start_exp2 = real(imgets.value)
imgets("NGC6357_IFU1ArgusL5exp2dbSub.oxtsp.rebinlin",param="AIRMAS_E")
airmass_end_exp2 = real(imgets.value)
airmass_exp1 = airmass_start_exp1+((airmass_end_exp1-airmass_start_exp1)/2)
airmass_exp2 = airmass_start_exp2+((airmass_end_exp2-airmass_start_exp2)/2)
imgets("NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin",param="GRAT")
grat = (imgets.value)
imgets("NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin",param="WLEN")
wlen = (imgets.value)
imgets("NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin",param="RA")
ra = (imgets.value)
imgets("NGC6357_IFU1ArgusL5exp1dbSub.oxtsp.rebinlin",param="DEC")
dec = (imgets.value)
hedit ("NGC6357_IFU1ArgusL5_skysub_calib_la_cube_comb.fits", "EXPTIME", (exptime_exp1+exptime_exp2)/2, add+, addonly+, delete-, verify-, show+, update+) #exp1 add EXPTIME keyword
hedit ("NGC6357_IFU1ArgusL5_skysub_calib_la_cube_comb.fits", "AIRMASS", (airmass_exp1+airmass_exp2)/2, add+, addonly+, delete-, verify-, show+, update+) #exp1 add AIRMASS keyword
imgets("NGC6357_IFU1ArgusL5_skysub_calib_la_cube_comb.fits",param="CD3_3")
hedit ("NGC6357_IFU1ArgusL5_skysub_calib_la_cube_comb.fits", "CDELT3", real(imgets.value), add+, addonly+, delete-, verify-, show+, update+)
hedit ("NGC6357_IFU1ArgusL5_skysub_calib_la_cube_comb.fits", "CTYPE3", "ANGSTROMS", add+, addonly+, delete-, verify-, show+, update+)
hedit ("NGC6357_IFU1ArgusL5_skysub_calib_la_cube_comb.fits", "WAT1_003", "wtype=linear label=Wavelength units=Angstroms", add+, addonly+, delete-, verify-, show+, update+)
hedit ("NGC6357_IFU1ArgusL5_skysub_calib_la_cube_comb.fits", "GRAT", (grat), add+, addonly+, delete-, verify-, show+, update+)
hedit ("NGC6357_IFU1ArgusL5_skysub_calib_la_cube_comb.fits", "WLEN", (wlen), add+, addonly+, delete-, verify-, show+, update+)
hedit ("NGC6357_IFU1ArgusL5_skysub_calib_la_cube_comb.fits", "RA", (ra), add+, addonly+, delete-, verify-, show+, update+)
hedit ("NGC6357_IFU1ArgusL5_skysub_calib_la_cube_comb.fits", "DEC", (dec), add+, addonly+, delete-, verify-, show+, update+)
# 4. Convert back to RSS format if needed by reversing the actions of make_cube.cl
If necessary a DAR correction can be performed using any of the methods described in the DAR correction section.
Deployable IFUs
We need contributions here