An IDL based reduction pipeline for polarimetric data for the IAG

An IDL based reduction pipeline for
polarimetric data for the IAG polarimeter
Edgar A. Ram´ırez
March 2014
Abstract: This is an informal documentation for an interactive data
language (IDL) reduction pipeline to analyse polarimetric data acquired
with the 0.6-m optical telescope at Observatorio dos Dias (OPD) operated
by the Laborat´orio Nacional de Astrof´ısica (LNA) in Brazil: POLIAG.pro
This pipeline is based on an existent IRAF and Fortran routines developed
by the Instituto de Astronom´ıa, Geof´ısica e Ciˆencias Atmosf´ericas (IAG) of
the University of Sao Paulo (USP).
1
Essential three steeps to run POLIAG.pro
1) Make sure that IDL can find the routines by setting the path to the POLIAG folder. The easiest way to do so is setting the path within an IDL
terminal. For example, if the routine POLIAG.pro is in /home/user/,
make it visible to IDL typing:
IDL> !PATH = Expand Path(‘+/home/user/POLIAG/’) + ‘:’ + !PATH
2) Compile the procedures SUBCELL.pro and PLOTIMAGE.pro (in that
order). This is to make that the procedure plotvec.pro works properly:
IDL> .r SUBCELL.pro
IDL> .r PLOTIMAGE.pro
3) Modify the path in the 6th line of quickpolp2.pro to the location of
the polarimetrystdstars.dat file (This file is distributed and should be
within the /POLIAG folder). For example, if polarimetrystdstars.dat
1
is in /home/user/POLIAG/, change the 6th line to:
quickpolDir = ‘/home/user/POLIAG/’
And that’s it...ready to run!
2
Run requirements
Quickpol requires internet connexion to have access to the Guide Star Catalog
(GSC; version 2.3), and to retrieve a digital sky survey (DSS) image of the
field being analysed. The GSC catalogue is used to calculate the zero point
magnitude. The DSS image (red image from the first generation survey) is
used to produce the polarisation map over the DSS image.
It is required to have the IDL Astronomy libraries installed (http://
idlastro.gsfc.nasa.gov). Download the gzip’ed tar files of the IDL Astronomy Library (astron.dir.tar.gz ) and of the Coyote Graphics Library
(coyote astron.tar.gz), and place them in a directory included in the IDL
!PATH. The IDL Astronomy Library site gives detailed instructions of how
to install it.
It is also requiered to have Astrometry.net installed (http://astrometry.
net/use.html). If you don’t have Astrometry.net in your system, you must
install de beta version of POLIAG (see section 8), or install the Astrometry.net software. To install Astrometry.net software depends on your local
system (Linux, Unix, or Mac). Follow the instructions given in the Astrometry.net software site (http://astrometry.net/doc/build.html\#build).
3
Running POLIAG.pro
Compile POLIAG.pro:
IDL> .r POLIAG.pro
To run the program just type:
IDL> POLIAG
2
A widget window is then displayed which shows three tabs: Quickpol,
Analisys and Filter (see Fig. 1). The three routines can be run from terminal
too (see section 7).
Figure 1: Tab Quickpol.
4
Quickpol
Quickpol is the main program. It reduces the images, calculates the polarimetry, calculates the magnitude and the position in right ascension (Ra)
and declination (Dec), and produces the final catalogue.
The ‘Objects filename’ field (see Fig. 1) is to give the images to analyse.
You should give a text file listing the names of the object images at each waveplate position. For example, if your images are c08ia0001.fits, c08ib0002.fits
. . . c08ih0008.fits, the list in the file should be:
c08ia0001.fits
c08ib0002.fits
..
.
c08ih0008.fits
This list can be done redirecting the names of the images to a file by
typing in a terminal:
User$ ls object suffix*.fits > object.list
3
where object.list is the output file, and object suffix is the common suffix
name of the images. In this example would be ‘c08i’. Therefore, you could
type:
User$ ls c08i*.fits > object.list
If flats and bias are provided, the imaging reduction procedure is executed. Otherwise, Quickpol assumes that the images are bias an flat field
corrected, and it proceeds with the polarimetry analysis. Suppose we want
to perform data reduction. In that case, text files listing the bias frames’
names and the flat fields’ names nee to be provided in the ‘Bias filename’
and ‘Flats filename’ fields, respectively (see Fig. 1). The text files listing the
bias and flats frames’ names can be created as in the example above.
The ‘Deltatheta’ box is the correction angle in degrees. By default is set
to 00.0 degrees (no correction). Provide the angle and press enter to make
sure that the angle is passed to the routine. Similarly, check that the text
files listing the images, the bias, the flat fields’ names are displayed in the
IDL terminal (if given).
Once you have filled the field(s) press ‘GO’ to run the routine. POLIAG
will prompt the user asking for the following values.
Give me flux/sigma value :
Signal over the mean sky value to detect the sources.
Are x shift and y shift correct? (y/n):
Shift between the ordinary and extraordinary images. If ‘y’, the routine
continues. If ‘n’, the routine prompts the user for the correct values:
Give x shift:
Give y shift:
Lastly, the routine asks for the ratio P/σp , and for the maximum polarisation limit.
Give me pol/sigma pol value :
Give me the maximum pol value (in fraction, not in percentage):
Type the desired values and press enter to continue.
4
4.1
Output of Quickpol
Output
bias zero.fits
flat bias combine.fits
bias flat <objname>.fits
/IDLpol/calcpol.out
/IDLpol/magnit.out
/IDLpol/GSC2 3.txt
Description
Master bias.
Flat corrected by bias.
Reduced images.
Table with: ID X Y BestApperture.
Table with: zero point magnitud; ID X Y RA
DEC MAG.
Table with columns: V–mag RAJ2000
DECJ2000, from GSC 2.3 catalogue.
Added to that, Quickpol produces the following encapsulated postscript
(eps) plots (displayed on screen too):
Name
magnitud.eps
magvscatmag.eps
magvspol.eps
plotvec.eps
polarisation.eps
pvectors.eps
QvsU.eps
theta.eps
Description
Distribution of magnitudes.
The measured magnitude vs the magnitude of the GSC
2.3 catalogue, with their respective error bars. A dashed
line equality correlation, and the solid line is the best
linear fit without considering the magnitudes with > 3σ
in the measured magnitude.
Polarisation percentage vs magnitude.
Polarisation map over the red DSS image. A polarisation bar is on top of the image for reference.
Distribution of the polarisation.
polarisation vectors over the X and Y position of the
sources.
The Q–U plane.
The distribution of the position angle theta (in degrees).
Finally, Quickpol generates the catalogue: /IDLpol/fintab.out. The catalogue contains the following columns:
ID X
Y RA(J2000) DEC(J2000)
RA(1950)
DEC(1950)
MAG MAGSIGMA P PSIGMA THETA TSIGMA
(px) (px) (degrees)
(degrees) (HR,MIN,SEC) (DEC,MIN,SEC) (mag)
(mag)
(frac) (frac) (degrees) (degrees)
5
5
Analysis
Analysis does the merger of up to 4 catalogues, calculating the weighted mean
of the polarisation, theta and magnitude. The catalogues must have columns
in the same format as the final table of Quickpol (fintab.out). Analysis
scans the catalogues and match the stars by their position Ra(J2000) and
Dec(J2000) within a box with 0.002 degrees side centred in the position of
the source in ‘Catalogue 1’.
Provide the catalogues in the fields (see Fig. 2) and press ‘GO’ to run the
routine. The output is a merged table with the name of the first catalogue
+ the name of the second catalogue +· · ·+ the name of the last catalogue
with ‘merge.txt’ appended at the end.
Figure 2: Tab Analysis.
Caveat: The mean of a source is estimated if and only if the source
match in all the given catalogues. This means that the mean of a source that
is in catalogue 1 and in catalogue 2, but is not in catalogue 3, is not going
to be estimated, and the final table will contain the source of the catalogue
1 and of the catalogue 2. This is, the source will be repeated with the ID of
the catalogue 1 and with the ID of the catalogue 2.
5.1
Output of Analysis
The output of Analysis is a catalogue result of the merger of the given two,
three or four catalogues. The merged catalogue has the same columns as the
output of Quickpol (fintab.out) with the weighted mean of the polarisation,
magnitude and theta, of the stars that match in the catalogues provided.
6
The name of the merged catalogue is ‘catalogue1 + catalogue2 +· · ·+
catalogue4 + merge.txt’, where ‘catalogue1’ is the name of the first catalogue,
‘catalogue2’ is the name of the second catalogue, and so on.
6
Filter
Filter performs filtering of a catalogue within the limits provided by the
user in interactive mode. Give the catalogue to filter in the ’Catalogue’
field (see Fig. 3). The catalogue must have the same format as the final
table of Quickpol (fintab.out). Finally, press ‘GO’ to run the routine. The
routine prompts the user to set the following limits and conditions to filter
the catalogue (default values in parenthesis).
Give
Give
Give
Give
Give
Give
Give
Give
me
me
me
me
me
me
me
me
pol/sigma pol value (1):
the maximum pol value (in fraction, not in percentage) (1.0):
the minimum pol value (in fraction, not in percentage) (0.0):
the maximum optical magnitud value -dimmest star- (25):
the minimum optical magnitud value -brightest star- (?13):
the minimum theta value (0):
the maximum theta value (180):
Flux/sigma sky value (1):
Figure 3: Tab Filter.
7
6.1
Output of Filter
The output of Filter is a filtered catalogue by the limits given by the user.
The name of the filtered catalogue is the original catalogue’s name with
‘ filtered.out’ appended at the end. The filtered catalogue contains the same
columns as the ‘fintab.out’ catalogue. Filter displays plots on the screen, and
eps files are generated too.
7
Command-line mode
The Quickpol, Analysis and Filter routines can be executed separately in
command-line or terminal mode too. To start in terminal mode you need to
compile the routine that you are going to use (.r quickpol.pro, .r analysis.pro
or .r filter.pro), and follow the calling sequence described bellow (the calling sequence is also described in the quickpol.pro, analysis.pro and filter.pro
files). The calling sequence for Quickpol is:
QUICKPOL, objectfile, flats = flatfile, bias = biasfile, deltatheta = deltatheta
where objectfile is a string with the name of the the text file listing the
objects’ names, flatfile is a string with the name of the the text file listing the
flat fields’ names, biasfile is a string with the name of the the text file listing
the bias frames’ names, and deltatheta is a number with the correction angle
(in degrees). For example, following the example given above, the calling
sequence to run Quickpol is:
IDL> QUICKPOL, ‘object.list’, flats = ‘flat.list’, bias = ‘bias.list’, deltatheta=90.0
where deltatheta is set to 90 degrees in the example (by default deltatheta
is set to 0.0). If your images are flat and bias corrected, and no correction
by delthatheta is required, then you should type:
IDL> QUICKPOL, ‘object.list’
The calling sequence for Analysis is:
ANALYSIS, fintab1, fintab2 [, fintab3, fintab4]
8
where fintabN is an ASCII file (string). To run Analysis on two catalogues type:
IDL> ANALYSIS, ‘fintab1.out’, ‘fintab2.out’
The calling sequence for Filter is:
FILTER, fintab1
where fintab1 is an ASCII file (string). To run filter on a catalogue type:
IDL> FILTER, ‘fintab1.out’
8
POLIAG beta
The beta version of the pipeline is for computers that don’t have the Astrometry.net software installed. In this case the pipeline asks for an image
with the world coordinate system (wcs) information.
‘Give the image with the wcs on the ordinary stars:’
The image with the wcs can be obtained from the Astrometry.net site
(http://nova.astrometry.net/upload). It is highly recommend that you
use the masked image: ‘fakesky.fits’, generated by Quickpol, for astrometric
calibration using the Astrometry.net site. This because the ‘fakesky.fits’ has
the extraordinary image of the sources masked out.
Once Astrometry.net has processed ‘fakesky.fits’, the site gives various
files to download. Download the new FITS image (‘new-image.fits’), and
give this fits image to Quickpol.
9