Light Curve Analysis

Kristopher Mortensen

Objective:

  1. Using the data for redshift = 0.015 (z = 0.015), I would like for you to plot the light curve in the "i" band.

  2. Once you accomplish that, I would like for you to plot the light curve of the same source in apparent magnitude. Hint - you'll need to convert from redshift to distance and then convert from distance to distance modulus.

To accomplish this goal, I will be using data from the NS-NS compact binary APR4-1215. That bands with which the light curves will be calculated are the u, g, r, i, and z bands.


In [45]:
#in order to product the proper plots and calculations, I will need matplotlib, numpy, pandas, and astropy.
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import astropy as astro
plt.rcParams["figure.figsize"] = (10,8)

In [46]:
#retrieve the data of the absolute magnitudes of APR4-1215
data = pd.read_csv("/Users/kristophermortensen/Desktop/CIERA REU 2017/APR4-1215.csv")
data


Out[46]:
day u g r i z J H K
0 1.06 -8.76 -10.54 -12.29 -13.91 -14.75 -14.08 -12.78 -11.85
1 1.19 -8.35 -10.36 -12.23 -13.86 -14.77 -14.08 -12.61 -11.67
2 1.33 -7.98 -10.15 -12.14 -13.81 -14.77 -14.09 -12.37 -11.14
3 1.50 -7.46 -9.95 -12.04 -13.74 -14.75 -14.12 -12.28 -10.68
4 1.68 -7.03 -9.66 -11.88 -13.65 -14.71 -14.17 -12.47 -10.55
5 1.88 -6.5 -9.34 -11.71 -13.53 -14.65 -14.20 -12.71 -10.87
6 2.11 -5.71 -9.05 -11.55 -13.41 -14.57 -14.24 -12.98 -11.27
7 2.37 -5.16 -8.60 -11.30 -13.26 -14.45 -14.26 -13.20 -11.66
8 2.66 -4.54 -8.06 -11.02 -13.08 -14.30 -14.30 -13.43 -12.16
9 2.99 -3.19 -7.66 -10.75 -12.89 -14.14 -14.35 -13.57 -12.57
10 3.35 -2.82 -7.02 -10.38 -12.58 -13.96 -14.37 -13.64 -12.94
11 3.76 -2.64 -6.36 -9.90 -12.26 -13.76 -14.30 -13.63 -13.21
12 4.22 -0.48 -5.53 -9.43 -11.87 -13.56 -14.18 -13.57 -13.45
13 4.73 3.68 -4.83 -8.76 -11.36 -13.31 -13.99 -13.48 -13.69
14 5.31 #NAME? -3.81 -8.02 -10.79 -12.96 -13.77 -13.42 -13.93
15 5.96 12.43 -2.81 -7.08 -10.21 -12.50 -13.52 -13.34 -14.10
16 6.68 #NAME? -1.52 -6.29 -9.59 -11.94 -13.19 -13.26 -14.14
17 7.50 #NAME? 0.09 -5.11 -8.99 -11.30 -12.77 -13.11 -14.13
18 8.41 #NAME? -1.50 -4.97 -8.32 -10.65 -12.24 -12.89 -14.07
19 9.44 -0.61 -0.81 -4.01 -7.60 -9.96 -11.71 -12.64 -14.00
20 10.59 #NAME? 0.82 -4.55 -6.83 -9.22 -11.19 -12.36 -13.90
21 11.89 #NAME? 0.03 -4.25 -6.30 -8.46 -10.70 -12.07 -13.77
22 13.34 #NAME? -1.08 -4.61 -6.06 -7.75 -10.40 -11.83 -13.66
23 14.96 #NAME? -1.22 -4.35 -5.86 -7.32 -10.11 -11.55 -13.50
24 16.79 #NAME? 6.83 -4.42 -5.76 -7.06 -9.89 -11.35 -13.32
25 18.84 #NAME? 2.19 -4.28 -5.72 -6.93 -9.74 -11.14 -13.18
26 21.13 #NAME? -1.11 -4.28 -5.75 -6.80 -9.67 -10.94 -13.09
27 23.71 #NAME? 4.10 -4.22 -5.62 -6.67 -9.48 -10.70 -12.95
28 26.61 #NAME? 0.24 -4.57 -5.78 -6.67 -9.29 -10.51 -12.79
29 29.85 #NAME? 0.26 -4.82 -5.71 -6.49 -9.17 -10.32 -12.67

In [47]:
#store the data for the day and magnitude measurements as 'day' and 'i_band' repectively.
day = data.day
day_u=day[0:14]
u_band=pd.to_numeric(data.u[0:14])
g_band=data.g
r_band=data.r
i_band=data.i
z_band=data.z
redshift=0.015

In [48]:
#plot the absolute magnitudes of APR4-1215 as a function of time (measured in days).
plt.plot(day_u, u_band, 'b', label='u')
plt.plot(day, g_band, 'g', label='g')
plt.plot(day, r_band, 'y', label='r')
plt.plot(day, i_band, 'orange', label='i')
plt.plot(day, z_band, 'r', label='z')
plt.axis([0,35,10,-20])
plt.title("Light Curve of APR4-1215 (NS-NS)")
plt.xlabel("Time (Days)")
plt.ylabel("Absolute Magnitude")
plt.legend(bbox_to_anchor=(0.92, 0.998), loc=2, borderaxespad=0.)


Out[48]:
<matplotlib.legend.Legend at 0x1156fe470>

In [49]:
from astropy.cosmology import WMAP9 as cosmo
#app_mag: ListofNumbers -> ListofNumbers
#converts all the absolute magnitudes into apparent magnitudes.
def app_mag(data, redshift):
    return 5*np.log10(lumo_dist(redshift)/10)+data

#lumo_dist: Number -> Number
#converts redshift to luminosity distance
def lumo_dist(redshift):
    return cosmo.luminosity_distance(redshift).to(astro.units.pc).value

In [50]:
#convert all the absolute magnitudes into apparent magnitudes in the i band, and store it as i_new.
u_new=app_mag(u_band, redshift)
r_new=app_mag(r_band, redshift)
g_new=app_mag(g_band, redshift)
i_new=app_mag(i_band, redshift)
z_new=app_mag(z_band, redshift)

In [51]:
#These are the typical 5-sigma depths that LSST can see in each of the photometric bands.
LSST_u=(day/day)-1+23.9
LSST_g=(day/day)-1+25.0
LSST_r=(day/day)-1+24.7
LSST_i=(day/day)-1+24.0
LSST_z=(day/day)-1+23.3

In [52]:
#plot the apparent magnitudes as a function of time (measured in days).
fig=plt.figure(figsize=(12,12))
ax=fig.add_subplot(111)
ax.plot(day_u, u_new, 'b', label='u')
ax.plot(day, g_new, 'g', label='g')
ax.plot(day, r_new, 'y', label='r')
ax.plot(day, i_new, 'orange', label='i')
ax.plot(day, z_new, 'r', label='z')
ax.plot(day, LSST_u, 'b--', label='LSST \n(u band)')
ax.plot(day, LSST_g, 'g--', label='LSST \n(g band)')
ax.plot(day, LSST_r, 'y--', label='LSST \n(r band)')
ax.plot(day, LSST_i, '--', color='orange', label='LSST \n(i band)')
ax.plot(day, LSST_z, 'r--', label='LSST \n(z band)')

plt.axis([0,35,50,10])
plt.title("Light Curve of APR4-1215 (NS-NS) with z=0.015")
plt.xlabel("Time (Days)")
plt.ylabel("Apparent Magnitude")
plt.legend(bbox_to_anchor=(0.881, 0.999), loc=2, borderaxespad=0.)
fig.savefig('samplefigure', bbox_inches='tight')


Conclusion

Looking at the apparent light curves of the five bands, it is clear that the near IR bands, LSST can detect the kilonova light curves for longer periods of time than the shorter wavelength bands. Even though the data comes from similations, this is key for LSST considering the time frame of these compact binaries. If LSST receives word that LIGO observed a source in a large map of the sky, the telescope will want to have as must time looking for this transient light before it is too far out of its reach. Therefore, according to this model, having the telescope look more in the near IR spectrum allows more time for the telescope to detect the NS-NS merger.