Skip to content

Commit 84fc9d8

Browse files
committed
updated FITS examples
1 parent 53780c0 commit 84fc9d8

File tree

2 files changed

+100
-83
lines changed

2 files changed

+100
-83
lines changed

src/tutorials/fileio-fits_images.jl

Lines changed: 36 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -225,22 +225,11 @@ md"""
225225
We start by downloading our data of the Horsehead Nebula from the link below:
226226
"""
227227

228-
# ╔═╡ 22c1c673-928d-4889-bc7d-a400887fb450
229-
hdus = (fits download)("http://data.astropy.org/tutorials/FITS-images/HorseHead.fits");
230-
231-
# ╔═╡ 9d8387eb-cc5a-4b95-8eca-cb9094274927
232-
md"""
233-
!!! tip
234-
We use the [`∘` operator](https://docs.julialang.org/en/v1/manual/functions/#Function-composition-and-piping) (typed `\circ<TAB>`) to ergonomically compose functions together. This is equivalent to `fits(download(url))`, just with fewer nested parentheses.
235-
"""
236-
237-
# ╔═╡ ac175741-47e6-4d37-afaa-3f4a51c29fac
238-
md"""
239-
Taking a look, we see that we have the following HDUs:
240-
"""
241-
242-
# ╔═╡ 345d3657-d932-4fa7-b9eb-f67ce01db3b0
243-
info(hdus)
228+
# ╔═╡ 1e05c329-a82a-4ed8-ba02-11e155539059
229+
hdus = let
230+
fpath = download("http://data.astropy.org/tutorials/FITS-images/HorseHead.fits")
231+
fits(fpath; scale = false)
232+
end
244233

245234
# ╔═╡ eaf39dba-e724-4eac-9a14-28fcd179efc7
246235
md"""
@@ -252,7 +241,10 @@ img_data = hdus[1].data
252241

253242
# ╔═╡ a9ec676e-8d14-48af-b3ea-6482dce86832
254243
md"""
255-
We see that our image is an $(size(img_data, 1)) × $(size(img_data, 2)) array of 16-bit integers. This can be visualized in the same way as our heatmap examples above:
244+
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.
245+
246+
!!! tip "Todo"
247+
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>.
256248
"""
257249

258250
# ╔═╡ b3c6961a-b8a6-4597-aaf7-a97cae793670
@@ -471,22 +463,22 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
471463
AstroImages = {rev = "aog-v0.12", url = "https://github.com/icweaver/AstroImages.jl"}
472464
473465
[compat]
474-
AlgebraOfGraphics = "~0.12.0"
466+
AlgebraOfGraphics = "~0.11.10"
475467
AstroImages = "~0.5.1"
476468
CairoMakie = "~0.15.8"
477469
DataFramesMeta = "~0.15.6"
478-
FITSFiles = "~0.2.0"
479-
PlutoUI = "~0.7.76"
470+
FITSFiles = "~0.3.1"
471+
PlutoUI = "~0.7.77"
480472
StatsBase = "~0.34.9"
481473
"""
482474

483475
# ╔═╡ 00000000-0000-0000-0000-000000000002
484476
PLUTO_MANIFEST_TOML_CONTENTS = """
485477
# This file is machine-generated - editing it directly is not advised
486478
487-
julia_version = "1.12.2"
479+
julia_version = "1.12.3"
488480
manifest_format = "2.0"
489-
project_hash = "27691e28acb68a8b385fe6e82b37bac612218fe3"
481+
project_hash = "dac5cf7e07b94b30a9244f668c2ea2c96e435e4f"
490482
491483
[[deps.AbstractFFTs]]
492484
deps = ["LinearAlgebra"]
@@ -552,9 +544,9 @@ version = "1.2.0"
552544
553545
[[deps.AlgebraOfGraphics]]
554546
deps = ["Accessors", "Colors", "DataAPI", "Dates", "Dictionaries", "FileIO", "GLM", "GeoInterface", "GeometryBasics", "GridLayoutBase", "Isoband", "KernelDensity", "Loess", "Makie", "NaturalSort", "PlotUtils", "PolygonOps", "PooledArrays", "PrecompileTools", "RelocatableFolders", "StatsBase", "StructArrays", "Tables"]
555-
git-tree-sha1 = "9ac1199d4d2e4e021af66cc1b34327b1615cbce3"
547+
git-tree-sha1 = "41b570924747cf4b9b463d4ae1af9129948b06ca"
556548
uuid = "cbdf2221-f076-402e-a563-3d30da359d67"
557-
version = "0.12.0"
549+
version = "0.11.10"
558550
559551
[deps.AlgebraOfGraphics.extensions]
560552
AlgebraOfGraphicsDynamicQuantitiesExt = "DynamicQuantities"
@@ -872,9 +864,7 @@ version = "0.4.6"
872864
873865
[[deps.DimensionalData]]
874866
deps = ["Adapt", "ArrayInterface", "ConstructionBase", "DataAPI", "Dates", "Extents", "Interfaces", "IntervalSets", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "PrecompileTools", "Random", "RecipesBase", "Statistics", "TableTraits", "Tables"]
875-
git-tree-sha1 = "f8a086fcef38392393a2e439ca8b1ef5c02d6d25"
876-
repo-rev = "compat-aog-v1.12"
877-
repo-url = "https://github.com/icweaver/DimensionalData.jl"
867+
git-tree-sha1 = "147961441e5cb35da0af404aa4684d2e74ec68eb"
878868
uuid = "0703355e-b756-11e9-17c0-8b28908087d0"
879869
version = "0.29.25"
880870
@@ -991,10 +981,10 @@ uuid = "f5851436-0d7a-5f13-b9de-f02708fd171a"
991981
version = "3.3.11+0"
992982
993983
[[deps.FITSFiles]]
994-
deps = ["CodecZlib", "Printf", "Unitful", "UnitfulAstro"]
995-
git-tree-sha1 = "c5a041e47b26cc10ca71ff39ef66cfb816fc9edd"
984+
deps = ["CodecZlib", "Printf", "Unitful", "UnitfulAngles", "UnitfulAstro", "UnitfulAtomic"]
985+
git-tree-sha1 = "b30dbae32cdaed2d2cc0ec502d4f7cf2044fe403"
996986
uuid = "358a0a88-3548-4ad6-b652-8bdbf64af8e5"
997-
version = "0.2.0"
987+
version = "0.3.1"
998988
999989
[[deps.FITSIO]]
1000990
deps = ["CFITSIO", "Printf", "Reexport", "Tables"]
@@ -1403,9 +1393,9 @@ version = "0.1.6"
14031393
14041394
[[deps.JpegTurbo_jll]]
14051395
deps = ["Artifacts", "JLLWrappers", "Libdl"]
1406-
git-tree-sha1 = "4255f0032eafd6451d707a51d5f0248b8a165e4d"
1396+
git-tree-sha1 = "b6893345fd6658c8e475d40155789f4860ac3b21"
14071397
uuid = "aacddb02-875f-59d6-b918-886e6ef4fbf8"
1408-
version = "3.1.3+0"
1398+
version = "3.1.4+0"
14091399
14101400
[[deps.JuliaSyntaxHighlighting]]
14111401
deps = ["StyledStrings"]
@@ -1762,7 +1752,7 @@ version = "0.44.2+0"
17621752
[[deps.Pkg]]
17631753
deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "Random", "SHA", "TOML", "Tar", "UUIDs", "p7zip_jll"]
17641754
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
1765-
version = "1.12.0"
1755+
version = "1.12.1"
17661756
weakdeps = ["REPL"]
17671757
17681758
[deps.Pkg.extensions]
@@ -1782,9 +1772,9 @@ version = "1.4.4"
17821772
17831773
[[deps.PlutoUI]]
17841774
deps = ["AbstractPlutoDingetjes", "Base64", "ColorTypes", "Dates", "Downloads", "FixedPointNumbers", "Hyperscript", "HypertextLiteral", "IOCapture", "InteractiveUtils", "Logging", "MIMEs", "Markdown", "Random", "Reexport", "URIs", "UUIDs"]
1785-
git-tree-sha1 = "0d751d4ceb9dbd402646886332c2f99169dc1cfd"
1775+
git-tree-sha1 = "6ed167db158c7c1031abf3bd67f8e689c8bdf2b7"
17861776
uuid = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
1787-
version = "0.7.76"
1777+
version = "0.7.77"
17881778
17891779
[[deps.PolygonOps]]
17901780
git-tree-sha1 = "77b3d3605fc1cd0b42d95eba87dfcd2bf67d5ff6"
@@ -1805,9 +1795,9 @@ version = "1.3.3"
18051795
18061796
[[deps.Preferences]]
18071797
deps = ["TOML"]
1808-
git-tree-sha1 = "0f27480397253da18fe2c12a4ba4eb9eb208bf3d"
1798+
git-tree-sha1 = "522f093a29b31a93e34eaea17ba055d850edea28"
18091799
uuid = "21216c6a-2e73-6563-6e65-726566657250"
1810-
version = "1.5.0"
1800+
version = "1.5.1"
18111801
18121802
[[deps.PrettyTables]]
18131803
deps = ["Crayons", "LaTeXStrings", "Markdown", "PrecompileTools", "Printf", "REPL", "Reexport", "StringManipulation", "Tables"]
@@ -1932,9 +1922,9 @@ version = "1.3.0"
19321922
19331923
[[deps.SentinelArrays]]
19341924
deps = ["Dates", "Random"]
1935-
git-tree-sha1 = "712fb0231ee6f9120e005ccd56297abbc053e7e0"
1925+
git-tree-sha1 = "ebe7e59b37c400f694f52b58c93d26201387da70"
19361926
uuid = "91c51154-3ec4-41a3-a24f-3f23e20d615c"
1937-
version = "1.4.8"
1927+
version = "1.4.9"
19381928
19391929
[[deps.Serialization]]
19401930
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
@@ -2241,6 +2231,12 @@ git-tree-sha1 = "fbe44a0ade62ae5ed0240ad314dfdd5482b90b40"
22412231
uuid = "6112ee07-acf9-5e0f-b108-d242c714bf9f"
22422232
version = "1.2.2"
22432233
2234+
[[deps.UnitfulAtomic]]
2235+
deps = ["Unitful"]
2236+
git-tree-sha1 = "903be579194534af1c4b4778d1ace676ca042238"
2237+
uuid = "a7773ee8-282e-5fa2-be4e-bd808c38a91a"
2238+
version = "1.0.0"
2239+
22442240
[[deps.WCS]]
22452241
deps = ["ConstructionBase", "WCS_jll"]
22462242
git-tree-sha1 = "c12065744b66adfed32d24c2a13a3053cc235ea7"
@@ -2430,10 +2426,7 @@ version = "4.1.0+0"
24302426
# ╟─f7aca318-a535-4a86-8c29-92d90db96271
24312427
# ╟─0598bfc5-0900-4b04-ad84-9638b89869b9
24322428
# ╟─ad35dd30-40f5-4bd7-b1d6-b81a226e85ab
2433-
# ╠═22c1c673-928d-4889-bc7d-a400887fb450
2434-
# ╟─9d8387eb-cc5a-4b95-8eca-cb9094274927
2435-
# ╟─ac175741-47e6-4d37-afaa-3f4a51c29fac
2436-
# ╠═345d3657-d932-4fa7-b9eb-f67ce01db3b0
2429+
# ╠═1e05c329-a82a-4ed8-ba02-11e155539059
24372430
# ╟─eaf39dba-e724-4eac-9a14-28fcd179efc7
24382431
# ╠═798dbe98-c2d5-4dd2-b624-f5df795ef470
24392432
# ╟─a9ec676e-8d14-48af-b3ea-6482dce86832

0 commit comments

Comments
 (0)