From 4e2e0b40324115e3738774877e58463eaebdfbcd Mon Sep 17 00:00:00 2001
From: abhro <5664668+abhro@users.noreply.github.com>
Date: Mon, 1 Jun 2026 11:53:07 -0400
Subject: [PATCH] Retab files
---
src/tutorials/dust-extinction.jl | 26 ++---
src/tutorials/fileio-asdf.jl | 8 +-
src/tutorials/fileio-fits_images.jl | 46 ++++----
src/tutorials/fileio-fits_tables.jl | 74 ++++++-------
src/tutorials/models-1_linear_fitting.jl | 46 ++++----
src/tutorials/models-2_user_defined_model.jl | 20 ++--
src/tutorials/spectroscopy-sdss.jl | 20 ++--
src/tutorials/units.jl | 110 +++++++++----------
8 files changed, 175 insertions(+), 175 deletions(-)
diff --git a/src/tutorials/dust-extinction.jl b/src/tutorials/dust-extinction.jl
index 29044e9..ab667a3 100644
--- a/src/tutorials/dust-extinction.jl
+++ b/src/tutorials/dust-extinction.jl
@@ -95,7 +95,7 @@ md"""
# ╔═╡ ed46db90-9802-4615-928f-bcad4bd19804
md"""
!!! todo
- Add DQ support to DustExtinction.jl
+ Add DQ support to DustExtinction.jl
"""
# ╔═╡ 0250218a-6670-483f-8122-045ca65d28e4
@@ -143,7 +143,7 @@ md"""
### MAST IUE Spectrum
!!! note
- For more on querying MAST's TAP service, see:
+ For more on querying MAST's TAP service, see:
"""
# ╔═╡ d57bbe7f-b21a-479a-8249-a96d6aac3e95
@@ -154,8 +154,8 @@ df_spectra = execute(
FROM ivoa.ObsCore
WHERE target_name = 'HD 147933'
AND CONTAINS(
- POINT('ICRS', s_ra, s_dec),
- CIRCLE('ICRS', 246.396, -23.447, .00028)
+ POINT('ICRS', s_ra, s_dec),
+ CIRCLE('ICRS', 246.396, -23.447, .00028)
) = 1
AND dataproduct_type = 'spectrum'
"""
@@ -199,7 +199,7 @@ io = decompress_gz_to_iobuffer(fpath)
# ╔═╡ 216027cd-7737-4056-9abc-d71c899f7568
md"""
!!! todo
- Move decompression bit to FITSFiles.jl? Does something like this already exist in Base somewhere?
+ Move decompression bit to FITSFiles.jl? Does something like this already exist in Base somewhere?
"""
# ╔═╡ 904a9095-e2a2-4c3e-8070-719033a5c6b3
@@ -287,7 +287,7 @@ flux_U0_nu, flux_B0_nu, flux_V0_nu = (1.81e-23, 4.26e-23, 3.64e-23) .* u"W/m^2/H
# ╔═╡ df87135d-59cb-4a2f-be9f-f76c4203c645
md"""
!!! note
- More photometric definitions here:
+ More photometric definitions here:
"""
# ╔═╡ 36f69f11-10d8-4d42-b587-2b885f497973
@@ -314,7 +314,7 @@ flux_phot = [
# ╔═╡ 637830ec-1b5a-4eaa-bb76-55acd3b08985
md"""
!!! note
- See [PhotometricFilters.jl](https://juliaastro.org/PhotometricFilters) for a comprehensive treatment of photometric filter curves.
+ See [PhotometricFilters.jl](https://juliaastro.org/PhotometricFilters) for a comprehensive treatment of photometric filter curves.
"""
# ╔═╡ e59fa830-195f-45fe-bdc0-b4a2b23cd8c4
@@ -445,16 +445,16 @@ _Original authors: Kristen Larson, Lia Corrales, Stephanie T. Douglas, Kelle Cru
_Original input from: Emir Karamehmetoglu, Pey Lian Lim, Karl Gordon, Kevin Covey_
!!! tip "Learning goals"
- - Investigate extinction curve shapes.
- - Deredden spectral energy distributions and spectra.
- - Calculate photometric extinction and reddening.
- - Calculate synthetic photometry for a dust-reddened star. (todo)
- - Convert from frequency to wavelength.
+ - Investigate extinction curve shapes.
+ - Deredden spectral energy distributions and spectra.
+ - Calculate photometric extinction and reddening.
+ - Calculate synthetic photometry for a dust-reddened star. (todo)
+ - Convert from frequency to wavelength.
$(keywords())
!!! warning "Companion content"
- Content here.
+ Content here.
"""
# ╔═╡ Cell order:
diff --git a/src/tutorials/fileio-asdf.jl b/src/tutorials/fileio-asdf.jl
index 50f5897..e92ce28 100644
--- a/src/tutorials/fileio-asdf.jl
+++ b/src/tutorials/fileio-asdf.jl
@@ -69,14 +69,14 @@ md"""
# Working with ASDF files
!!! tip "Learning goals"
- - Goal 1
- - Goal 2
- - Goal 3
+ - Goal 1
+ - Goal 2
+ - Goal 3
$(keywords())
!!! warning "Companion content"
- Content here.
+ Content here.
"""
# ╔═╡ 00000000-0000-0000-0000-000000000001
diff --git a/src/tutorials/fileio-fits_images.jl b/src/tutorials/fileio-fits_images.jl
index 1432621..ef0fd83 100644
--- a/src/tutorials/fileio-fits_images.jl
+++ b/src/tutorials/fileio-fits_images.jl
@@ -75,7 +75,7 @@ end
# ╔═╡ ae04bf64-0ea2-4da2-b6ae-a86f11a786b8
md"""
!!! note
- We use the mutating version of `@rsubset` (note the exclamation mark above) because we do not need to preserve the original `DataFrame`, `df_evt`, in this case. For more on mutating functions, see [this section](https://docs.julialang.org/en/v1/manual/variables/#man-assignment-expressions) of the Julia manual.
+ We use the mutating version of `@rsubset` (note the exclamation mark above) because we do not need to preserve the original `DataFrame`, `df_evt`, in this case. For more on mutating functions, see [this section](https://docs.julialang.org/en/v1/manual/variables/#man-assignment-expressions) of the Julia manual.
We next look at a few different ways that we can visualize the 2D histogram that we roughly previewed in the previous tutorial; from explicit (less convenient) to implicit (more convenient).
"""
@@ -88,7 +88,7 @@ md"""
[^1]: This package currently uses [FITSIO.jl](https://juliaastro.org/FITSIO/), a convenience wrapper around a second wrapper, [CFITSIO.jl](http://juliaastro.org/CFITSIO/), which wraps the [CFITSIO C library](https://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html) for FITS file I/O. Currently, FITSIO.jl cannot handle opening tables containing BitArray data.
- On the horizon, AstroImages.jl will use [FITSFiles.jl](https://barrettp.github.io/FITSFiles.jl/dev/) as its backend, the pure-Julia alternative currently being developed by JuliaAstro, which can handle this type of data. This is why we used it directly in the previous tutorial. Stay tuned for more!
+On the horizon, AstroImages.jl will use [FITSFiles.jl](https://barrettp.github.io/FITSFiles.jl/dev/) as its backend, the pure-Julia alternative currently being developed by JuliaAstro, which can handle this type of data. This is why we used it directly in the previous tutorial. Stay tuned for more!
"""
# ╔═╡ c04d7668-32ff-4131-8796-007d1637f56f
@@ -119,7 +119,7 @@ md"""
We can immediately see structure appear in our image, and the outlines of the four main (ACIS-I) chips. Try adjusting the imaging options commented out above to modify the image. See the `imview` documentation in the Live docs of this notebook for all available options.
!!! tip
- Try passing your own AbstractArray to `imview`. This function converts an array of numbers to an array of `ColorTypes` (i.e., RGB values) for visualizing our arrays in full color. For more on this, see the [Arrays, Numbers, and Colors](https://juliaimages.org/latest/tutorials/arrays_colors/#page_arrays_colors) section of the JuliaImages documentation.
+ Try passing your own AbstractArray to `imview`. This function converts an array of numbers to an array of `ColorTypes` (i.e., RGB values) for visualizing our arrays in full color. For more on this, see the [Arrays, Numbers, and Colors](https://juliaimages.org/latest/tutorials/arrays_colors/#page_arrays_colors) section of the JuliaImages documentation.
"""
# ╔═╡ d031ddf9-ee84-46b2-b387-1ec99a2ca79b
@@ -161,7 +161,7 @@ end
# ╔═╡ 74f155a2-fe8a-404f-b0c6-7a4f2724c408
md"""
!!! tip
- Try adjusting the plot options above, or try adding your own! See the [Getting started](https://docs.makie.org/stable/tutorials/getting-started) section of the Makie.jl documentation for a comprehensive tutorial.
+ Try adjusting the plot options above, or try adding your own! See the [Getting started](https://docs.makie.org/stable/tutorials/getting-started) section of the Makie.jl documentation for a comprehensive tutorial.
You may notice that there are still a few things missing from our plot that would be nice to have by default, e.g., labeled axes and a formatted colorbar. We will show an ergonomic way to do this next.
"""
@@ -198,7 +198,7 @@ Here, we reproduce the previous plot above, but now with the desired axes labeli
Additionally, note that we are working directly with the DataFrame object `df_evt-main` now instead of needing to manually fit a histogram beforehand.
!!! tip
- See this very nice [tutorial series](https://aog.makie.org/stable/tutorials/intro-i) in the AlgebraOfGraphics.jl documentation for more.
+ See this very nice [tutorial series](https://aog.makie.org/stable/tutorials/intro-i) in the AlgebraOfGraphics.jl documentation for more.
We now turn to working directly with FITS image data.
"""
@@ -238,7 +238,7 @@ md"""
We see that our image is an $(size(img_data, 1)) × $(size(img_data, 2)) array of $(eltype(img_data)) data. This can be visualized in the same way as our previous heatmap example, which we will show next.
!!! tip "Todo"
- We use the `scale = false` keyword in our `fits` call to preserve the original data type specified in the `BITPIX` header card. For more, see .
+ We use the `scale = false` keyword in our `fits` call to preserve the original data type specified in the `BITPIX` header card. For more, see .
"""
# ╔═╡ b3c6961a-b8a6-4597-aaf7-a97cae793670
@@ -373,19 +373,19 @@ end
# ╔═╡ 215e0183-adfa-4da0-80d7-108894f73f23
md"""
!!! tip
- This is just an alternative syntax to array comprehensions. We could have just as easily done:
-
- ```julia
- [
- @sprintf(
- "http://data.astropy.org/tutorials/FITS-images/M13_blue_%04d.fits",
- i
- )
- for i in 1:5
- ]
- ```
-
- See [this section of the Julia manual](https://docs.julialang.org/en/v1/manual/functions/#Do-Block-Syntax-for-Function-Arguments) for more on do-block syntax.
+ This is just an alternative syntax to array comprehensions. We could have just as easily done:
+
+ ```julia
+ [
+ @sprintf(
+ "http://data.astropy.org/tutorials/FITS-images/M13_blue_%04d.fits",
+ i
+ )
+ for i in 1:5
+ ]
+ ```
+
+ See [this section of the Julia manual](https://docs.julialang.org/en/v1/manual/functions/#Do-Block-Syntax-for-Function-Arguments) for more on do-block syntax.
"""
# ╔═╡ 4dc4074e-b3d3-4deb-a657-8a7847a8c156
@@ -459,14 +459,14 @@ This notebook is modified from Working with FITS tables](/tutorials/fits-tables/)
+ [learn.JuliaAstro > Working with FITS tables](/tutorials/fits-tables/)
"""
# ╔═╡ 00000000-0000-0000-0000-000000000001
diff --git a/src/tutorials/fileio-fits_tables.jl b/src/tutorials/fileio-fits_tables.jl
index a68879f..f8720d0 100644
--- a/src/tutorials/fileio-fits_tables.jl
+++ b/src/tutorials/fileio-fits_tables.jl
@@ -68,10 +68,10 @@ hdus = fits(event_filename)
# ╔═╡ a577f6a1-00e4-4fa1-9030-a14ca1ebefc6
"""
!!! note
- For convenience, FITS files opened from a local directory, e.g., `$(event_filename)`, are automatically closed for us.
+ For convenience, FITS files opened from a local directory, e.g., `$(event_filename)`, are automatically closed for us.
!!! todo
- Include HDUNAME and/or EXTNAME column(s) in displayed `info`?
+ Include HDUNAME and/or EXTNAME column(s) in displayed `info`?
""" |> Markdown.parse
# ╔═╡ 2a907d46-51d5-4232-a737-6d19aab073c4
@@ -85,33 +85,33 @@ hdus[2].data |> keys
# ╔═╡ fe27a708-66d3-4f91-abe1-ce0135d04879
md"""
!!! todo
- Define a function for this? e.g.,
-
- ```julia
- function FITSFiles.names(hdu::FITSFiles.HDU{FITSFiles.Bintable})
-
-
-
- return (
- (name = "", format = "", ...), # col1
- (name = "", format = "", unit = "") # col2
- ...
- (name = "", format = "", coord_type = "") # colN
- )
- end
- ```
-
- Analogous to hdu.columns in astropy:
-
- ```
- ColDefs(
- name = 'time'; format = '1D'; unit = 's'
- name = 'ccd_id'; format = '1I'
- name = 'node_id'; format = '1I'
- name = 'expno'; format = '1J'
- ...
- )
- ```
+ Define a function for this? e.g.,
+
+ ```julia
+ function FITSFiles.names(hdu::FITSFiles.HDU{FITSFiles.Bintable})
+
+
+
+ return (
+ (name = "", format = "", ...), # col1
+ (name = "", format = "", unit = "") # col2
+ ...
+ (name = "", format = "", coord_type = "") # colN
+ )
+ end
+ ```
+
+ Analogous to hdu.columns in astropy:
+
+ ```
+ ColDefs(
+ name = 'time'; format = '1D'; unit = 's'
+ name = 'ccd_id'; format = '1I'
+ name = 'node_id'; format = '1I'
+ name = 'expno'; format = '1J'
+ ...
+ )
+ ```
"""
# ╔═╡ 2497c869-17e4-4f5f-9534-30beab70a8ad
@@ -125,7 +125,7 @@ df_evt = DataFrame(hdus[2].data)
# ╔═╡ 8ec6647e-b58e-4d9c-9ddf-97cca6da4d75
md"""
!!! note
- For people coming from other languages, this [comparison page](https://dataframes.juliadata.org/stable/man/comparisons/#Comparisons) in the DataFrames.jl documentation may be helpful.
+ For people coming from other languages, this [comparison page](https://dataframes.juliadata.org/stable/man/comparisons/#Comparisons) in the DataFrames.jl documentation may be helpful.
While it's possible to access FITS tables directly from the `.data` attribute, wrapping it in a `DataFrame` tends to make a variety of common tasks more convenient; for example, subsetting and directly plotting data, as we will show next.
"""
@@ -143,7 +143,7 @@ plot(df_evt; x = :energy, kind = :histogram, nbinsx = 80)
# ╔═╡ b07413d3-7c29-4f9d-8be6-7bc5118e186d
md"""
!!! tip
- We are using the small [PlutoPlotly.jl](https://github.com/JuliaPluto/PlutoPlotly.jl) package for easy interactivity in this notebook format. For publication quality plots with a wide range of analysis and customizations, see the modern [Makie.jl](https://makie.org) plotting package, which powers the [AlgebraOfGraphics.jl](https://aog.makie.org/stable/) framework for visualizing structured data. We will show examples of its use in our [Working with FITS images](/tutorials/fits-images/) tutorial.
+ We are using the small [PlutoPlotly.jl](https://github.com/JuliaPluto/PlutoPlotly.jl) package for easy interactivity in this notebook format. For publication quality plots with a wide range of analysis and customizations, see the modern [Makie.jl](https://makie.org) plotting package, which powers the [AlgebraOfGraphics.jl](https://aog.makie.org/stable/) framework for visualizing structured data. We will show examples of its use in our [Working with FITS images](/tutorials/fits-images/) tutorial.
"""
# ╔═╡ 66629892-ce42-44a9-9a36-6582545bda8e
@@ -159,9 +159,9 @@ df_evt_main = @rsubset df_evt :ccd_id ∈ 0:3
# ╔═╡ 831e74cd-fc5f-4e8b-862b-898cd7262596
md"""
!!! note
- We use the `@rsubset` convenience macro exported from DataFramesMeta.jl to select the desired rows from our table, in this case the rows where the `ccd_id` are equal to either 0, 1, 2, or 3. For more on working with `DataFrames` and using other convenience macros, see the [DataFrames.jl](https://dataframes.juliadata.org/) and [DataFramesMeta.jl](https://juliadata.org/DataFramesMeta.jl/) documentation.
+ We use the `@rsubset` convenience macro exported from DataFramesMeta.jl to select the desired rows from our table, in this case the rows where the `ccd_id` are equal to either 0, 1, 2, or 3. For more on working with `DataFrames` and using other convenience macros, see the [DataFrames.jl](https://dataframes.juliadata.org/) and [DataFramesMeta.jl](https://juliadata.org/DataFramesMeta.jl/) documentation.
- In particular, people coming from other languages may find this [short comparison table](https://juliadata.org/DataFramesMeta.jl/stable/#Comparison-with-dplyr-and-LINQ) of convenience macros in the DataFramesMeta.jl documentation helpful.
+ In particular, people coming from other languages may find this [short comparison table](https://juliadata.org/DataFramesMeta.jl/stable/#Comparison-with-dplyr-and-LINQ) of convenience macros in the DataFramesMeta.jl documentation helpful.
"""
# ╔═╡ 2e1b6a9c-5005-4862-96e6-1ab1fa253509
@@ -207,14 +207,14 @@ This notebook is modified from )
- ```
+ set_theme!()
+ ```
- See [this section](https://docs.makie.org/stable/explanations/theming/themes) of the Makie.jl documentation for more on theming, and [this tutorial](https://aog.makie.org/stable/tutorials/intro-i) for more on getting started with AoG.
+ See [this section](https://docs.makie.org/stable/explanations/theming/themes) of the Makie.jl documentation for more on theming, and [this tutorial](https://aog.makie.org/stable/tutorials/intro-i) for more on getting started with AoG.
"""
# ╔═╡ 6ef287bb-7b3f-4fbc-aa24-2b317a22b6f9
@@ -159,8 +159,8 @@ Much better! Besides some minor styling instructions given from our end, the ent
```julia
# Linear model
layer_model = layer_scatter *
- mapping(weights = :Ks_err) *
- linear(; weightkind = aweights, weighttransform = x -> inv.(x .^ 2))
+ mapping(weights = :Ks_err) *
+ linear(; weightkind = aweights, weighttransform = x -> inv.(x .^ 2))
```
We'll next take a look under the hood to see how these calculations were performed.
@@ -169,7 +169,7 @@ We'll next take a look under the hood to see how these calculations were perform
# ╔═╡ 4e69c1de-6cf0-448b-8b95-5b6c54795820
md"""
!!! note
- For more on different statistical weightings used in the Julia ecosystem, see [this section](https://juliastats.org/StatsBase.jl/stable/weights/#AnalyticWeights) of the StatsBase.jl documentation.
+ For more on different statistical weightings used in the Julia ecosystem, see [this section](https://juliastats.org/StatsBase.jl/stable/weights/#AnalyticWeights) of the StatsBase.jl documentation.
"""
# ╔═╡ 35f8675d-d8f0-47b0-83b6-156bb75d373d
@@ -180,8 +180,8 @@ At its core, we are essentially solving the following [linear algebra equation](
```math
\mathbf{
- \left( X^\textsf{T} W X \right) \boldsymbol{\hat\beta} =
- X^\textsf{T} W y\
+ \left( X^\textsf{T} W X \right) \boldsymbol{\hat\beta} =
+ X^\textsf{T} W y\
}\ ,
```
@@ -224,7 +224,7 @@ end;
# ╔═╡ 19df3403-ef9d-4b07-8b14-3b10056475e8
md"""
!!! todo
- Current workaround for
+ Current workaround for
"""
# ╔═╡ 4a17877a-6a38-4364-9bd9-91dde011a42a
@@ -233,13 +233,13 @@ fit_glm = glm(@formula(Ks ~ log_P), df_glm, Normal(); wts = aweights(inv.(df_glm
# ╔═╡ 816426f9-0511-4dde-9ec4-7c9ccb212a45
md"""
!!! note
- See the [GLM.jl documentation](https://juliastats.org/GLM.jl/stable/) for more.
+ See the [GLM.jl documentation](https://juliastats.org/GLM.jl/stable/) for more.
"""
# ╔═╡ 480d8ef0-42d7-4089-9da2-1543baa2d02b
md"""
!!! todo
- Rename wts to weights once this is in:
+ Rename wts to weights once this is in:
"""
# ╔═╡ 3b7eee06-f730-45d5-aae1-53b7731694d9
@@ -276,7 +276,7 @@ md"""
For completeness, we also show how we might accomplish this with Optimization.jl:
!!! note
- This is best suited for nonlinear problems, where the usual linear approximations for estimating confidence intervals we used before [do not hold](https://discourse.julialang.org/t/best-fit-parameter-error-bar-using-optimization-jl/103186/6). At this point, our standard confidence interval estimatation techniques above do not hold, and Bayesian approaches should be used instead. For example, see:
+ This is best suited for nonlinear problems, where the usual linear approximations for estimating confidence intervals we used before [do not hold](https://discourse.julialang.org/t/best-fit-parameter-error-bar-using-optimization-jl/103186/6). At this point, our standard confidence interval estimatation techniques above do not hold, and Bayesian approaches should be used instead. For example, see:
"""
# ╔═╡ e0e8909d-893f-4f35-baf2-c27dafeb23fa
@@ -365,7 +365,7 @@ end
# ╔═╡ 3ba10da3-1e3c-4b75-9c0c-5d1a2dd4af75
md"""
!!! note
- Note the repeated labeling, styling, and external statistical analysis that AoG saves us from needing to do by hand.
+ Note the repeated labeling, styling, and external statistical analysis that AoG saves us from needing to do by hand.
"""
# ╔═╡ b2805e96-5cce-4200-842b-931187007a31
@@ -394,18 +394,18 @@ This notebook is modified from Modeling 1: Linear model fitting](https://learn.juliaastro.org/tutorials/models-1_linear_fitting/)
+ [learn.JuliaAstro > Modeling 1: Linear model fitting](https://learn.juliaastro.org/tutorials/models-1_linear_fitting/)
"""
# ╔═╡ Cell order:
diff --git a/src/tutorials/spectroscopy-sdss.jl b/src/tutorials/spectroscopy-sdss.jl
index 608ec4e..3ebeb5b 100644
--- a/src/tutorials/spectroscopy-sdss.jl
+++ b/src/tutorials/spectroscopy-sdss.jl
@@ -150,10 +150,10 @@ md"""
We then can use Makie.jl to plot this spectrum directly:
!!! note
- We zoom in around the Hα line to better display the uncertainty band in the plot.
+ We zoom in around the Hα line to better display the uncertainty band in the plot.
!!! todo
- Upstream a SpectrumBase.jl recipe
+ Upstream a SpectrumBase.jl recipe
"""
# ╔═╡ 143e0860-0704-437e-b2d3-22f5298a9198
@@ -210,7 +210,7 @@ eq = ICRSCoords(deg2rad(178.90417), deg2rad(0.66278))
# ╔═╡ c8529662-9746-4d0f-bef5-796c33d09ac5
md"""
!!! warning
- Where did these coords come from? They don't seem to match from the header I think?
+ Where did these coords come from? They don't seem to match from the header I think?
"""
# ╔═╡ 6e6972a6-1648-40e4-a1e6-beed98bbc93e
@@ -331,7 +331,7 @@ Finally, for a source at redshift ``z``, the observed flux density is:
```math
F_\lambda^\text{obs}(\lambda_\text{obs}, z) =
- \frac{L_\lambda(\lambda_\text{rest})}{(1 + z) 4\pi d_L^2(z)}
+ \frac{L_\lambda(\lambda_\text{rest})}{(1 + z) 4\pi d_L^2(z)}
```
"""
@@ -416,17 +416,17 @@ begin
# $(title(_fm))
$(authors(_fm))
-
+
!!! tip "Learning goals"
- Compose multiple packages from the JuliaAstro ecosytem to analyze stellar spectra.
+ Compose multiple packages from the JuliaAstro ecosytem to analyze stellar spectra.
$(keywords(_fm))
!!! warning "Companion content"
- - JuliaAstro > FITS tables
- - JuliaAstro > Unit handling
- - JuliaAstro > Dust extinction
- - JuliaAstro > Cosmological redshift and age
+ - JuliaAstro > FITS tables
+ - JuliaAstro > Unit handling
+ - JuliaAstro > Dust extinction
+ - JuliaAstro > Cosmological redshift and age
"""
end
diff --git a/src/tutorials/units.jl b/src/tutorials/units.jl
index 5b33fd0..fec1f59 100644
--- a/src/tutorials/units.jl
+++ b/src/tutorials/units.jl
@@ -117,7 +117,7 @@ Reff_U |> U.u"km"
# ╔═╡ 984fcb2e-049b-4b35-a4b6-5c8c686921a3
md"""
!!! note "Symbolic units"
- Note the use of `us""` for DynamicQuantities.jl, which is required for working with [symbolic units](https://juliaphysics.github.io/DynamicQuantities.jl/stable/symbolic_units/). Will will leverage this later in the notebook to make working with angles more convenient.
+ Note the use of `us""` for DynamicQuantities.jl, which is required for working with [symbolic units](https://juliaphysics.github.io/DynamicQuantities.jl/stable/symbolic_units/). Will will leverage this later in the notebook to make working with angles more convenient.
"""
# ╔═╡ c5b4f340-c774-4f09-af4c-f326afce5de3
@@ -202,17 +202,17 @@ let
md"""
!!! warn "Exercise"
- Use Kepler's law in the form given below to determine the (circular) orbital speed of the Earth around the Sun in km/s:
+ Use Kepler's law in the form given below to determine the (circular) orbital speed of the Earth around the Sun in km/s:
- ```math
- v = \sqrt{\frac{G M_⊙}{r}}
- ```
+ ```math
+ v = \sqrt{\frac{G M_⊙}{r}}
+ ```
- There's a much easier way to figure out the velocity of the Earth using just two units or quantities. Do that and then compare to the Kepler's law answer (the easiest way is probably to compute the percentage difference, if any).
+ There's a much easier way to figure out the velocity of the Earth using just two units or quantities. Do that and then compare to the Kepler's law answer (the easiest way is probably to compute the percentage difference, if any).
- $(sol)
+ $(sol)
- Completely optional, but a good way to convince ourselves of the value of DynamicQuantities.jl: Do the above calculations by hand. Look up all the appropriate conversion factors and use paper-and-pencil / basic approaches for keeping track of them all. Using Julia as a basic calculator is also fine. Which one took longer?
+ Completely optional, but a good way to convince ourselves of the value of DynamicQuantities.jl: Do the above calculations by hand. Look up all the appropriate conversion factors and use paper-and-pencil / basic approaches for keeping track of them all. Using Julia as a basic calculator is also fine. Which one took longer?
"""
end
@@ -299,7 +299,7 @@ end
# ╔═╡ e86d6cf7-2274-403a-b1db-017973f33fb7
md"""
!!! note
- The units of the exponential are dimensionless, so we multiplied the data cube by ``\mathrm{K}`` to get brightness temperature units. As an aside for experts, we're setting up our artificial cube on the main-beam temperature scale ``\left(T_\text{MB}\right)``, which is the closest we can normally get to the actual brightness temperature of our source.
+ The units of the exponential are dimensionless, so we multiplied the data cube by ``\mathrm{K}`` to get brightness temperature units. As an aside for experts, we're setting up our artificial cube on the main-beam temperature scale ``\left(T_\text{MB}\right)``, which is the closest we can normally get to the actual brightness temperature of our source.
"""
# ╔═╡ 1f6a0d6c-832b-474d-8fbf-a9de6e821d80
@@ -342,19 +342,19 @@ end
# ╔═╡ 4d4794fb-804d-4b4a-8c32-a32d88e43e30
md"""
!!! todo
- Improve `Base.sum` support for DQ. Discussion here:
+ Improve `Base.sum` support for DQ. Discussion here:
+
+ This works too, but is more verbose:
- This works too, but is more verbose:
-
- ```julia
- sum(A, dims = 3; init = zero(first(A)))[:, :, begin]
- ```
+ ```julia
+ sum(A, dims = 3; init = zero(first(A)))[:, :, begin]
+ ```
"""
# ╔═╡ 1fa8010d-9a5d-4297-9665-9fa8795ef5f7
md"""
!!! note
- Radio astronomers use a rather odd set of units ``[\mathrm{K\, km/s}]`` for integrated intensity (that is, summing all the emission from a line over velocity).
+ Radio astronomers use a rather odd set of units ``[\mathrm{K\, km/s}]`` for integrated intensity (that is, summing all the emission from a line over velocity).
"""
# ╔═╡ f2b222ec-0783-487e-9c52-835976a555b6
@@ -406,7 +406,7 @@ where ``T_\text{B}`` is the brightness temperature, and the constants ``C`` and
```math
\begin{align*}
C &= 3.0 \times {10}^{14}\ \mathrm{K^{-1}\, cm^{-2}\, km^{-1}\, s}
- \left(\frac{\nu}{\nu_{13}}\right)^2 \frac{A_{13}}{A} \\
+ \left(\frac{\nu}{\nu_{13}}\right)^2 \frac{A_{13}}{A} \\
B &= \frac{h\nu}{k_\text{B} T}
\end{align*}
```
@@ -435,7 +435,7 @@ B &= \frac{h\nu}{k_\text{B} T}
# ╔═╡ 0af912a5-18ad-4974-a0b5-c1f66c8fa37a
md"""
!!! note
- DynamicQuantities.jl does not have similar unit eqivalence functionality at this time because it is cheap to just roll our own conversions since the physical constants needed are already included in the package. For this reason, we just compute the ``c / λ`` relation directly.
+ DynamicQuantities.jl does not have similar unit eqivalence functionality at this time because it is cheap to just roll our own conversions since the physical constants needed are already included in the package. For this reason, we just compute the ``c / λ`` relation directly.
"""
# ╔═╡ 3a24f4aa-b074-4beb-b77d-6778e2fe580a
@@ -471,20 +471,20 @@ NCO_U = CC_U * intcloud_U / (1 - exp(-B_U))
# ╔═╡ 25598fcd-761d-40b8-95ac-8b68a00026da
md"""
!!! note ""
- **Peak CO Column density (DQ):** $(maximum(NCO_DQ))
+ **Peak CO Column density (DQ):** $(maximum(NCO_DQ))
"""
# ╔═╡ 336f8626-7b0c-459d-bedb-281d010fcbd2
md"""
!!! note ""
- **Peak CO Column density (U):** $(maximum(NCO_U))
+ **Peak CO Column density (U):** $(maximum(NCO_U))
"""
# ╔═╡ eba2f06f-ebe9-492d-81d2-1cc4fccd5b0a
md"""
### ``\mathrm{CO}`` to Total Mass
-We are using ``\mathrm{CO}`` as a tracer for the much more numerous ``\mathrm{H}_2``, the quantity we are actually trying to infer. Using the (known/assumed) ``\mathrm{H}_2 / \mathrm{CO}`` ratio:
+We are using ``\mathrm{CO}`` as a tracer for the much more numerous ``\mathrm{H}_2``, the quantity we are actually trying to infer. Using the (known/assumed) ``\mathrm{H}_2 / \mathrm{CO}`` ratio:
"""
# ╔═╡ de22c778-1529-4177-85e6-a0178f437a8c
@@ -499,13 +499,13 @@ NH₂_U = NCO_U * H₂_CO_ratio
# ╔═╡ 1e8ec5c5-3d41-44a7-8dfa-81d981750d9e
md"""
!!! note ""
- **Peak ``\mathrm{H}_2`` column density (DQ):** $(maximum(NH₂_DQ))
+ **Peak ``\mathrm{H}_2`` column density (DQ):** $(maximum(NH₂_DQ))
"""
# ╔═╡ dd22bc93-28bf-412e-a52b-d4332475daa2
md"""
!!! note ""
- **Peak ``\mathrm{H}_2`` column density (U):** $(maximum(NH₂_U))
+ **Peak ``\mathrm{H}_2`` column density (U):** $(maximum(NH₂_U))
"""
# ╔═╡ 522d88d6-5f60-401b-8786-0236c0859eda
@@ -541,7 +541,7 @@ end
# ╔═╡ 9c0862d0-8028-4ef4-a867-18c7932dad91
md"""
!!! tip
- To treat angles as physical units instead of as dimensionless, see [this relevant section](https://juliaphysics.github.io/DynamicQuantities.jl/stable/examples/#3.-Using-dimensional-angles) in the DynamicQuantities.jl documentation, and this extension package for Unitful.jl: [DimensionfulAngles.jl](https://github.com/cmichelenstrofer/DimensionfulAngles.jl).
+ To treat angles as physical units instead of as dimensionless, see [this relevant section](https://juliaphysics.github.io/DynamicQuantities.jl/stable/examples/#3.-Using-dimensional-angles) in the DynamicQuantities.jl documentation, and this extension package for Unitful.jl: [DimensionfulAngles.jl](https://github.com/cmichelenstrofer/DimensionfulAngles.jl).
"""
# ╔═╡ 88966b7e-b261-45a6-9f12-6b74f24c03e4
@@ -553,9 +553,9 @@ M_cloud_U = sum(ρ_U * Δa_U) |> U.u"Msun"
# ╔═╡ 802f5cad-a0c0-4426-94f2-426f89dea7e1
md"""
!!! tip "Exercises"
- The astro material was pretty heavy on that one, so let's focus on some associated statistics using DynamicQuantities.jl's array capabililities. Compute the median and mean of the data with the `mean` and `median` functions. Why are their values so different?
+ The astro material was pretty heavy on that one, so let's focus on some associated statistics using DynamicQuantities.jl's array capabililities. Compute the median and mean of the data with the `mean` and `median` functions. Why are their values so different?
- Similarly, compute the standard deviation and variance. Do they have the units you expect?
+ Similarly, compute the standard deviation and variance. Do they have the units you expect?
"""
# ╔═╡ 2eed0bc8-2306-42bb-9803-33ae131021e6
@@ -625,9 +625,9 @@ The funding agency is impressed at the resolution you achieved, and your instrum
# ╔═╡ 0c05c385-67bd-4078-8fe2-34a37a13b312
md"""
!!! note
- **DynamicQuantities.jl:** Note the use of `us""` instead of `u""`, both supplied by DynamicQuantities.jl, to achieve this behavior.
+ **DynamicQuantities.jl:** Note the use of `us""` instead of `u""`, both supplied by DynamicQuantities.jl, to achieve this behavior.
- **Unitful.jl:** Note the use of `ᵃ` supplied by DimensionfulAngles.jl instead of the base angle units provided by Unitful.jl to achieve this behavior.
+ **Unitful.jl:** Note the use of `ᵃ` supplied by DimensionfulAngles.jl instead of the base angle units provided by Unitful.jl to achieve this behavior.
"""
# ╔═╡ 7d4f9a02-81a7-4bdc-a22d-3435192f9f15
@@ -643,9 +643,9 @@ let
md"""
!!! tip "Exercises"
- Write a function that computes the Keplerian velocity you worked out in section 1 (using `Quantity` input and outputs, of course), but allowing for an arbitrary mass and orbital radius. Try it with some reasonable numbers for satellites orbiting the Earth, a moon of Jupiter, or an extrasolar planet. Feel free to use wikipedia or similar for the masses and distances.
+ Write a function that computes the Keplerian velocity you worked out in section 1 (using `Quantity` input and outputs, of course), but allowing for an arbitrary mass and orbital radius. Try it with some reasonable numbers for satellites orbiting the Earth, a moon of Jupiter, or an extrasolar planet. Feel free to use wikipedia or similar for the masses and distances.
- $(sol)
+ $(sol)
"""
end
@@ -724,19 +724,19 @@ md"""
Now for the actual mass calculation. If a galaxy is pressure-supported (for example, an elliptical or dwarf spheroidal galaxy), its mass within the stellar extent can be estimated using a straightforward formula: ``M_{1/2} = 4σ^2 R_\text{eff}/G``. There are caveats to the use of this formula for science -- see [Wolf et al. 2010](http://ui.adsabs.harvard.edu/abs/2010MNRAS.406.1220W/abstract) for details.
!!! note
- Constants [are included in DQ](https://juliaphysics.github.io/DynamicQuantities.jl/stable/constants/):
-
- ```julia
- using DynamicQuantities: Constants as C_DQ
- ```
-
- For demonstration purposes, we will actually be importing from `SymbolicConstants` instead. In practice, it is much more performant to work in the base SI system provided by `Constants`, and just convert to whatever units are desired in the end.
-
- For Unitful.jl, a separate package like [PhysicalConstants.jl for Unitful.jl](https://juliaphysics.github.io/PhysicalConstants.jl/stable/) is required:
-
- ```julia
- using PhysicalConstants: CODATA2018 as C_U
- ```
+ Constants [are included in DQ](https://juliaphysics.github.io/DynamicQuantities.jl/stable/constants/):
+
+ ```julia
+ using DynamicQuantities: Constants as C_DQ
+ ```
+
+ For demonstration purposes, we will actually be importing from `SymbolicConstants` instead. In practice, it is much more performant to work in the base SI system provided by `Constants`, and just convert to whatever units are desired in the end.
+
+ For Unitful.jl, a separate package like [PhysicalConstants.jl for Unitful.jl](https://juliaphysics.github.io/PhysicalConstants.jl/stable/) is required:
+
+ ```julia
+ using PhysicalConstants: CODATA2018 as C_U
+ ```
""" |> side_by_side
# ╔═╡ 0ab125c6-568b-414c-acaa-abcfebb559e2
@@ -828,7 +828,7 @@ Now we move on to calculate the constant ``B``. This is given by the ratio of ``
# ╔═╡ a0b64ba9-cbec-404e-bf39-aee03ae407ae
md"""
!!! note
- Note how DynamicQuantities.jl intelligently cancelled the units for us, while still keeping this as a `Quantity` object. For Unitful.jl, a conversion to `NoUnits` is needed. In practice, it is generally prefable to not worry about these intermediate units and just convert everything at the end.
+ Note how DynamicQuantities.jl intelligently cancelled the units for us, while still keeping this as a `Quantity` object. For Unitful.jl, a conversion to `NoUnits` is needed. In practice, it is generally prefable to not worry about these intermediate units and just convert everything at the end.
""" |> side_by_side
# ╔═╡ 6aff587f-be6f-4fd8-96df-9c12f3769f32
@@ -920,21 +920,21 @@ This notebook is modified from