diff --git a/plot.sh b/plot.sh index 7c4db22..0735b24 100755 --- a/plot.sh +++ b/plot.sh @@ -14,11 +14,11 @@ echo Propagating tables. scripts/propagate_tables.sh > /dev/null case $1 in - "PSD") + "PSD"|"psd"|"PSDs"|"PSDS"|"psds") echo "Producing PSD atlas." gnuplot_file=psd_atlas.gp gnuplot_input=$(cat scripts/templates/${gnuplot_file}|perl -pe 's|\n|␤|g') - for tabfile in analyses/tables/PSD_*${errtype}*; + for tabfile in analyses/tables/PSD_*${errtype}*.tab; do echo_band=$(basename $tabfile| sed 's|PSD[_ ]\(.\{5\}\)[_ ]{[^_ ]*}.tab|\1|') @@ -33,11 +33,11 @@ case $1 in ;; - "lags") + "lags"|"lag"|"delay"|"delays") echo "Producing time delay atlas." gnuplot_file=timelag_atlas.gp gnuplot_input=$(cat scripts/templates/${gnuplot_file}|perl -pe 's|\n|␤|g') - for tabfile in analyses/tables/timelag_*${errtype}*; + for tabfile in analyses/tables/timelag_*${errtype}*.tab; do ref_band_extracted=$(basename $tabfile|sed 's|timelag_\([^≺]*\)[_ ]≺[_ ][^≺_ ]*[_ ]{[^_ ]*}.tab|\1|') echo_band=$(basename $tabfile|sed 's|timelag_[^≺]*[_ ]≺[_ ]\([^≺_ ]*\)[_ ]{[^_ ]*}.tab|\1|') @@ -50,7 +50,13 @@ case $1 in echo "$gnuplot_input"|perl -pe 's|␤|\n|g' > ${gnuplot_file} gnuplot $gnuplot_file ;; - default) + + "tophat") + gnuplot_file=tophat_w_fft.gp + + ;; + + *) echo "Did not understand plot type." ;; esac \ No newline at end of file diff --git a/pres/.~lock.intro.odp# b/pres/.~lock.intro.odp# deleted file mode 100644 index 593be98..0000000 --- a/pres/.~lock.intro.odp# +++ /dev/null @@ -1 +0,0 @@ -,caes,calculo-agilis,10.08.2016 03:16,file:///home/caes/.config/libreoffice/4; \ No newline at end of file diff --git a/pres/final/.~lock.final.odp# b/pres/final/.~lock.final.odp# new file mode 100644 index 0000000..6edd0a1 --- /dev/null +++ b/pres/final/.~lock.final.odp# @@ -0,0 +1 @@ +,caes,calculo-agilis,10.08.2016 11:07,file:///home/caes/.config/libreoffice/4; \ No newline at end of file diff --git a/pres/final/final.odp b/pres/final/final.odp new file mode 100644 index 0000000..a42da7d Binary files /dev/null and b/pres/final/final.odp differ diff --git a/pres/final/final.pdf b/pres/final/final.pdf new file mode 100644 index 0000000..2f41a01 Binary files /dev/null and b/pres/final/final.pdf differ diff --git a/pres/final_notes b/pres/final_notes new file mode 100644 index 0000000..3d18807 --- /dev/null +++ b/pres/final_notes @@ -0,0 +1,30 @@ +Intro + + continuum reverberation mapping + tradiational approach + our approach + +results + +future work + + + +This is looking good, and will be excellent once you finish including the figures at what I’m assuming are their place-holders. + +I think: “UV/optical reverberation mapping of NGC 5548 with frequency-resolved techniques” is a better title. ‘Maximum Likelihood’ is a generic term, and doesn’t explain exactly what you’ve been doing. + +Slide showing the Fausnaugh et al. lag vs wavelength plot does not show ‘Frequency-dependent time delays’ as the title implies. Maybe better to write ‘Time-domain lag analysis from STORM III' + +Motivation: strictly speaking all the information available through the frequency-domain analysis is also available in the time domain analysis. The cross correlation function (CCF) that is calculated in the time domain analysis can also be directly linked to the transfer function. The point is more that from the standard cross correlation analysis, astronomers typically extract one number, the centroid time lag. This throws out all the other information in the CCF. The frequency-domain analysis that we do doesn’t lose any of this information. + +You should have a conclusions slide. + +Conclusions: +a) This method works with the quality of optical AGN data available! This was an exploratory project, so it’s exciting to see it working. + +b) the PSD is wavelength dependent, with more power at the shortest wavelengths, and the power dropping systematically with wavelength. This is expected in the reverberation scenario since the ‘blurring’ of the lightcurve by the reverberation smooths out the lightcurves, removing variability. + +c) We see frequency-dependent lags. The average lag shows the same systematic trend as from the time domain analysis. However, we also now see how the lag changes with frequency - this will help determine the shape of the transfer function. This is an important next step - figuring out exactly what the frequency dependence means! + +Ed \ No newline at end of file diff --git a/pres/final_outline b/pres/final_outline new file mode 100644 index 0000000..256f474 --- /dev/null +++ b/pres/final_outline @@ -0,0 +1,29 @@ +Intro +────────────────────────────────────────────────────────────────────────── + +AGN - What they are +AGN - NGC 5548 +AGN - Simple Model + + + Previous work + ────────────────────────────────────────────────────────────────────────── + Fausnaugh et al. - Data + Optical RM - current status and issues + Fausnaugh et al. - analysis and results + +Technique +────────────────────────────────────────────────────────────────────────── +Reverberation Mapping - Basic Concept/picture +Reverberation Mapping - Transfer Function +Reverberation Mapping - tophat with FFT + +Results +────────────────────────────────────────────────────────────────────────── +PSD Atlas +Time delay Atlas +Constructing the transfer function +Show transfer function compared with tophat FFT + + + diff --git a/pres/img/TCCF_fausnaugh.svg b/pres/img/TCCF_fausnaugh.svg new file mode 100644 index 0000000..f2e6976 --- /dev/null +++ b/pres/img/TCCF_fausnaugh.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/pres/img/lightcurves.pdf b/pres/img/lightcurves.pdf new file mode 100644 index 0000000..842be78 Binary files /dev/null and b/pres/img/lightcurves.pdf differ diff --git a/pres/img/lightcurves.svg b/pres/img/lightcurves.svg new file mode 100644 index 0000000..8763315 --- /dev/null +++ b/pres/img/lightcurves.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/pres/img/psd_atlas.pdf b/pres/img/psd_atlas.pdf new file mode 100644 index 0000000..757f71e Binary files /dev/null and b/pres/img/psd_atlas.pdf differ diff --git a/pres/img/psd_atlas.svg b/pres/img/psd_atlas.svg new file mode 100644 index 0000000..59197da --- /dev/null +++ b/pres/img/psd_atlas.svg @@ -0,0 +1,2220 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pres/img/timelag_atlas.pdf b/pres/img/timelag_atlas.pdf new file mode 100644 index 0000000..0bd75d1 Binary files /dev/null and b/pres/img/timelag_atlas.pdf differ diff --git a/pres/img/timelag_atlas.svg b/pres/img/timelag_atlas.svg new file mode 100644 index 0000000..c7618af --- /dev/null +++ b/pres/img/timelag_atlas.svg @@ -0,0 +1,2393 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pres/img/tophat_freqdomain.pdf b/pres/img/tophat_freqdomain.pdf new file mode 100644 index 0000000..4797656 Binary files /dev/null and b/pres/img/tophat_freqdomain.pdf differ diff --git a/pres/img/tophat_timedomain.pdf b/pres/img/tophat_timedomain.pdf new file mode 100644 index 0000000..3a49c7f Binary files /dev/null and b/pres/img/tophat_timedomain.pdf differ diff --git a/pres/intro.odp b/pres/intro.odp new file mode 100644 index 0000000..b8b2a35 Binary files /dev/null and b/pres/intro.odp differ diff --git a/run_analysis.sh b/run_analysis.sh old mode 100644 new mode 100755 diff --git a/scripts/gaussian_fit.py b/scripts/gaussian_fit.py old mode 100644 new mode 100755 diff --git a/scripts/spec.py b/scripts/spec.py old mode 100644 new mode 100755 diff --git a/scripts/tophat_fft.pl b/scripts/tophat_fft.pl index 74ac733..de9faa0 100755 --- a/scripts/tophat_fft.pl +++ b/scripts/tophat_fft.pl @@ -2,25 +2,54 @@ use feature say; use utf8; +use PDL; use PDL::FFT; +use PDL::IO::Misc; -my $PI = 3.1415926539; -my $N = 64; -my ($series, $other_series); -for (my $k=0; $k<$N; $k++) { - $series->[$k] = sin(4*$k*$PI/$N) + cos(6*$k*$PI/$N); +my $twoPI = 2*3.1415926539; + +# space parameters +our $Δt=.001; +our $xmin = 0; +our $xmax = 250; +our $num_bins = ($xmax-$xmin)/$Δt; + +say "Creating $num_bins bins"; + +# Complex Number z(x) = u(x) + iv(x) +my @th_list=tophat(10,7); +my $u = pdl(@th_list); +my $v = zeroes($u); + +# Output time-domain tophat +open $tophattab, '>', 'analyses/tables/tophat.tab'; +for ($i=0; $i < $num_bins; $i++) { + my $x_coord = ($xmax-$xmin)*($i/$num_bins) + $xmin; + say $tophattab "$x_coord $th_list[$i]"; } -my $fft = new Math::FFT($series); -my $coeff = $fft->rdft(); -my $spectrum = $fft->spctrm; -my $original_data = $fft->invrdft($coeff); +close $tophattab; -for (my $k=0; $k<$N; $k++) { - $other_series->[$k] = sin(16*$k*$PI/$N) + cos(8*$k*$PI/$N); -} -my $other_fft = $fft->clone($other_series); -my $other_coeff = $other_fft->rdft(); -my $correlation = $fft->correl($other_fft); +# Transform z(x) to z(1/x) = u(1/x) + iv(1/x) +fft($u,$v); +# Determine frequency coordinates +my $num_elements = nelem($u); +say "Found $num_elements elements."; +$f = $u->xlinvals(-($num_elements/2-1)/$num_elements/$Δt,1/2/$Δt)->rotate(-($num_elements/2 -1)); + +my $φdiff = atan2($v,$u); +my $timelag = $φdiff/($twoPI*$f); + +wcols $f,$timelag,'analyses/tables/tophat_fft.tab'; -sub top_hat \ No newline at end of file +sub tophat { + (my $mean,my $width) = @_; + my $halfwidth = $width/2; + my @vals = (); + for ($i=0; $i < $num_bins; $i++) { + my $x_coord = ($xmax-$xmin)*($i/$num_bins) + $xmin; + if ($x_coord >= ($mean - $halfwidth ) && $x_coord <= ($mean + $halfwidth)) { push @vals, 1/$width; } + else { push @vals, 0; } + } + return @vals; +} \ No newline at end of file