Diagnostic Gif#

Intro

We can start by importing our favourite package: elk!

[1]:
import elk
import numpy as np

%config InlineBackend.figure_format = "retina" # Not required, only applicable for Jupyter Notebooks

Lightcurve Setup#

Now let’s do a simple ensemble light curve fit to NGC~129

We just want a single light curve, and we don’t care which sector it is from, so we will use the just_one_lc command

[2]:
c = elk.ensemble.EnsembleLC(identifier='NGC 419',
                            location='23.58271, +61.1236',
                            radius=.046,
                            cluster_age=7.75,
                            cutout_size=99,
                            just_one_lc=True,
                            verbose=True)
[3]:
c.create_output_table()
NGC 419 has 4 observations
Starting Quality Tests for Observation: 0
100%|███████████████████████| 9801/9801 [13:30<00:00, 12.09it/s]
  Passed Quality Tests 
Found a lightcurve that passed quality tests - exiting since `self.just_one_lc=True`

Plotting the lightcurve itself#

Let’s quickly grab the 3rd light curve since that sector is usually looking lovely this time of year

[4]:
lc = c.lcs[0]

The plotting of the light curve itself is rather straightforward!

[5]:
lc.plot()
../_images/tutorials_diagnostic_gif_11_0.png
[5]:
(<Figure size 640x480 with 1 Axes>,
 <Axes: title={'center': 'Lightcurve for Sector 18'}, xlabel='Time $\\rm [days]$', ylabel='Flux $[e / {\\rm s}]$'>)

Now lets plot the periodogram

[6]:
lc.plot_periodogram()
../_images/tutorials_diagnostic_gif_13_0.png
[6]:
(<Figure size 640x480 with 1 Axes>,
 <Axes: title={'center': 'Periodogram for Sector 18'}, xlabel='Frequency $[1 / {\\rm days}]$', ylabel='Power'>)

Ther are 5 peaks in this LSP. What are they?

[7]:
lc.stats['peak_freqs'][:lc.stats['n_peaks']]
[7]:
array([0.31, 0.4 , 0.74, 0.81, 0.87])

Now, lets investigate the spacial pixel map for this light curve, and look at which pixels in the aperture contribute powers to each peak.

We can do this by using the lc.diagnose_lc_periodogram function. We need to specify a path to put the gif frames, and the gif, and how we want to identify this gif.

The first index in the return is the gif itself, and the second index is a SIMBAD query for all the sources in the pixels for each peak.

[8]:
lc.diagnose_lc_periodogram(output_path='Corrected_LCs/', identifier='NGC 419')[0]
[8]:

diagnostic_gif

[9]:
simbad_query=lc.diagnose_lc_periodogram(output_path='Corrected_LCs/', identifier='NGC 419')[1]

Lets try and look at the highest peak, the one at 0.81 days

[10]:
simbad_query[3]
[10]:
Row index=3
MAIN_IDRADECV__vartypV__VmaxV__R_VmaxV__magtypV__UpVminV__VminV__R_VminV__UpPeriodV__periodV__R_periodOTYPEFLUX_Vpeak_freqpeak_lowerpeak_upper
"h:m:s""d:m:s"magmagdaymag
str27str13str13str16float32str1str1str1float32str1str1float64str2str6float32float64float64float64
Gaia DR3 50997040226387686401 34 31.7910+61 06 23.019PULS--G--1.238034PulsV*--0.810.780.83

The peak has a frequency of 0.81 days, and there is a pulsating variable at that location corresponding to that peak with a period of 1.23 days\(^{-1}\). Lets remember that frequency = 1/period, and 1/1.23 = 0.81, so it is very likely that this pulsating variable is the cause of the peak in the LSP

[11]:
1/1.23
[11]:
0.8130081300813008

Note

This tutorial was generated from a Jupyter notebook that can be found here.