next up previous
Next: getkcorr.pro Up: Description of the program Previous: Description of the program

  
magt.pro

First, magt converts the arguments to type floating point. Then the paramters for h0 and mb (or mscript) are checked. If mscript is specified, mb is set to -19.46 and h0 is calculated from this so that mscript is equal to the specified value. If mscript isn't not specified and mb and h0 are specified, they are used during the calculation. If only one of them is specified, the other one is set to the default. If h0, mb and mscript are not specified, a default is used. The next step is just printing out the parameters used for the calculation. Then the file master_template.dat is read in to get the B band light curve. The other data in the file is not kept, just the time (with the peak of the light curve being 0) in days (kept in the array day) and the B band magnitude (kept in the array mb). The data in the file is from Bruno Leibundgut's thesis.
The next step is normalising the light curve to

\begin{displaymath}M_B^{peak}=(m-1.74\cdot(s-1))\quad mag
\end{displaymath} (1)

at the peak where m is the value of the paramter Mb. After this the distance modulus is calculated by a call to calc_dm. For more information on calc_dm , visit:
http://panisse.lbl.gov/groupwork/documentation/cosmo/index.html
If the cosmological parameters describe a bouncing universe, calc_dm returns -1000 which is checked by magt. After this check is passed, the distance modulus is added to the B band magnitude mb and then the U band magnitude MU (in the program mu) and V band magnitude MV (in the program mv) are calculated by
MU = $\displaystyle M_B-(0.5*s)\quad mag$ (2)
MV = $\displaystyle M_B-(0.243\cdot((1.0/s)-1.0)-0.11)\quad mag$ (3)

These magnitudes are needed as basis for the different K corrections. The next step is checking whether R band or I band magnitudes are to be calculated. The two blocks for this are almost identical, so here only the first one (for the R band) is described, the other one can be understood in the same way.
In the block for the R band calculation, first of all the flag success is set to 0. Then the given z is checked to decide which K correction file has to be used for the K correction. If the given z is out of the range supported in those files, the flag success is still 0 and an error message is printed before magt exits. The K correction itself is done by the IDL function getkcorr (see section 3.3.2 for more information on this function). It is called with the given redshift and the correct file for this redshift (e.g splinefit_bi means K correction from B band to I band). The function getkcorr hands back an array with the K corrections. Depending on which file was used for the calculations, the K corrections are either added to the B band magnitudes or the U band magnitudes. If the keyword /snframe is not specified, the next step is to time dilate the lightcurve. After this the stretch is applied. The two following if-loops compose the result for a scalar t (first if-loop) or for an array t (second if-loop). If t is scalar, the first if-loop is entered. First the array day is checked if it includes the value t (then no interpolation would be necessary and the corresponding magnitude value could be accessed directly). If t is not in day, the two bracketing values in day are obtained and then the magnitude corrresponding to t is calculated by a linear interpolation. If t is included in day, the corresponding magnitude value is obtained directly. If t is an array, the second if-loop is entered. result is defined as a floating point array and the same procedure as described above (interpolation or direct acces to the magnitude value) takes place, but now for all values of t in the array.
The if-loop containing the calculation for the I band magnitudes is build in exaclty the same way.


next up previous
Next: getkcorr.pro Up: Description of the program Previous: Description of the program
Peter E. Nugent Jr.
1998-10-01