Reducing IFU Data ITSO DR Workshop, Thursday 5th May Nic Scott.

Slides:



Advertisements
Similar presentations
GMOS Data Reduction Richard McDermid Gemini Data Reduction Workshop Tucson, July 2010.
Advertisements

Echelle Spectroscopy Dr Ray Stathakis, AAO. What is it? n Echelle spectroscopy is used to observe single objects at high spectral detail. n The spectrum.
Programming Types of Testing.
Image reconstruction and analysis for X-ray computed microtomography Lucia Mancini 1, Francesco Montanari 2, Diego Dreossi 3 1 Elettra - Trieste 2 A.R.P.A.
Optical Astronomy Imaging Chain: Telescopes & CCDs.
JWST IFUs and Data Tool Development Plans Tracy Beck JWST NIRSpec Instrument Scientist.
Spectroscopic Data ASTR 3010 Lecture 15 Textbook Ch.11.
Spectroscopy of Saturn
Echelle spectra reduction with IRAF*
FMOS Observations and Data 14 January 2004 FMOS Science Workshop.
HCI 530 : Seminar (HCI) Damian Schofield. HCI 530: Seminar (HCI) Transforms –Two Dimensional –Three Dimensional The Graphics Pipeline.
Introduction to Spitzer and some applications Data products Pipelines Preliminary work K. Nilsson, J.M. Castro Cerón, J.P.U. Fynbo, D.J. Watson, J. Hjorth.
A. Ealet Berkeley, december Spectrometer simulation Note in ● Why we need it now ● What should.
Memorandam of the discussion on FMOS observations and data kicked off by Ian Lewis Masayuki Akiyama 14 January 2004 FMOS Science Workshop.
AAO Fibre Instrument Data Simulator 10 October 2011 ROE Workshop 2011 Michael Goodwin Tony Farrell Gayandhi De Silva Scott Smedley Australian Astronomical.
Science Impact of Sensor Effects or How well do we need to understand our CCDs? Tony Tyson.
Beating Noise Observational Techniques ASTR 3010 Lecture 11 Textbook.
Distortion in the WFC Jay Anderson Rice University
NASSP Masters 5003F - Computational Astronomy Lecture 19 EPIC background Event lists and selection The RGA Calibration quantities Exposure calculations.
The quest for precision High Aperture implies lot of photons: High S/N, high precision Open this new parameter space LEGACY Precision: Fidelity, Doppler.
CCD Detectors CCD=“charge coupled device” Readout method:
14 October Observational Astronomy SPECTROSCOPY and spectrometers Kitchin, pp
Spectroscopic Observations (Massey & Hanson 2011, arXiv v2.pdf) Examples of Spectrographs Spectroscopy with CCDs Data Reduction and Calibration.
Progress Report on PSFs and Pixels Jay Anderson, Elena Sabbi, Kailash Sahu, and Matthew Bourque TIPS Feb 19, 2015.
INTEGRAL FIELD SPECTROSCOPY AT THE VLT STAR (CLUSTER) FORMATION IN 3D : INTEGRAL FIELD SPECTROSCOPY AT THE VLT Markus Kissler-Patig (Instrument Scientist.
18 October Observational Astronomy SPECTROSCOPY and spectrometers Kitchin, pp
Multi-slit spectroscopy In sky-noise dominated conditions (most interesting!) the use of slits is essential: eg: Faint object, extra-galactic, surveys:
Integral Field Spectroscopy. David Lee, Anglo-Australian Observatory.
Proposal for a self-calibrating and instrument-independent MOS DRS Carlo Izzo.
NIRSpec Operations Concept Michael Regan(STScI), Jeff Valenti (STScI) Wolfram Freduling(ECF), Harald Kuntschner(ECF), Robert Fosbury (ECF)
Figure 8.Color map of the geometric correction along the dispersion axis for segment A. Figure 4. Measured distortions for all PSA positions for segment.
What’s in a sum? Simon Dawes CMHAS. Should you stack frames using Mean, Median or Sum?
ACS Drizzling Overview J. Mack; DA Training 10/5/07 Distortion Dither Strategies MultiDrizzle ‘Fine-tuning’ Data Quality Photometry.
KMOS Instrument Overview & Data Processing Richard Davies Max Planck Institute for Extraterrestrial Physics  What does KMOS do?  When will it do it?
Data products of GuoShouJing telescope(LAMOST) pipeline and current problems LUO LAMOST Workshop.
WFIRST IFU -- Preliminary “existence proof” Qian Gong & Dave Content GSFC optics branch, Code 551.
Observational Astrophysics I
Multiobject Spectroscopy: Preparing and performing Michael Balogh University of Durham.
INTRODUCTION TO GIS  Used to describe computer facilities which are used to handle data referenced to the spatial domain.  Has the ability to inter-
MOS Data Reduction Michael Balogh University of Durham.
Some thoughts on error handling for FTIR retrievals Prepared by Stephen Wood and Brian Connor, NIWA with input and ideas from others...
Practical applications: CCD spectroscopy Tracing path of 2-d spectrum across detector –Measuring position of spectrum on detector –Fitting a polynomial.
JWST Time-Series Pipeline Nikole K. Lewis STScI. Data Pipeline for Transiting Exoplanets The foundation for the Spitzer and Hubble data pipelines were.
14 January Observational Astronomy SPECTROSCOPIC data reduction Piskunov & Valenti 2002, A&A 385, 1095.
NASSP Masters 5003F - Computational Astronomy Lecture 16 Further with interferometry – Digital correlation Earth-rotation synthesis and non-planar.
The Critical Importance of Data Reduction Calibrations In the Interpretability of S-type Asteroid Spectra Michael J. Gaffey Space Studies Department University.
RAW DATA BIAS & DARK SUBTRACTION PIXEL-TO-PIXEL DQE CORR. LOCATE EXTR. WINDOW THROUGHPUT CORRECTION (incl. L-flat, blaze function, transmission of optics,
CCD Image Processing: Issues & Solutions. CCDs: noise sources dark current –signal from unexposed CCD read noise –uncertainty in counting electrons in.
Observational procedures and data reduction Lecture 4: Data reduction process XVII Canary Islands Winter School of Astrophysics: ‘3D Spectroscopy’ Tenerife,
1 Notes about eis_prep Alessandro Gardini University of Oslo Oslo, July 9th, 2009.
In conclusion the intensity level of the CCD is linear up to the saturation limit, but there is a spilling of charges well before the saturation if.
Application of a Charge Transfer Model to Space Telescope Data Paul Bristow Dec’03
SINFONI data reduction using the ESO pipeline. Instrument design and its impact on the data (I) integral field spectrometer using mirrors brickwall pattern.
Electronics Lecture 5 By Dr. Mona Elneklawi.
A.Zanichelli, B.Garilli, M.Scodeggio, D.Rizzo
INTRODUCTION TO GEOGRAPHICAL INFORMATION SYSTEM
JWST Pipeline Overview
Single Object & Time Series Spectroscopy with JWST NIRCam
NIRSpec pipeline concept Guido De Marchi, Tracy Beck, Torsten Böker
CCD Image Processing …okay, I’ve got a bunch of .fits files, now what?
Institute of Cosmos Sciences - University of Barcelona
COS FUV Flat Fields and Signal-to-Noise Characteristics
Spectrophotometric calibration of the IFU spectrograph
ESAC 2017 JWST Workshop JWST User Documentation Hands on experience
Detective Quantum Efficiency Preliminary Design Review
TransCAD Vehicle Routing 2018/11/29.
Integral Field Spectroscopy
How we do Spectroscopy An Overview
Spectroscopic Observations (Massey & Hanson 2011, arXiv v2
X-ray high resolution spectra in the VO: the case of XMM-Newton RGS
Presentation transcript:

Reducing IFU Data ITSO DR Workshop, Thursday 5th May Nic Scott

Overview ›Part 1 – Overview of IFU data reduction -Useful resources, different kinds of IFU, “theory,” and overview of main steps ›Part 2 – Hands-on with WiFeS data -Understanding calibrations, reducing data and checking output ›Part 3 – Tips and tricks -Extra steps, common issues and solutions, and comments for specific IFUs 2

Part 1 - Overview

Useful websites ›The IFS wiki: ›Instrument specific sites: -OSIRIS: -WiFeS: wifes -KOALA: -NIFS: -GMOS IFU: spectroscopy ›IFS Surveys -Atlas3D: -CALIFA: -SAMI: -MANGA: 4

Useful resources ›Fits image/cube viewers: -QFitsView: -ds9: -Fv: ›Data reduction tools: -Iraf -Python/IDL -p3d: -Instrument-specific packages and pipelines ›Many tools developed for radio astronomy can be applied to optical IFS data – cube viewing software, disk fitting, line analysis etc. 5

Different kinds of IFU ›Fibre-fed -Much like a fibre-fed multi-object spectrograph ›Image slicer -Uses an array of mirrors to ‘slice’ the image into multiple long-slit spectra ›Lenselet array -Uses a lenslet array in the focal plane to divide up field, then carefully arranges spectra on CCD 6 MUSE SAURON SAMI

Fibre-feb IFUs ›Fibre-fed IFUs use multiple closely-spaced fibres to act as spaxels and capture individual spectra ›Pros: cheap, extremely flexible, easily reconfigurable, easy to arrange spectra on the CCD, can take advantage of fibre-MOS software and techniques ›Cons: low efficiency, fibres can’t be too close together, circular spaxels ›Can be coupled with a lenselet array to solve some of these problems, but with further efficiency loss ›Examples include: PPAK, KOALA, SAMI, GMOS 7 Croom et al. (2012)

Lenselet array IFUs ›Use an array of closely-packed lenses, a lenselet array, in the image plane to act as spaxels ›Pros: reasonable efficiency, square pixels, variable spatial scales, high fill-factor ›Cons: reasonable efficiency, arranging spectra on CCD can be challenging, crosstalk between spectra ›Examples: SAURON, OSIRIS 8 Bacon et al. (2000) Larkin et al. (2010)

Image slicer IFUs ›Use an array of mirrors to ‘slice’ the image plane into a series of long-slit spectra. Each slice acts as a single y-column, with the pixels along the slit providing the x-direction ›Pros: High efficiency (only reflections), can apply long-slit techniques and software, high fill- factor, fill CCD easily ›Cons: Expensive, complicated ›Examples: WiFeS, MUSE, SINFONI 9 Bacon et al. (2010/12)

Steps in IFS data reduction ›1: General calibrations -Standard steps to account for CCD and instrument effects: bias subtraction, flat fielding etc. Essentially the same as for non-IFS data ›2: Extraction of spectra -Identify and extract individual spectra from the CCD. This step is highly specific to different kinds of IFU ›3: Reassembly of spectra into a datacube -Identify the relative on-sky positions and wavelength calibration of the extracted spectra. Put all spectra on a common wavelength and spatial scale then assemble into a cube 10

General calibrations ›Effects to correct for: -CCD bias level -Dark current -CCD sensitivity variations -CCD illumination -Cosmic rays -Hot pixels and bad columns -Total telescope and instrument throughput ›Calibration frames required: -Bias -Dark -Flat lamp and/or twilight flat -Spectrophotometric standard star 11 ›Goal is to correct for instrumental effects i.e. go from electrons to photons emitted by the source ›Most of these steps can be done early on in the reduction process, and even benefit from being done before spectra extracted ›Throughput correction typically done as a later stage

Extraction of spectra ›The ‘trick’ of IFS is arranging three dimensions of data onto a two dimensional detector ›This can be done in very different ways depending on the IFS design: -Lenselet systems use a rectification matrix – a predetermined relationship between detector pixel and lenselets -Fibre-based systems typically use a tramline map combined with a known fibre profile -Slicer systems fit the slitlet profile, extracting each slitlet as an independent long-slit spectrum ›The end goal is a set of extracted spectra, either as Row Stacked Spectra (RSS), or multiple long-slit spectra 12 Childress et al (2014) Sharp et al (2015) Bacon et al (2000)

Assemble data cube ›The many one-dimensional (or two-dimensional for slicer IFUs) spectra need to be arranged into a single three-dimensional datacube (x,y,λ) ›All spectra need to be placed on a common wavelength scale – typically done by fitting an arc spectrum then interpolating to a constant Å /pixel scale ›Each spectrum needs to be assigned an (x,y) coordinate position in the datacube. This process depends on the IFU type: -For lenselet arrays, the position of each lenselet on the sky is known in advance and a simple matrix is used to arrange the extracted spectra into a cube -For fibre-based IFUs, spectra are arranged into a cube based on the known positions of each fibre -For image slicers, a trace or wire calibration is used to match the spatial position of pixels in each slitlet 13

Optional extra steps ›Sky subtraction -Many options for this e.g. nod-and-shuffle, offset sky, dedicated sky fibres or lenselets -Can be done before or after assembling data cube ›Flux calibration -Best done after cube creation -IFS data has very good flux calibration accuracy compared to fibre or long-slit data. Can fit model of star in 2d, therefore determine very accurate total flux ›Combining exposures -Can be done at or after cubing -Can be done to increase field-of-view (mosaicing), increase effective spatial resolution (dithering) or simply increase S/N 14

Part 2 – Hands on with WiFeS data

Preparation ›Checks that pywifes.py is in your python path: -Terminal -> ipython --pylab -> import pywifes ›If not: export PYTHONPATH = $PYTHONPATH:/path/to/code/folder ›Missing python dependencies? Install them with pip ›Make sure you have a fits viewer application installed 16

Overview of the pywifes pipeline ›Pywifes is a Python-based pipeline for reducing WiFeS data written mainly by Mike Childress – see Childress et al. (2014). ›Its really good! Easy to use, largely automated, produces high-quality data products ›You can download the latest version here: ›NB We are not using the latest version today. The WiFeS data provided was taken in 2012, instrument and pipeline upgrades since then mean an older pipeline version is required to reduce this data. Your own installation of pywifes will likely not work for this exercise. ›Pywifes can simply reduce your data in one go. However, we’re going to take it one step at a time so we can check the output at each stage. 17

Check your raw data! ›Before starting reduction visually inspect the raw data (this should probably have been done when observing) ›Things to look out for: -Saturated exposures -Files that aren’t what they claim to be -Exposures with no or very low flux -Excessive amounts of cosmic rays -Weird artifacts ›Calibration files with issues must be removed or fixed before starting reduction – including bad calibrations makes your final data worse 18

Setting up the reduction ›NB I’ve already done this step for you ›Need to tell the DR pipeline which files you want to use ›Pipeline scripts will automatically identify file types – but check that it has done this right ›Manually edit file to stop the pipeline using them in reduction – alternatively, simply move them out of the reduction folder 19

Running the reduction script ›Open reduce_blue_data.py in the reduction scripts folder ›Set the first step, ‘run’:True. All others should be False. ›Execute the reduction script: ›Reduced files will be created in the Data/Reduced/ folder ›*.p??.fits indicates which step in the reduction process a file is ›NB To disable a reduction step, comment it out using #s in the reduce_blue_data.py file 20

Bias subtraction ›Overscan_sub and bias_sub subtract the zero-point of the CCD from all reduction files ›Overscan_sub does this on a region of the CCD that is not observed. Bias does this based on a separate bias combined observation ›Check the combined bias frame for artifacts! 21

Flat creation ›These steps combine the lamp and twilight observations into single high- S/N combined frames ›Then extract the flat frame for each slitlet ›Inspect the super_domeflat and super_twiflat frames to check for artifacts ›Check one or two of the extensions in the super_domeflat_mef and super_twiflat_mef files to check extraction worked (use Open as… Multi-Extension Cube… in ds9) 22

Spectral extraction ›These steps determine the slitlet profile using the flat frames ›Once the profiles are determined, each slitlet is extracted and repackaged as a Mulit-Extension Fits (MEF) file ›This step is also applied to the super flat frames ›NB The slitlet_defs file claims to be.fits but is really a.pkl. Use a text editor to view it and modify if necessary (this is fixed in current versions of pywifes) 23

Wavelength calibration ›Using the arc frame, fits to the positions of peaks ›Matches these to a line list for the given lamp ›Fits a smooth polynomial to the list of peak positions vs line wavelengths and stores this as the wavelength solution for each slitlet ›Check terminal output has sensible values, and wave_soln.fits image varies smoothly 24

Wire solution ›Wire frame is a flat with a single-pixel width mask placed in the focal plane ›Purpose is to match corresponding y- pixels in different slitlets ›Position of the wire (a trough) is fit in each slitlet then recorded in wire_soln ›Output is slightly counterintuitive – it’s a n λ * n slitlets “image” where the value of each pixel is the fitted position of the wire at that position ›Check to see wire positions are consistent from slitlet to slitlet and don’t vary much with wavelength 25

Flat fielding ›Attempt to mask cosmic rays using the LACOSMIC routine ›Pretty good, but not perfect at finding cosmics ›If any frame has an excessive number of cosmics (very long exposure red/NIR frames for example) consider disabling them ›Apply the previously calculated flat response to each slitlet 26

Cube creation – part 1 ›Apply the wavelength and wire solutions to your science observations ›Interpolates each slitlet onto a common wavelength and spatial scale ›Aligns each slitlet using the wire solution ›Produces another MEF file 27

Cube creation – part2 ›For convenience, convert the MEF “cube” into a 3D datacube ›NB In later versions of pywifes this function is built in ›With this version: -ipython --pylab -import wifes_utilities -wifes_utilities.wifes_mef_to_cube(infile,outlife) ›Inspect your final data cube using QFitsview or other datacube viewer 28

Flux calibration ›To flux calibrate our data, we require observations of spectrophotometric standard stars ›These functions extract star spectra, compare those spectra to the known ‘standard’ spectrum and compute a polynomial transformation ›This polynomial is then applied to the science frames 29

Bits and bobs and summary

Variance ›Because IFS data reduction is complex, tracking variance is also complex ›The key is to treat your variance image exactly as you treat your flux -Dividing by a flat field? Divide your variance by the square of the same frame -Flux calibrating? Rescale your variance in the same way ›Not quite that simple – many steps add additional variance -Subtracting the bias? Bias frames have noise so add variance -Extracting spectra? Cross-talk and inexact extraction apertures add variance ›Good news is most IFS reduction packages do this for you ›Understanding your variance is critical for taking best advantage of your data! 31

Correlation and Covariance ›Not all flux pixels are independent. Not all variance pixels are independent either ›Spatial correlation: -Simplest example is seeing, happens in all IFUs -Crosstalk between spectra located close to one another on the CCD – common in fibre and lenselet IFUs -Resampling onto a common spatial scale ›Spectral correlation: -Resampling onto a common wavelength scale ›Covariance – or correlated noise: -Similar to correlated flux, but more complicated to deal with -Dealing with it properly requires a full covariance matrix – some DR packages will provide this -Often simpler to partially account for covariance by rescaling your variance by an appropriate factor – or when model fitting penalise for fewer independent datapoints 32

Atmospheric Refraction ›Light of different wavelengths is refracted by different amounts as it passes through the atmosphere ›This means the position of an object in IFS varies systematically as a function of wavelength ›Sometimes telescopes have an ADC (atmospheric dispersion corrector) built in ›If not, you can manually shift each wavelength to have a common centroid, either by fitting to the object centroid or using a DAR model ›This effect is worse at blue wavelengths, can be safely ignored in the NIR 33

Combining data ›Several reasons to combine data cubes: improve S/N, increase field-of- view, attempt to increase spatial resolution ›Can centre based on object centroid or just telescope pointing for faint objects ›Easy mode: use native sampling and combine to the nearest pixel – this is often good enough ›Hard mode: combine to sub-pixel accuracy by resampling data onto a finer grid – have to do this when trying to increase effective resolution via drizzling ›Caution – resampling correlates your data AND your noise. May be more trouble than its worth 34 Sharp et al. (2015)

Closing remarks ›IFS is an extremely powerful technique with a broad range of astrophysical applications. It has revolutionised optical astronomy in the last ~15 years ›Different IFUs have different wavelength ranges, fields-of-view, spectral and spatial resolutions, efficiencies, access to AO etc. Pick the best tool to suit your science goals ›However, the instruments and therefore the data are complex, and an understanding of how the data are produced is critical to get the most out of it ›Different IFU designs come with different pros and cons, as well as different issues affect their data products ›Many IFUs have an excellent pipeline – I highly recommend using these! ›If your IFU doesn’t have a pipeline, find a collaborator with experience reducing data from that instrument 35

Questions?