Commit 0e19cc73 authored by Stefano Covino's avatar Stefano Covino
Browse files

170225 commit

parent 2f99cfa7
Loading
Loading
Loading
Loading

Course.jl

0 → 100644
+370 −0
Original line number Diff line number Diff line
### A Pluto.jl notebook ###
# v0.20.4

using Markdown
using InteractiveUtils

# ╔═╡ ad6879b3-ad9d-4d7c-9122-f034949ae0cf
using PlutoUI

# ╔═╡ 14ef8e22-f10f-472a-b512-5cd62781b082
md"""
**What is this?**


*This jupyter notebook is part of a collection of notebooks on various topics discussed during the Time Domain Astrophysics course delivered by Stefano Covino at the [Università dell'Insubria](https://www.uninsubria.eu/) in Como (Italy). Please direct questions and suggestions to [stefano.covino@inaf.it](mailto:stefano.covino@inaf.it).*
"""

# ╔═╡ bfe2b83c-dba1-4c64-a35f-83264822c9d7
md"""
**This is a `pluto` notebook**
"""

# ╔═╡ 9b05aaa6-d44f-4081-8749-ab5408a492b9
md"""
$(LocalResource("Lectures/Pics/TimeDomainBanner.jpg"))
"""

# ╔═╡ 270dc9c6-5eb3-4838-bf4a-62cbf2339a53
md"""
# Time-Domain Astrophysics
***
"""

# ╔═╡ aec92f06-df81-4c51-99cb-ac3ebc91c7fc
md"""
## Academic Year 2024-2025
***
"""

# ╔═╡ 78f7f381-9d3e-4715-87d4-b4165025aded
md"""
### Lecture list:
***

1. [Lecture: Introduction](./open?path=Lectures/Lecture - Introduction/Lecture-Introduction.jl)
2. [Lecture: Statistics Reminder](./open?path=Lectures/Lecture - Statistics Reminder/Lecture-StatisticsReminder.jl)
3. [Lecture: Spectral Analysis](./open?path=Lectures/Lecture - Spectral Analysis/Lecture-SpectralAnalysis.jl)
4. [Science case: Sunspot number](Lectures/Science%20Case%20-%20Sunspot%20Number/Lecture-SunspotNumber.ipynb)
5. [Science case: X-ray binaries](Lectures/Science%20Case%20-%20X-Ray%20Binaries/Lecture-X-RayBinaries.ipynb)
6. [Lecture: Irregular sampling](Lectures/Lecture%20-%20Lomb-Scargle/Lecture-Lomb-Scargle.ipynb)
7. [Science case: Variable stars](Lectures/Science%20Case%20-%20Variable%20Stars/Lecture-VariableStars.ipynb)
8. [Lecture: Time Domain analysis](Lectures/Lecture%20-%20Time%20Domain%20Analysis/Lecture-Time-Domain.ipynb)
9. [Science case: AGN and Blazars](Lectures/Science%20Case%20-%20AGN%20and%20Blazars/Lecture-AGN-and-Blazars.ipynb)
10. [Lecture: Wavelet Analysis](Lectures/Lecture%20-%20Wavelet%20Analysis/Lecture-Wavelet-Analysis.ipynb)
11. [Lecture: Time of Arrival](Lectures/Lecture%20-%20Time%20of%20Arrival/Lecture-Time-of-Arrival.ipynb)
12. [Science case: FRBs](Lectures/Science%20Case%20-%20FRBs/Lecture-FRBs.ipynb)
13. [Lecture: Non Parametric Analysis](Lectures/Lecture%20-%20Non%20Parametric%20Analysis/Lecture-NonParametricAnalysis.ipynb)
14. [Lecture: Gaussian Processes](Lectures/Lecture%20-%20Gaussian%20Processes/Lecture-GassianProcesses.ipynb)
15. [Science case: GRBs](Lectures/Science%20Case%20-%20GRBs/Lecture-GRBs.ipynb)
16. [Lecture: Astrostatistics Future](Lectures/Lecture%20-%20Astrostatistics%20Future/Lecture-AstrostatisticsFuture.ipynb)
"""

# ╔═╡ 0fb9db7b-6dd2-4aaf-870d-49f36a5e0f00
md"""
**Copyright**

This notebook is provided as [Open Educational Resource](https://en.wikipedia.org/wiki/Open_educational_resources). Feel free to use the notebook for your own purposes. The text is licensed under [Creative Commons Attribution 4.0](https://creativecommons.org/licenses/by/4.0/), the code of the examples, unless obtained from other properly quoted sources, under the [MIT license](https://opensource.org/licenses/MIT). Please attribute the work as follows: *Stefano Covino, Time Domain Astrophysics - Lecture notes featuring computational examples, 2025*.
"""

# ╔═╡ 00000000-0000-0000-0000-000000000001
PLUTO_PROJECT_TOML_CONTENTS = """
[deps]
PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8"

[compat]
PlutoUI = "~0.7.61"
"""

# ╔═╡ 00000000-0000-0000-0000-000000000002
PLUTO_MANIFEST_TOML_CONTENTS = """
# This file is machine-generated - editing it directly is not advised

julia_version = "1.11.3"
manifest_format = "2.0"
project_hash = "6d1b77f27e79835fc27b2d7e99ab8fcaf37aa976"

[[deps.AbstractPlutoDingetjes]]
deps = ["Pkg"]
git-tree-sha1 = "6e1d2a35f2f90a4bc7c2ed98079b2ba09c35b83a"
uuid = "6e696c72-6542-2067-7265-42206c756150"
version = "1.3.2"

[[deps.ArgTools]]
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
version = "1.1.2"

[[deps.Artifacts]]
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
version = "1.11.0"

[[deps.Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
version = "1.11.0"

[[deps.ColorTypes]]
deps = ["FixedPointNumbers", "Random"]
git-tree-sha1 = "b10d0b65641d57b8b4d5e234446582de5047050d"
uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
version = "0.11.5"

[[deps.CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
version = "1.1.1+0"

[[deps.Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
version = "1.11.0"

[[deps.Downloads]]
deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"]
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
version = "1.6.0"

[[deps.FileWatching]]
uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
version = "1.11.0"

[[deps.FixedPointNumbers]]
deps = ["Statistics"]
git-tree-sha1 = "05882d6995ae5c12bb5f36dd2ed3f61c98cbb172"
uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
version = "0.8.5"

[[deps.Hyperscript]]
deps = ["Test"]
git-tree-sha1 = "179267cfa5e712760cd43dcae385d7ea90cc25a4"
uuid = "47d2ed2b-36de-50cf-bf87-49c2cf4b8b91"
version = "0.0.5"

[[deps.HypertextLiteral]]
deps = ["Tricks"]
git-tree-sha1 = "7134810b1afce04bbc1045ca1985fbe81ce17653"
uuid = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2"
version = "0.9.5"

[[deps.IOCapture]]
deps = ["Logging", "Random"]
git-tree-sha1 = "b6d6bfdd7ce25b0f9b2f6b3dd56b2673a66c8770"
uuid = "b5f81e59-6552-4d32-b1f0-c071b021bf89"
version = "0.2.5"

[[deps.InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
version = "1.11.0"

[[deps.JSON]]
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a"
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
version = "0.21.4"

[[deps.LibCURL]]
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
version = "0.6.4"

[[deps.LibCURL_jll]]
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"]
uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"
version = "8.6.0+0"

[[deps.LibGit2]]
deps = ["Base64", "LibGit2_jll", "NetworkOptions", "Printf", "SHA"]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
version = "1.11.0"

[[deps.LibGit2_jll]]
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"]
uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5"
version = "1.7.2+0"

[[deps.LibSSH2_jll]]
deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
version = "1.11.0+1"

[[deps.Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
version = "1.11.0"

[[deps.LinearAlgebra]]
deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"]
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
version = "1.11.0"

[[deps.Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
version = "1.11.0"

[[deps.MIMEs]]
git-tree-sha1 = "1833212fd6f580c20d4291da9c1b4e8a655b128e"
uuid = "6c6e2e6c-3030-632d-7369-2d6c69616d65"
version = "1.0.0"

[[deps.Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
version = "1.11.0"

[[deps.MbedTLS_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
version = "2.28.6+0"

[[deps.Mmap]]
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
version = "1.11.0"

[[deps.MozillaCACerts_jll]]
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
version = "2023.12.12"

[[deps.NetworkOptions]]
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
version = "1.2.0"

[[deps.OpenBLAS_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"]
uuid = "4536629a-c528-5b80-bd46-f80d51c5b363"
version = "0.3.27+1"

[[deps.Parsers]]
deps = ["Dates", "PrecompileTools", "UUIDs"]
git-tree-sha1 = "8489905bcdbcfac64d1daa51ca07c0d8f0283821"
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
version = "2.8.1"

[[deps.Pkg]]
deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "Random", "SHA", "TOML", "Tar", "UUIDs", "p7zip_jll"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
version = "1.11.0"

    [deps.Pkg.extensions]
    REPLExt = "REPL"

    [deps.Pkg.weakdeps]
    REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"

[[deps.PlutoUI]]
deps = ["AbstractPlutoDingetjes", "Base64", "ColorTypes", "Dates", "FixedPointNumbers", "Hyperscript", "HypertextLiteral", "IOCapture", "InteractiveUtils", "JSON", "Logging", "MIMEs", "Markdown", "Random", "Reexport", "URIs", "UUIDs"]
git-tree-sha1 = "7e71a55b87222942f0f9337be62e26b1f103d3e4"
uuid = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
version = "0.7.61"

[[deps.PrecompileTools]]
deps = ["Preferences"]
git-tree-sha1 = "5aa36f7049a63a1528fe8f7c3f2113413ffd4e1f"
uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
version = "1.2.1"

[[deps.Preferences]]
deps = ["TOML"]
git-tree-sha1 = "9306f6085165d270f7e3db02af26a400d580f5c6"
uuid = "21216c6a-2e73-6563-6e65-726566657250"
version = "1.4.3"

[[deps.Printf]]
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
version = "1.11.0"

[[deps.Random]]
deps = ["SHA"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
version = "1.11.0"

[[deps.Reexport]]
git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b"
uuid = "189a3867-3050-52da-a836-e630ba90ab69"
version = "1.2.2"

[[deps.SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
version = "0.7.0"

[[deps.Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
version = "1.11.0"

[[deps.Statistics]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "ae3bb1eb3bba077cd276bc5cfc337cc65c3075c0"
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
version = "1.11.1"

    [deps.Statistics.extensions]
    SparseArraysExt = ["SparseArrays"]

    [deps.Statistics.weakdeps]
    SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[[deps.TOML]]
deps = ["Dates"]
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
version = "1.0.3"

[[deps.Tar]]
deps = ["ArgTools", "SHA"]
uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
version = "1.10.0"

[[deps.Test]]
deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
version = "1.11.0"

[[deps.Tricks]]
git-tree-sha1 = "6cae795a5a9313bbb4f60683f7263318fc7d1505"
uuid = "410a4b4d-49e4-4fbc-ab6d-cb71b17b3775"
version = "0.1.10"

[[deps.URIs]]
git-tree-sha1 = "67db6cc7b3821e19ebe75791a9dd19c9b1188f2b"
uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"
version = "1.5.1"

[[deps.UUIDs]]
deps = ["Random", "SHA"]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
version = "1.11.0"

[[deps.Unicode]]
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
version = "1.11.0"

[[deps.Zlib_jll]]
deps = ["Libdl"]
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
version = "1.2.13+1"

[[deps.libblastrampoline_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"
version = "5.11.0+0"

[[deps.nghttp2_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"
version = "1.59.0+0"

[[deps.p7zip_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"
version = "17.4.0+2"
"""

# ╔═╡ Cell order:
# ╟─14ef8e22-f10f-472a-b512-5cd62781b082
# ╟─bfe2b83c-dba1-4c64-a35f-83264822c9d7
# ╠═ad6879b3-ad9d-4d7c-9122-f034949ae0cf
# ╟─9b05aaa6-d44f-4081-8749-ab5408a492b9
# ╟─270dc9c6-5eb3-4838-bf4a-62cbf2339a53
# ╟─aec92f06-df81-4c51-99cb-ac3ebc91c7fc
# ╟─78f7f381-9d3e-4715-87d4-b4165025aded
# ╟─0fb9db7b-6dd2-4aaf-870d-49f36a5e0f00
# ╟─00000000-0000-0000-0000-000000000001
# ╟─00000000-0000-0000-0000-000000000002
+1 −1
Original line number Diff line number Diff line
%% Cell type:markdown id:91330533 tags:

**What is this?**


*This jupyter notebook is part of a collection of notebooks on various topics discussed during the Time Domain Astrophysics course delivered by Stefano Covino at the [Università dell'Insubria](https://www.uninsubria.eu/) in Como (Italy). Please direct questions and suggestions to [stefano.covino@inaf.it](mailto:stefano.covino@inaf.it).*

%% Cell type:markdown id:915ee876 tags:

**This is a textual notebook**

%% Cell type:markdown id:53194e25 tags:

![Time Domain Astrophysics](Pics/TimeDomainBanner.jpg)

%% Cell type:markdown id:a7b36f9a tags:

# Introduction
***

%% Cell type:markdown id:b336520e tags:

## Contacts
***

![Stefano](Pics/Stefano.png)

- Stefano Covino
- INAF / Brera Astronomical Observatory
- +39 02 72320475
- +39 3316748534 (if urgent…)
- Emails: [stefano.covino@inaf.it](mailto:stefano.covino@inaf.it)  - [stefano.covino@uninsubria.it](mailto:stefano.covino@uninsubria.it)
- Web: https://sites.google.com/a/inaf.it/stefano-s-site/

![Banner](Pics/Banner.png)

%% Cell type:markdown id:9556e54d tags:

## Main Goal of the course: Have fun!
***

|![data](Pics/data.jpg)|![regression](Pics/regression.jpg)|
|----------------------|----------------------------------|

%% Cell type:markdown id:cffcb879 tags:

## Program (for 6 or 7 courses, roughly…)
***

1. Introduction to time series
2. Time (and spatial) variability in astrophysics
3. Fourier analysis and noise characterization
4. Case study: stellar variability
5. Case study: exo-planet transits
6. Case study: pulsars
7. Time-domain analysis and auto-regressive processe
8. Irregular sampling, Lomb-Scargle periodograms
9. Case studies: AGN variability
10. Advanced topics:  non-parametric analysis
11. Matching filters
12. Case study: LIGO/Virgo gravitational wave signals
13. Data exploration
14. Case study: SETI data analysis
15. Big-data, machine learning and “intelligent” systems for time-series analysis
16. Case studies: spatial variability (CMB, large scale structure)
17. Final topics:  forecasting

> In reality these are just topics that can be covered. We can stress different aspects depending on the interests of the *students*.

%% Cell type:markdown id:2d351400 tags:

## Time-Series are ubiquitous
***

- Anytime we have a measurement repetated multiple times we have a time-series.

![CO_2 vs Temp](Pics/CO2T.png)

![CO_2](Pics/CO2.png)

![Neptune](Pics/Neptune.png)

- As a matter of fact, a time-series does not need to have "time" as index!

![PAMELA](Pics/PAMELA.png)

![Satellite](Pics/satellite.png)

%% Cell type:markdown id:722fb437 tags:

## Temptative schedule (don’t trust it too much…)
***

1. 26/2 - Introduction
2. 27/2 - Statistics reminder - part I
3. 5/3 - Statistics reminder - part II
4. 6/3 - Spectral analysis - part I
5. 12/3 - Spectral analysis - part II
6. 13/3 - Science cases: Sunspots Number - X-ray Binaries
7. 19/3 - Irregularly sampled time series - part I
8. 20/3 - Irregularly sampled time series - part II
9. 26/3 - Science Cases - Variable Stars - AGN and blazars
10. 27/3 - Time domain analysis - part I
11. 2/4 - Time domain analysis - part II
12. 3/4 - Guest lecture - Spectral analysis in Cosmology
13. 9/4 - Guest lecture - X-ray pulsators
14. 10/4 - Time domain analysis - ARIMA models
15. 16/4 - Time domain analysis - Advanced  tools
16. 30/4 - Wavelet analysis
17. 7/5 - Guest lecture - Exoplanets
18. 8/5 - Time of arrival analysis
19. 14/5 - Non-parametric methods
20. 15/5 - Gaussian processes
21. 21/5 - Science case: GRBs
22. 22/5 - Astrostatistics final considerations

%% Cell type:markdown id:f73fd0ea tags:

## How is the course managed?
***

### Frontal lectures

- These are the traditional university lectures.

- Although this increases the organizational complexity substantially, I am availbale to stream and record my lectures, if needed.

- There are contraindications. As a matter of fact, this is one of few cases where a remote access is not even close as effective as being in presence.

![Frontal Lectures](Pics/FrontalLectures.jpg)

### Real research life examples…

- Scientists working in the field will deliver "didactic lectures", allowing one to see most of ideas deveooped during the course applied in a real research environment.

![Paperino astronomo](Pics/Paperino.jpg)

### (Optional) papers to deepen our knowledge…

- Most of the topics discussd during the course can be investigated thoroughly and papers from astrophysical (mainly) literature are presented for particularly concerned readers.

![Author et al.](Pics/Papersetal.jpg)

### Question time

- The course is divided in several main sections. At the end of each of them, some time will be devoted to open discussions and questions.

![Questions](Pics/Questions.gif)

### Lectures from specialists in the field

- Together with regular lectures, a few specialists in the field, i.e. scientist carrying out researches by time-domain tools and techniques, are invited to describe their works.

![Nilus](Pics/Nilus.jpg)

### Language

- According to university guidelines, lectures will be delivered in English. Of course, a fair evaluation of the context might ask some flexibility.

![Language](Pics/language.jpg)

### Statistical framework

- During this course we are going to work in a Bayesian framework.

- Bayesian statistics is an approach to inferential statistics based on Bayes' theorem, where available knowledge about parameters in a statistical model is updated with the information in observed data. The background knowledge is expressed as a prior distribution and combined with observational data in the form of a likelihood function to determine the posterior distribution. The posterior can also be used for making predictions about future events.

- Nevertheless, we are not dogmatic and mentions or applications based on familiar "frequentist" approaches are presenetd and discussed, when we deem it opportune.
- Nevertheless, we are not dogmatic and mentions or applications based on familiar "frequentist" approaches are preseneted and discussed, when we deem it opportune.

![Statistics](Pics/Bayesians.png)

### Programming languages

- Most of the examples we are going to analyze during the course are based on some sort of computer analysis.

- `Python` is *de-facto* the standard language in data science.
    - Yet, while this language is definitely truly amazing, well designed and worth mastering, for the specific needs of scientific computing there are alternatives of growing popularity.

- We threfore will also provide examples with `Julia`, and encourage the students to get some confidence with this programming language too.

- Notebooks are written by the [markdown language](https://www.markdownguide.org/basic-syntax/), a simple language integrating features of the HTML and latex languages.


|![python](Pics/python.png)|![julia](Pics/julia.png)|
|--------------------------|------------------------|

%% Cell type:markdown id:9bf3b78e tags:

## Warning! The course is not only for astrophysicists!

- It is indeed part of the set of courses for future astrophysocsts. Nevertheles, almost nothing we are going to discuss is truly only for astrophysics. In reality, several applications and ideas are taken from other fields, i.e. economics, social sciences, climatology, etc.

![Physicists and astrophysicists](Pics/astrophysics.jpg)

%% Cell type:markdown id:dedc01e8 tags:

## Final assessment

- The final examination is an oral one.

- *Students* must interact with the teacher in advance of the examination and a science case obtained by the modern literature will be selected.

- The *student* will be asked to properly describe the main formal aspects of the study and discuss critically the reliability and limits of the presented results.


%% Cell type:markdown id:6e9e2d08 tags:

## Gitlab repository

- Slides, notebooks, papers, etc. are available on [gitlab](https://www.ict.inaf.it/gitlab/stefano.covino/TimeDomainAstrophysics.git)
- Check the repository frequently since is (rather often) updated  during the course.


|![gitlab](Pics/gitlab.jpg)|![course](Pics/gitlabcourse.png)|
|-------------------------|-------------------------------|

%% Cell type:markdown id:e96ac78c tags:

## Relaxing time(-series...)

![Relax](Pics/relaxing.png)

%% Cell type:markdown id:ffe137ba tags:

## Reference & Material

- The course is based on published scientific papers distributed by the teacher before any main topic is addressed.

- Science cases are based on actual scientific papers as well.

- Slides prepared by the teacher will also be distributed.

    - A general introductory text to time series analysis as: [“Introduction to Time Series and Forecasting”, by P.J. Brockwell and R.A Davis](https://link.springer.com/book/10.1007/978-3-319-29854-2) might be useful. However, any other analogous text easily obtainable by the student will be fine as well.

- Two textbooks more strictly related to the topics discussed during the course mainly, but not only, for astrophysical applications are:
    - [“Modern Statistical Methods for Astronomy”, by E.D. Feigelson and G.J. Babu](https://www.cambridge.org/core/books/modern-statistical-methods-for-astronomy/941AE392A553D68DD7B02491BB66DDEC)
    - [“Statistics, data Mining and Machine Learning in Astronomy”, by Ivezić et al.](https://press.princeton.edu/books/hardcover/9780691198309/statistics-data-mining-and-machine-learning-in-astronomy)

%% Cell type:markdown id:dff2c952 tags:

## Further Material

Papers for examining more closely some of the discussed topics.

- [Voughan et al. (2013) - "Random Time Series in Astronomy"](https://royalsocietypublishing.org/doi/10.1098/rsta.2011.0549)

%% Cell type:markdown id:05e93b1d tags:

## Course Flow

<table>
  <tr>
    <td>Previous lecture</td>
    <td>Next lecture</td>
  </tr>
  <tr>
    <td><a href="../../Course.ipynb">Course Summary</a></td>
    <td><a href="../Lecture%20-%20Statistics%20Reminder/Lecture-StatisticsReminder.ipynb">Statistics Reminder</a></td>
  </tr>
 </table>


%% Cell type:markdown id:591bd355 tags:

**Copyright**

This notebook is provided as [Open Educational Resource](https://en.wikipedia.org/wiki/Open_educational_resources). Feel free to use the notebook for your own purposes. The text is licensed under [Creative Commons Attribution 4.0](https://creativecommons.org/licenses/by/4.0/), the code of the examples, unless obtained from other properly quoted sources, under the [MIT license](https://opensource.org/licenses/MIT). Please attribute the work as follows: *Stefano Covino, Time Domain Astrophysics - Lecture notes featuring computational examples, 2025*.

%% Cell type:code id:a733e6fe tags:

``` julia
```
+611 −0

File added.

Preview size limit exceeded, changes collapsed.

+268 −0

File added.

Preview size limit exceeded, changes collapsed.

+214 −0
Original line number Diff line number Diff line
### A Pluto.jl notebook ###
# v0.20.4

using Markdown
using InteractiveUtils

# ╔═╡ dfdaa2c2-58bc-4911-8e3b-de854e5d56fa
import Pkg; Pkg.activate(".")

# ╔═╡ f419b967-f090-4f5a-9db7-3f9f1a80f8bb
begin
	using CairoMakie
	using CommonMark
	using PlutoUI
end

# ╔═╡ d0fdd5a1-5989-471c-86f4-4516645331e6
md"""
**What is this?**


*This jupyter notebook is part of a collection of notebooks on various topics discussed during the Time Domain Astrophysics course delivered by Stefano Covino at the [Università dell'Insubria](https://www.uninsubria.eu/) in Como (Italy). Please direct questions and suggestions to [stefano.covino@inaf.it](mailto:stefano.covino@inaf.it).*
"""

# ╔═╡ 8eac6af6-0e5c-43c7-8781-e97b02d3813f
md"""
**This is a `julia` notebook**
"""

# ╔═╡ b67d9fd5-435e-4150-902e-e6915efdbeaa
Pkg.instantiate()

# ╔═╡ d34ab604-27fa-4877-a8e1-d17bb8fb026f
# ╠═╡ show_logs = false
md"""
$(LocalResource("Pics/TimeDomainBanner.jpg"))
"""

# ╔═╡ 48232ae4-81b0-4cf4-80a9-1a0085ba8d9f
md"""
# A few important Fourier Transform
***

## The rectangular function
***

- We want to compute the FT of the rectangular function: e.g. a function $g(t)$ with a given amplitude and extending from $t=-T/2$ to $t=T/2$. For $|t|>T/2$, $g(t)=0$.
  
- We will write the square pulse or box function as $rect_T(t)$, indicating that the rectangle function is equal to 1 for a period of $T$ (from $-T/2$ to $+T/2$) and 0 elsewhere,
"""

# ╔═╡ e5b7c371-b30d-44d3-8ee9-f347719ba366
md"""
 ```math
\mathfrak{F} \{  g(t) \} = G(f) = \int_{-\infty}^\infty g(t) e^{-2 \pi i f t} dt = \int_{-T/2}^{T/2} A e^{-2 \pi i f t} dt = \frac{A}{-2 \pi i f} e^{-2 \pi i f t}\Big|_{-T/2}^{T/2} = \frac{A}{-2 \pi i f} [ e^{-\pi i f T} - e^{\pi i f T} ] = 
```

```math
= \frac{AT}{\pi f T} \frac{ e^{-\pi i f T} - e^{\pi i f T} }{2i} = \frac{AT}{\pi f T} \sin (\pi f T) \equiv AT {\rm sinc} (fT)
```

 - where we have defined the "sinc" function defined as ${\rm sinc} (t) = \sin(\pi t) / \pi t$.
"""

# ╔═╡ fc298404-78c0-49b9-8250-091dbc2b7487
begin
	T=2.
	
	#f(x) = (x >= -T/2 && x <= T/2) ? 1 : 0
	
	function f(x; T=2)
	    if x >= -T/2 && x <= T/2
	        return 1
	    else
	        return 0
	    end
	end
	
	xrng = range(start=-5.,stop=5.,step=0.01)
	
	
	fg1 = Figure(size=(1000,500))
	
	ax1 = Axis(fg1[1, 1],
	    xlabel = "t",
	    )
	
	T=1
	lines!(xrng,map(x -> f(x;T=T),xrng),label="T = "*string(T))
	T=3
	lines!(xrng,map(x -> f(x;T=3),xrng),label="T = "*string(T))
	
	
	axislegend()
	
	
	frng = range(start=-10.,stop=10.,step=0.01)
	
	
	ax2 = Axis(fg1[1, 2],
	    xlabel = "f",
	    )
	
	T=1
	lines!(frng,T*sinc.(T*frng),label="T = "*string(T))
	T=3
	lines!(frng,T*sinc.(T*frng),label="T = "*string(T))
	
	xlims!(-5,5)
	
	axislegend()
	
	fg1
end

# ╔═╡ 9b5f3662-37da-4e19-a4a3-a80dbbfb041a
cm"""
## The Gaussian function
***

- We want now to compute the FT of the Gaussian function: ``g(t) = e^{-\pi t^2}``.

- Let G(f) be the Fourier Transform of g(t), so that:


```math
G(f) = \mathfrak{F} \{  g(t) \} = \int_{-\infty}^\infty g(t) e^{-2 \pi i f t} dt = \int_{-\infty}^\infty e^{-\pi t^2} e^{-2 \pi i f t} dt
```

- Take the derivative of both sides of equation with respect to f, so that:

```math
\frac{dG(f)}{dt} = \int_{-\infty}^\infty e^{- \pi t^2} (-2 i \pi t) e^{-2 \pi i f t} dt
```

- Writing ``u = e^{-2 \pi i f t}  \rightarrow du = (-2 \pi i f)e^{-2 \pi i f t} dt`` and ``v = i e^{-\pi t^2} \rightarrow dv = -2 \pi i t e^{-\pi t^2} dt ``, and given the formula for integration by parts: ``\int udv = uv - \int vdu`` we have (the uv term becomes zero, because the limits are evaluated from ``-\infty`` to ``\infty``, where the product is zero):

```math
\frac{dG(f)}{dt} = \int_{-\infty}^\infty ie^{- \pi t^2} (-2 i \pi f) e^{-2 \pi i f t} dt = -2 \pi f \int_{-\infty}^\infty e^{- \pi t^2} e^{-2 \pi i f t} dt = -2 \pi f G(t)
```

- This is a first order simple differential equation for ``G(f)``. The solution for this differential equation is given by:

```math
G(f) = G(0) e^{-\pi f^2} 
```

- All we need to do now to find ``G(f)`` is figure out what ``G(0)`` is.
- ``G(0)`` is simply the average value of ``g(t)``, because if you substitute ``f=0`` into the equation for ``G(f)`` the complex exponential term goes away.
    - The integral has actually an [elegant solution](https://en.wikipedia.org/wiki/Gaussian_integral). The result is:
 
```math
G(0) = \int_{-\infty}^\infty e^{-\pi t^2} dt = 1
```

- Therefore:

```math
G(f) = \mathfrak{F} \{  g(t) \} = e^{-\pi f^2} 
```
"""

# ╔═╡ 4a49d01f-0138-4ecd-b5af-a9328cfcbd5c
md"""
### Credits
***

This notebook contains material obtained by [https://towardsdatascience.com/a-proof-of-the-central-limit-theorem-8be40324da83](https://towardsdatascience.com/a-proof-of-the-central-limit-theorem-8be40324da83).
"""

# ╔═╡ 9ed9be7b-e2cc-40a0-a4e1-1298a71a8cc3
cm"""
## Course Flow
***

<table>
  <tr>
    <td>Previous lecture</td>
    <td>Next lecture</td>
  </tr>
  <tr>
      <td><a href="./open?path=Lectures/Lecture - Spectral Analysis/Lecture-SpectralAnalysis.jl">Spectral analysis</a></td>
    <td><a href="./open?path=Lectures/Lecture - Spectral Analysis/Lecture-SpectralAnalysis.jl">Spectral analysis</a></td>
  </tr>
 </table>


"""

# ╔═╡ 72a28ae9-0fda-4f87-bf1c-e7e133ceec30
md"""
**Copyright**

This notebook is provided as [Open Educational Resource](https://en.wikipedia.org/wiki/Open_educational_resources). Feel free to use the notebook for your own purposes. The text is licensed under [Creative Commons Attribution 4.0](https://creativecommons.org/licenses/by/4.0/), the code of the examples, unless obtained from other properly quoted sources, under the [MIT license](https://opensource.org/licenses/MIT). Please attribute the work as follows: *Stefano Covino, Time Domain Astrophysics - Lecture notes featuring computational examples, 2025*.
"""

# ╔═╡ 7b6c4bfd-786a-40b1-bdd3-eb4570f7d1aa


# ╔═╡ Cell order:
# ╟─d0fdd5a1-5989-471c-86f4-4516645331e6
# ╟─8eac6af6-0e5c-43c7-8781-e97b02d3813f
# ╠═dfdaa2c2-58bc-4911-8e3b-de854e5d56fa
# ╠═b67d9fd5-435e-4150-902e-e6915efdbeaa
# ╠═f419b967-f090-4f5a-9db7-3f9f1a80f8bb
# ╟─d34ab604-27fa-4877-a8e1-d17bb8fb026f
# ╟─48232ae4-81b0-4cf4-80a9-1a0085ba8d9f
# ╟─e5b7c371-b30d-44d3-8ee9-f347719ba366
# ╠═fc298404-78c0-49b9-8250-091dbc2b7487
# ╟─9b5f3662-37da-4e19-a4a3-a80dbbfb041a
# ╟─4a49d01f-0138-4ecd-b5af-a9328cfcbd5c
# ╟─9ed9be7b-e2cc-40a0-a4e1-1298a71a8cc3
# ╟─72a28ae9-0fda-4f87-bf1c-e7e133ceec30
# ╠═7b6c4bfd-786a-40b1-bdd3-eb4570f7d1aa
Loading