Knowledgebase : Data Processing > Data Processing - SPIRE

To find out about the steps to follow in reducing SPIRE spectroscopy and, in particular, how to carry background subtraction of spectra, there is a Herschel Science Centre short videotutorial that shows you the steps involved and also describes the data products that are available for which experts have carried out background reduction already. You can find the videotutorial here:

 https://www.youtube.com/watch?v=O_pqN4VDu9M

This videotutorial describes a useful interactive script for background reduction and shows a practical example of how to carry out background subtraction and the decisions involved in carrying out background subtraction interactively, identifying and eliminating interactively the outliers in background subtraction. It also gives you details of the available expert-reduced background subtracted spectra available as a Highly Processed Data Product.

Both point source photometry - from source fitting - and aperture photometry can be extracted from SPIRE maps.

If you prefer to obtain aperture photometry from SPIRE maps, you should check the appropriate Herschel Science Centre short videotutorial for this method instead (https://www.youtube.com/watch?v=fjzf-VN_X0s).

Point source photometry can be obtained from SPIRE maps either for a single source, or by using a source detection routine, such as Sussextractor to give you a list of detected sources in a field as input to extract photometry for multiple sources.

There Herschel Science Centre has produced a short videotutorial on point source photometry, which reviews the methods of source extraction for single and multiple sources in a field, how to use the source extraction as input for photometry and which are the best photometric methods to use with your data.

You can find this short videotutorial here:

https://www.youtube.com/watch?v=nbN6OWtWIR0

The Herschel Science Centre has produced a useful short videotutorial that shows you how to use a useful script in HIPE for SPIRE line fiiting (NB: it does not cover the fully interactive mode of line-fitting). You can find the short videotutorial here:

https://www.youtube.com/watch?v=OYmJzolPF00

The short videotutorial covers the Instrumental Line Shape (ILS) of the SPIRE spectrometer, what preliminary processing of spectra is required, the inputs and outputs of the line-fitting script, and how the script works. Examples are shown of fitting lines to real SPIRE Fourier Transform Spectrometer data, how to inspect the residuals of the fit and to add missing lines in the fitted spectrum. Finally, it will introduce the Spectral Feature Finder Catalogue and how to use it as input for the line fitting script, running a spectrum fit with Spectral feature catalogue.

The Herschel Science Centre has produced a short videotutorial guide for users of SPIRE spectrometry data to show how to use the observation context and where to find it.

https://www.youtube.com/watch?v=D66Yxz8waVI&t=413s

This short videotutorial gives an introduction to the Observational Context and how to look at it in the Herschel Science Archive. It describes the two types of products at level-2, for Sparse Mode and Mapping Mode. It looks at the Sparse Mode High+Low resolution mode and the detectors and continues with the Mapping Mode, describing the cube structure and the Spectrum2d table. It then looks at the tar Archive file, how to inspect the Observational Context in HIPE and how to use HIPE with data cubes.

The Herschel Science Centre has produced a short videotutorial that gives a simple, step-by-step guide for anyone who would like to perform aperture photometry on a SPIRE image. You can find it in the following short videotutorial:

https://www.youtube.com/watch?v=fjzf-VN_X0s

This short videotutorial will show you how to perform aperture photometry, what tools to use and what corrections to perform on the data to get the best final result. The procedure is different depending on whether you have a point source or an extended source calibrated map. In the former case you need to convert from Jy/beam to Jy/pixel, measure the photometry and then apply corrections for the beam, the aperture and the colour. In the latter case, you take the photometry and apply only the colour correction for extended sources. You will be guided through the flowchart for obtaining photometry and will be shown a practical example of data reduction showing the commands required and shows you the different tasks that are available.

 
Reduction and analysis of SPIRE FTS spectra treats two, generic cases: point sources (sources smaller than 3-4 arcseconds that are effectively a point-source for SPIRE) and extended sources (anything larger than 40 arcseconds). However, there are many sources between these two extremes that can neither be treated as point sources, nor as extended. The immediate consequence for observers is that neither the point source reduction, nor the extended source reduction give a good result: users will see this in the form of a large discontinuity between the two SPIRE spectra ranges.

There is a Herschel Science Centre short videotutorial that shows you how to categorise sources by diameter and how to identify cases in which neither the point source calibration, nor the extended source calibration give a satisfactory result and how to treat these cases. You can find it here:

https://www.youtube.com/watch?v=mxZpHgHVtP4

The short videotutorial will walk you through the basics of SPIRE FTS spectra data reduction, including the need to carry out certain, basic pre-reduction such as to subtract the background first before applying the Semi-Extended Calibration Tool (SECT) to the spectra. It will show you how to set the parameters and, through a practical example, how to make an iterative fit to the effective source diameter. Finally, it will show you the checks that you can carry out to ensure a self-consistent result.

If your observation is a spectral map, the products are 3-D spectral cubes and not 1-D spectra. This makes saving data more difficult, as no tools were implemented in HIPE to save a 3-D structure as a text file.

So, unlike for single point spectra, you cannot you cannot use the "Save to text file" option on a spectral cube. So, first you must extract a 1-D spectrum from a pre-selected cube pixel (aka spaxel).

The Herschel Science Centre has created a short videotutorial that explains how to do this. You can find it on the Herschel Academy YouTube channel at:

Saving a 3-D SPIRE FTS spectral cube as a 1D spectrum


The HSC has created a short videotutorial (6 minutes) on how to save an FTS spectrum to a csv file. It's available on the Herschel Academy YouTube channel on the following link:
 
Saving SPIRE FTS spectra as 1D CSV or ASCII files 

 
The HIPE script from the video is copied below. To run it, you need to be logged in to the HSA.

### example HIPE script
obsid =
1342268315
obs = getObservation(obsid,useHsa=True,instrument='SPIRE')
#
point_spectrum = obs.level2.getProduct("HR_spectrum_point")
ext_spectrum = obs.level2.getProduct("HR_spectrum_ext")
#
asciiTableWriter(table=point_spectrum["0000"]["SSWD4"], file='/Users/ivaltcha/test_spec_sswd4.csv')
asciiTableWriter(table=point_spectrum["0000"]["SLWC3"], file='/Users/ivaltcha/test_spec_slwc3.csv')
#### end script

For a simple ASCII file you can also view your spectrum in the Editor window in the HSA. Right click on the spectrum that you wish to save and select "Send to" --> "Text file" in the pop-up menu. These instructions are also shown in the short videotutorial referenced above.


There is a useful script in HIPE that helps the observer to carry out the reduction of spectra of extended sources observed with the SPIRE Fourier Transform Spectrometer. The following Herschel Science Centre short videotutorial explains how to use this script to reduce SPIRE FTS data:

https://www.youtube.com/watch?v=xo0fc1XggIU

The short videotutorial shows you how to visualise the source surroundings to see how much extended emission there is in the field of view, where to find the useful script and how to personalize it for a particular observation, how to overlay the FTS footprint plot on an image of your source, how to assess the background or foreground emission that may contaminate your spectra and how to assess whether or not there are off-axis detectors that you can use to eliminate this contamination. And, finally, for users who prefer to carry out this process outside HIPE, it explains how to do this in an external script.

The Herschel Science Centre has produced two simple, step-by-step guides for anyone who would like to perform photometry on a SPIRE image. These give details of how to perform photometry and the corrections that must be performed on the raw photometry.

The first short videotutorial explains how to perform aperture photometry on SPIRE maps and gives an overview of the corrections that are required, If you are familiar with SPIRE photometry, you can pass straight to the second video, although we recommend that users watch both:

https://www.youtube.com/watch?v=fjzf-VN_X0s

The second short videotutorial explains in more detail the steps in applying corrections to the raw photometry, in particular, the sequence of the corrections to apply and how to apply the colour correction to SPIRE photometry are explained. This videotutorial shows practical examples of applying the corrections to real data from SPIRE:

https://www.youtube.com/watch?v=i98LQWEwd8I

The Encircled Energy Fractions (EEF) for the SPIRE photometer beams are available as an ancillary data product (ADP) in the SPIRE Photometer PSFs folder of the Herschel Legacy Area:

http://archives.esac.esa.int/hsa/legacy/ADP/PSF/SPIRE/SPIRE-P/SPIRE-P-EEF.csv

Note that the EEFs are calculated assuming a source with a power-law spectrum with index -1, i.e. Fnu ~ nu^{-1}.

 


 

Observations with SPIRE Spectrometer before OD189 (19 Nov 2009) have not been made public as the detector parameters before that date were not at their final values. Many observations, even those performed using standard astronomer observing templates (AOT), are at different bolometer settings and although the pipeline can run in principle, the calibration is not adapted for those non-optimal parameters. That is why we cannot release this observation to the public, because people will end up with a nice looking spectra or spectral maps, which are not properly calibrated.


There are two, well-known sources of potential problems:

First, check that you are using the secure "https" protocol and not "http". If you have the latter, the link will fail.

Second, it is possible that the script is searching to the wrong directory because, unfortunately there were some changes to the URL where the on-line kernels were kept that were not within the control of the Herschel Science Centre. In order to fix the directory error, you have to edit the PhotometryConvoloveResolutionKernel.py script and change this line (line #424):

kernelRoot = '
http://www.astro.princeton.edu/~ganiano/Kernels/Ker_2012_May/Kernels_fits_Files/Hi_Resolution/
'

With this line:

kernelRoot = '
https://www.astro.princeton.edu/~ganiano/Kernels/Ker_2012/Kernels_fits_Files/Hi_Resolution/
'

This should resolve both issues.

There are two, well-known sources of potential problems:

First, check that you are using the secure "https" protocol and not "http". If you have the latter, the link will fail.

Second, it is possible that the script is searching to the wrong directory because, unfortunately there were some changes to the URL where the on-line kernels were kept that were not within the control of the Herschel Science Centre. In order to fix the directory error, you have to edit the SpectroscopyConvolveResolutionKernel.py script and change this line:

kernelRoot = '
http://www.astro.princeton.edu/~ganiano/Kernels/Ker_2012_May/Kernels_fits_Files/Hi_Resolution/
'

With this line:

kernelRoot = '
https://www.astro.princeton.edu/~ganiano/Kernels/Ker_2012/Kernels_fits_Files/Hi_Resolution/
'

This should resolve both issues.

Answer supplied by Ivan Valtchanov:

 

When carrying out photometry the background estimation is critical. PSF fitting tasks, such as sourceExtractorSussextractor, do not give the best results when the background is highly structured. Some of the source extraction tools implement background estimation and the results with and without should be compared.

In most cases, the preferred approach is to use aperture photometry, with background taken from an adjacent annulus or taken from a pre-selected region near the source. This is an interactive, manual method and is convenient for a small number of sources.

You can find out more about background estimation and its effect on SPIRE photometry in two, useful Herschel Science Centre short videotutorial presentations:

SPIRE Photometer: photometry of point sources - https://www.youtube.com/watch?v=nbN6OWtWIR0

SPIRE Photometer: aperture photometry - https://www.youtube.com/watch?v=fjzf-VN_X0s

 

Answer supplied by Ivan Valtchanov:

 

The SPIRE FTS is calibrated for either a perfectly centred point-like source, or for an extended source with size larger than the beam. There should not be a discontinuity in the overlap region of the two spectrometer bands SSW and SLW for these two cases.

However, a discontinuity will appear for any of the following reasons:

a) Point source on an extended background emission.

b) The target not being a perfect point source and not a fully extended, i.e. the so called semi-extended source.

c) Mis-pointing

d) Very faint target

Note that there could be a combination of the causes, i.e. mis-pointing and a semi-extended source.

* For a), subtracting the background, as estimated from the off-axis detectors, will achieve a good match in the overlap. For many observations the background subtracted spectra for the central detectors are available as Highly Processed Data Products at the Herschel legacy area:

http://archives.esac.esa.int/hsa/legacy/HPDP/SPIRE/SPIRE-S/BKGS

The Herschel Science Centre has produced a short videotutorial on how to assess the need for and carry out subtraction of background. You can find the videotutorial, here:

https://www.youtube.com/watch?v=O_pqN4VDu9M

* For b) and c) one can use the semi-extended correction tool (SECT), available in HIPE. SECT can be used to correct for the pointing, assuming a point-like source or a semi-extended source with known size, by iteratively deriving the pointing offset that gives the best match in the overlap region.

You can find more details about SECT in Section 7.6 of the SPIRE Data Reduction Guide (SDRG) available here:

http://herschel.esac.esa.int/hcss-doc-15.0/index.jsp#spire_drg:spire-spectroscopy  

The Herschel Science Centre has also produced a useful short videotutorial that guides you through the use of the Semi-Extended Correction Tool. You can find the videotutorial, here:

https://www.youtube.com/watch?v=mxZpHgHVtP4

* For very faint targets (case d), the calibration uncertainty on the continuum level may lead to offsets that will produce a discontinuity.