14
HIFI Tutorial 3: Getting some basic science out A.P.Marston ESAC 27 June 2013

HIFI Tutorial 3: Getting some basic science out A.P.Marston ESAC 27 June 2013

Embed Size (px)

Citation preview

Page 1: HIFI Tutorial 3: Getting some basic science out A.P.Marston ESAC 27 June 2013

HIFI Tutorial 3: Getting some basic science out

A.P.Marston

ESAC

27 June 2013

Page 2: HIFI Tutorial 3: Getting some basic science out A.P.Marston ESAC 27 June 2013

Document title | Author Name | Place | Data doc | Programme | Pag. 2

What we will learn here

Working with point mode spectra:

• Coadding H and V spectra.

• Displaying results in various ways – spectrum explorer.

• Doing basic spectral arithmetic.

• Changing units.

• Fitting spectra and integration of lines.

Working with maps:

• Extracting and manipulating spectral cubes

• Regridding – e.g. Change pixel size (also in level 2.5 of the pipeline)

• Coadding maps (H and V)

• Extracting single pixels to work with (using CSAT).

• Baseline removal/multifitting of data.

• Getting a spectral line map.

Page 3: HIFI Tutorial 3: Getting some basic science out A.P.Marston ESAC 27 June 2013

Spectrum Explorer

Open an observation context

Clicking on a spectrum (or spectrum dataset, e.g. in level 2) allows the Spectrum Explorer to be started, usually by default – otherwise right click and choose from menu presented.

Hover mouse over icons above spectrum to see what these will do for you.

Can also manipulate from a menu – right-click on the spectrum

Document title | Author Name | Place | Data doc | Programme | Pag. 3

Page 4: HIFI Tutorial 3: Getting some basic science out A.P.Marston ESAC 27 June 2013

Spectrum Toolbox

Add/subtract/divide/multiply – probably self-evident

Extract and display.

pairAvg – averages spectra from two containers. Can be sets of spectra.

Accumulate – similar thing but to a common wavelength/frequency scale.

Smooth.

Gridding – for creating map cubes from spectra (this is done when creating level 2.5 cubes and is probably better done rerunning the level2.5 pipeline.

Fold – for frequency switch observations. Typical results do not have folding. Option for the pipeline.

Document title | Author Name | Place | Data doc | Programme | Pag. 4

Page 5: HIFI Tutorial 3: Getting some basic science out A.P.Marston ESAC 27 June 2013

Coadding H and V Spectra

Not always straightforward to add spectra since individual frequency scaling can make this difficult. Convolution method is best.

E.g. spectrum arithmetic available through the spectrum explorer.

Use polarPair

Extract spectra you wish to coadd before using polarPair – there is a tolerance on the shifts between two spectra that can be adjusted. Default is good enough usually.

Document title | Author Name | Place | Data doc | Programme | Pag. 5

Page 6: HIFI Tutorial 3: Getting some basic science out A.P.Marston ESAC 27 June 2013

Changing Units

On axis we can display units in velocity space if we know the frequency of the line we are displaying.

Can also change label on Y axis and use Latex type labels.

Open “plot properties” dialog.

Document title | Author Name | Place | Data doc | Programme | Pag. 6

Page 7: HIFI Tutorial 3: Getting some basic science out A.P.Marston ESAC 27 June 2013

Physically changing units (not just display)

convertWavescale

• Double click on task name in “Tasks” window to open dialog.

• Drag spectrum to dataset area.

• Change as you want – note that default HIFI data is scaled in GHz.

doMainBeamTemperature

• Works on a HifiTimelineProduct rather than a single spectrum.

• So better to use in the pipeline – e.g. going to level 2.5

• Alternately – can simply multiply spectra by appropriate factor…. (l/mb). l = 0.96

while mb can be found in the calibration product (also see HIFI Observer’s manual)

convertK2Jy

• Converts HIFI antenna temperature to Janskys based on information provided in the calibration information. Can handle antenna temperature or main beam temperature.

• Also takes in parameter of source size.

• See HIFI DRG chapter 16.2 for further details and options.

Document title | Author Name | Place | Data doc | Programme | Pag. 7

Page 8: HIFI Tutorial 3: Getting some basic science out A.P.Marston ESAC 27 June 2013

Spectrum Fitter

It is best to work with the spectra/cubes outside of the original context.

Once spectrum displayed then we can start the spectrum fitter GUI

We can add weights and models to do the fits.

Final fit is exportable, plus residuals

Document title | Author Name | Place | Data doc | Programme | Pag. 8

Page 9: HIFI Tutorial 3: Getting some basic science out A.P.Marston ESAC 27 June 2013

Command line integrator tool

from herschel.ia.toolbox.spectrum.integrator import Integrator

• Integration over a range or ranges:

Get the part of the spectrum to integrate.

• segment = mySpectrum.getPointSpectrum(0).getSegment(1)

The ranges over which to integrate are formatted as [start, stop, start, stop, ...]. So for one range from a to b: [a, b], and for n ranges: [a1, b1, a2, b2, ..., an, bn]. The ranges should be given in the same units as the data.

Can remove 1D polynomial fit using similar format for [masks]

• i = Integrator.doIntegration(segment, [windows], [masks])

And make poly fit n dimensional

• i = Integrator.doIntegration(segment, [windows], [masks], n)

print i # will show the result

Document title | Author Name | Place | Data doc | Programme | Pag. 9

Page 10: HIFI Tutorial 3: Getting some basic science out A.P.Marston ESAC 27 June 2013

Working with Map Data

We will use as an example a small map of the Orion Bar, obsid = 1342190850

We will coadd H and V cubes and then go on to work with the extracted cube.

Document title | Author Name | Place | Data doc | Programme | Pag. 10

Page 11: HIFI Tutorial 3: Getting some basic science out A.P.Marston ESAC 27 June 2013

Example from Chapter 13.3.2

# Get the level 2 WBS data from two polarizations of our observation htpv=obs.refs["level2"].product.refs["WBS-V-USB"].product htph=obs.refs["level2"].product.refs["WBS-H-USB"].product

# # Define the reference frequency grid from one of the HTPs, and crop both to a

# common range since they may be on a slightly different scale with respect to

# one another (they are frequency calibrated from their own comb measurements).

• newGrid = mkFreqGrid(htph)

• htph=doFreqGrid(htp=htph, grid=newGrid)

• htpv=doFreqGrid(htp=htpv, grid=newGrid)

# # The next step now combines both HTPs

• index=htpv.getLastIndex()

• for i in range (1,htpv.count+1):

• htpv.set(htph[i] ,index+i)

# # Update the new HTP's summary info to take the new frequency grid into

# account, otherwise you just get the same HTP as before

• from herschel.hifi.pipeline.util.data import HifiSpectrumDataSupport

• HifiSpectrumDataSupport.adjustSummaryTable(htpv);

cubeout = doGridding(htp=htpv)

Document title | Author Name | Place | Data doc | Programme | Pag. 11

Page 12: HIFI Tutorial 3: Getting some basic science out A.P.Marston ESAC 27 June 2013

Using Cube Analysis Tool on maps

We can extract single spectra from the cube

• Open cube by double click.

• Open cube analysis tool from within Spectrum Explorer

• Use pull-down menu to extract pixel(s) wanted spectrum

We can create integrated line maps computeVelocityMap produces intensity map/fitted line cube/velocity cube/dispersion map….. All

in one go.

We can use MultiFit in the Spectrum Fitter GUI also to fit

• Can do background removal again

• …and add in a gaussian(s) fit across the cube.

Document title | Author Name | Place | Data doc | Programme | Pag. 12

Page 13: HIFI Tutorial 3: Getting some basic science out A.P.Marston ESAC 27 June 2013

Flagtool – data flagging

This is especially useful on reprocessing of data.

Should there be corrupt or problematic data then this can be removed from the overall reduction.

Meaning of the flags is addressed in chapter 8 of the HIFI DRG. Some pipeline tasks take note of particular flag settings – e.g. deconvolution task to get level 2.5 for spectral scans.

But sometimes flags need to be set by the user – flagTool.

Document title | Author Name | Place | Data doc | Programme | Pag. 13

Page 14: HIFI Tutorial 3: Getting some basic science out A.P.Marston ESAC 27 June 2013

Spectral Scan Deconvolution

HIFI produces dual sideband data.

Can be combined (by stepping in frequency during an observation) to make sky signal fall in upper or lower sideband.

So once we have that we know what frequency the line should have been at.

We can iteratively arrive at the correct answer through a deconvolution technique – minimization. This is what the tool does.

Result default name is decon_result – can be displayed in SpectrumExplorer.

Document title | Author Name | Place | Data doc | Programme | Pag. 14