Tip:
Highlight text to annotate it
X
Hello everyone!
This time we are going to concentrate in just one task: apall.
This task performs simultaneously two of the most critical steps in spectra reduction:
The background subtraction and the spectrum extraction.
The background subtraction and the spectrum extraction.
As a result, we shall pass from a 2D fits file to a 1D frame.
Apall, is one of the biggest and most complex tasks in IRAF.
Indeed, if I had to choose an IRAF task to take a course about it would be about it would be this one.
However, in this video we are going to focus on how to use independently of the scientific object
and you will appreciate it is a rather short task
just remember to check your literature and your team
for the optimum configuration for your celestial body and telescope set up.
Ok the first thing, we must do is opening our scientific object fits file
In my case, it is this one over here
in which we just performed the wavelength calibration
Now we need to choose a region with a strong continuum
and an uniform background.
In my case this is bit harder, since this is an HII galaxy, and therefore,
there is almost no continuum... So I need to go for an emission line region
for example Halpha
and now I need to write down its coordinates
in this case 2750
You must use these pixel coordinates as it will not accept wavelengths
ok... we have the coordinates
And now we are going to change some of the default values in the apall task
following the guide of Phil Massey et al.
The "apall" task can be found in the "apextrack" package
Here we have it... and now...
First let's go to the "Default Background Parameters"
width = 10
In the "Automatic Finding and Ordering Parameters"
maxsep = 1000
Next one is in "Tracing Parameters"
t_niter = 1
Next ones are in "Extraction Parameters"
bacgro = median / fit depending on your data
weights = variance / none depending on your data
gain = Image header keyword if you have it
readnoi = Image header keyword if you have it
I think that should be all
and now we can run this command
In this line, the first and second tag are the input and output names.
The rest readnoise, gain, background and nsum we have already seen...
But we leave them because you might want to play with these values... to improve the quality of the results
The "Line" parameter refers to the region of the continuum we are going to use for the analysis
In our case, it was the location of Halpha... around 2750
and finally, the "upper", "lower" and "extras" tags... we shall see that in a few minutes
and finally, the "upper", "lower" and "extras" tags... we shall see that in a few minutes
Now let's just run the command
And we say yes to all questions
The number of apertures "1", I only have one object in each recording...
Let's make this window bigger
In here you have an ideal case:
we have a very strong object surrounded by a very uniform flat background..
Currently we are plotting the sum of lines 2745 to 2754...
ten lines as we set in the "nsum" parameter
If we were unhappy with this region we could change it from here with the command
:line (plus the new continuum location)
for example... 2700
However, this region is no good for us since the continuum of my object is very close to the background noise
so let’s go back... :line 2750...
Ok, we could also change the center of the line location with :center...
But first, let's take a look at it
As always, to zoom...
It seems that the center of this segment is at the maximum so we are happy with that...
However... it seems that the segment does not cover the whole emission line region
We can change that with the "upper" and "lower" tasks we saw before...
So let's increase the values....
Let's try using with 25
Maybe that's a bit too much... let's try now 20
Ok, and now the lower one...
you must type :lower and a negative value
otherwise it shall match the upper one
Remember it must be the same length at both sides
Now we go back to the whole plot...
Ok.. seems fine
At this point we have properly defined the object's spectrum region
Now we need to define the background level...
To do that we need to press the "B" key
You can see the background level "apall" has calculated from the data within these segments
We are not happy with this background level so we need first to delete these regions with the key "T"
and now we need to select a new one with the key "S"
We can select as many background regions as we want
Remember to fit again...
If you are not happy with the column range IRAF has plotted
You can replot the whole range with "W" + "A"
and you can select new background regions
"T" to delete... "S" to Select... and "F" to fit
Very nice
You must be asking yourself which is the ideal selection for the background region
Well in most cases, you want to sizeable background region
However, as you get closer to the edges of the CCD the quality of the data decreases sharply
If this happens you should select regions as close as possible to the continuum.
You will need to repeat this process several times until you select a region which is suitable for your whole spectral range
Myself, I am just going to assume this is fine...
so press "Q" to leave this background selection region...
And "Q" again to leave the spectrum selection window
Now you need to agree with all the questions...
In here I have the fitting of the spectrum extraction... with and RMS of 0.52... which is quite good
As always, however, I can delete a few points with "D"
Let's delete some more values over here...
And now... "F" to fit... You can see how the residual has improved...
In this window you can also increase the order of the fitting function if needed
Once, we are happy with the fitting we press "Q to leave this window
and we say yes to all the questions...
Ok.. here we have it... as you can see this is a beauty
At this point we have concluded the application of the task "apall", we can press "Q" to leave
Let's minimize this window...
Now we have created a 1D file with our spectrum and we have finished this important step
Before ending this video, however, I want to explain you a few things
Let's open this file with "splot"
In some cases, you will notice how "apall" will add to this output file name something similar to ".0001"
This notation refers to the aperture number.
Incidentally, if you have several spectra in each fits frame
you just have to make sure all the apertures have been properly identified
and the task will run iteratively for each one
But in our case since we just had one apperture let's continue...
As you can see "splot" did not open a window directly...
It is asking me which band to plot...
As you might remember in the "apall" command there was a tag named extras
which we activated with the + sign...
When this parameter is activated it will save several plots in our fits files
Let's start by plotting the first one...
Ok this is the spectrum extracted according to the configuration we defined for the "apall" task.
This is the one you want to proceed with for the flux calibration
To see the next band you need to press right bracket key ")"
To see the next band you need to press right bracket key ")"
Incidentally, if you want, you can go to the previous plot the with the left bracket "("
The second band is the raw spectrum, it is different from the previous one if you used a variance weighting,
The next one, over here, is the sky spectrum
This is the result of the background subtraction.
Finally, we have the sigma spectrum. This only appears if variance weighting is applied as it is our case.
It represents the extraction weighting which IRAF uses to distinguish the background from the scientific object.
In our case, it is based on data from the gain and readnoise parameters on the fits frames headers...
All these data is useful during the initial applications of "apall"
to make sure you make the best use of this task.
However, once you are happy with the results
you can avoid saving this data in your fits files by deactivating the extras flag.
Of course you can keep these data and continue with the spectra reduction
but in that case remember to add a [1] to your file names in the IRAF commands
but in that case remember to add a [1] to your file names in the IRAF commands
so it knows which band to use.
In any case, IRAF will ask you which band to use if you forget to add the extension.
Ok that is all I wanted to show you today.
Good job for keeping up!
Thank you for watching! And see you soon