Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/tutorials/dust-extinction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -143,7 +143,7 @@ md"""
### MAST IUE Spectrum

!!! note
For more on querying MAST's TAP service, see: <https://mast.stsci.edu/vo-tap/>
For more on querying MAST's TAP service, see: <https://mast.stsci.edu/vo-tap/>
"""

# ╔═╡ d57bbe7f-b21a-479a-8249-a96d6aac3e95
Expand All @@ -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'
"""
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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: <https://ned.ipac.caltech.edu/help/photoband.lst>
More photometric definitions here: <https://ned.ipac.caltech.edu/help/photoband.lst>
"""

# ╔═╡ 36f69f11-10d8-4d42-b587-2b885f497973
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions src/tutorials/fileio-asdf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
46 changes: 23 additions & 23 deletions src/tutorials/fileio-fits_images.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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).
"""
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
"""
Expand Down Expand Up @@ -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.
"""
Expand Down Expand Up @@ -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 <documentation coming soon>.
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 <documentation coming soon>.
"""

# ╔═╡ b3c6961a-b8a6-4597-aaf7-a97cae793670
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -459,14 +459,14 @@ This notebook is modified from <https://learn.astropy.org/tutorials/FITS-images.
_Original authors: Lia Corrales, Kris Stern, Stephanie T. Douglas, Kelle Cruz, Lúthien Liu, Zihao Chen, Saima Siddiqui_

!!! tip "Learning goals"
- Customize a 2D histogram with image data.
- Stack several images into a single image (Todo).
- Write image data to a FITS file (Todo).
- Customize a 2D histogram with image data.
- Stack several images into a single image (Todo).
- Write image data to a FITS file (Todo).

$(keywords())

!!! warning "Companion content"
[learn.JuliaAstro > Working with FITS tables](/tutorials/fits-tables/)
[learn.JuliaAstro > Working with FITS tables](/tutorials/fits-tables/)
"""

# ╔═╡ 00000000-0000-0000-0000-000000000001
Expand Down
74 changes: 37 additions & 37 deletions src/tutorials/fileio-fits_tables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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})

<parse hdu.cards for TTYPEN, TFORMN, TUNITN, etc.>

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})

<parse hdu.cards for TTYPEN, TFORMN, TUNITN, etc.>

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
Expand All @@ -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.
"""
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -207,14 +207,14 @@ This notebook is modified from <https://learn.astropy.org/tutorials/FITS-tables.
_Original authors: Lia Corrales, Kris Stern_

!!! tip "Learning goals"
- Download a FITS table file from a URL.
- Open a FITS table file and view table contents.
- Make a 2D histogram with the table data.
- Download a FITS table file from a URL.
- Open a FITS table file and view table contents.
- Make a 2D histogram with the table data.

$(keywords())

!!! warning "Companion content"
Content here.
Content here.
"""

# ╔═╡ 00000000-0000-0000-0000-000000000001
Expand Down
Loading
Loading